From 43b4e7005acdcfc8ca61f14a64e693e96818d219 Mon Sep 17 00:00:00 2001 From: Peter Solnica Date: Mon, 11 May 2026 11:53:31 +0200 Subject: [PATCH 01/22] refa(devcontainer): rework to use mise for fast switching --- .devcontainer/.env.example | 16 ++- .devcontainer/Dockerfile | 48 +++++++-- .devcontainer/devcontainer-lock.json | 29 ++++++ .devcontainer/devcontainer.json | 3 +- .devcontainer/docker-compose.yml | 19 ++-- .devcontainer/run | 142 +++++++++++---------------- .devcontainer/setup | 22 +---- .mise.toml | 15 +++ Procfile | 2 - 9 files changed, 169 insertions(+), 127 deletions(-) create mode 100644 .devcontainer/devcontainer-lock.json create mode 100644 .mise.toml delete mode 100644 Procfile diff --git a/.devcontainer/.env.example b/.devcontainer/.env.example index 5ebb7ea84..c236eb68e 100644 --- a/.devcontainer/.env.example +++ b/.devcontainer/.env.example @@ -1,8 +1,16 @@ -# Official Ruby images -IMAGE="ruby:3.4.5-slim-bookworm" -VERSION="3.4.5" +# Devcontainer build configuration +# +# Modern flavor (default): newest Ubuntu, latest stable Ruby pre-installed. +# Within the container, mise can switch to any other Ruby >= 3.1 instantly. +BASE_IMAGE="ubuntu:latest" +RUBY_VERSION="3.4.8" -# IMAGE="jruby:latest" +# Legacy flavor: older Ubuntu where Ruby 2.7 / 3.0 still compile. +# Uncomment these (and comment the modern ones above) when you need to +# work on the EOL Ruby versions, then rebuild the devcontainer. +# +# BASE_IMAGE="ubuntu:22.04" +# RUBY_VERSION="2.7.8" # E2E testing SENTRY_DSN="http://user:pass@sentry.localhost/project/42" diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index d083a7abc..a699e0219 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,6 +1,5 @@ -ARG IMAGE="ruby" - -FROM ${IMAGE} AS build +ARG BASE_IMAGE=ubuntu:24.04 +FROM ${BASE_IMAGE} RUN apt-get update && apt-get install -y --no-install-recommends \ sudo \ @@ -8,6 +7,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ git \ curl \ wget \ + ca-certificates \ build-essential \ pkg-config \ libssl-dev \ @@ -21,27 +21,55 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ libgdbm-dev \ sqlite3 \ libsqlite3-dev \ + tzdata \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* RUN echo "sentry ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/sentry \ && chmod 0440 /etc/sudoers.d/sentry -RUN groupadd --gid 1000 sentry \ +RUN userdel -r ubuntu 2>/dev/null || true \ + && groupdel ubuntu 2>/dev/null || true \ + && groupadd --gid 1000 sentry \ && useradd --uid 1000 --gid sentry --shell /bin/bash --create-home sentry WORKDIR /workspace/sentry RUN chown -R sentry:sentry /workspace/sentry -ARG VERSION -ARG GEM_HOME="/workspace/sentry/vendor/gems/${VERSION}" - ENV LANG=C.UTF-8 \ BUNDLE_JOBS=4 \ BUNDLE_RETRY=3 \ - GEM_HOME=/workspace/sentry/vendor/gems/${VERSION} \ - PATH=$PATH:${GEM_HOME}/bin \ - REDIS_HOST=redis + REDIS_HOST=redis \ + PATH=/home/sentry/.local/share/mise/shims:/home/sentry/.local/bin:$PATH USER sentry + +# Pre-create the bundle directory owned by sentry so that a Docker named volume +# mounted here is initialised with the correct ownership (Docker copies image +# directory content when a volume is first attached). +RUN mkdir -p /home/sentry/bundle + +RUN curl https://mise.run | sh \ + && echo 'eval "$(/home/sentry/.local/bin/mise activate bash)"' >> /home/sentry/.bashrc \ + && echo 'eval "$(/home/sentry/.local/bin/mise activate zsh)"' >> /home/sentry/.zshenv + +# When RUBY_VERSION is provided at build time, pre-install that Ruby so the +# container starts immediately without downloading it at runtime. When it is +# empty (local dev builds) Ruby is installed lazily by the `run` entrypoint. +ARG RUBY_VERSION="" +RUN if [ -n "${RUBY_VERSION}" ]; then \ + echo "๐Ÿ“ฆ Pre-installing ruby@${RUBY_VERSION} (precompiled)..." && \ + MISE_RUBY_COMPILE=0 /home/sentry/.local/bin/mise install "ruby@${RUBY_VERSION}" && \ + /home/sentry/.local/bin/mise use --global "ruby@${RUBY_VERSION}"; \ + fi + +# Node.js is always needed for the svelte-mini e2e app. +RUN echo "๐Ÿ“ฆ Pre-installing node@lts..." && \ + /home/sentry/.local/bin/mise install "node@lts" && \ + /home/sentry/.local/bin/mise use --global "node@lts" + +# Install headless Chromium via Playwright (includes all system dependencies). +# Symlink the binary into ~/.local/bin which is already on PATH. +RUN /home/sentry/.local/share/mise/shims/npx playwright install chromium --with-deps +RUN bash -c 'ln -sf /home/sentry/.cache/ms-playwright/chromium-*/chrome-linux/chrome /home/sentry/.local/bin/chromium' diff --git a/.devcontainer/devcontainer-lock.json b/.devcontainer/devcontainer-lock.json new file mode 100644 index 000000000..1cf373bb3 --- /dev/null +++ b/.devcontainer/devcontainer-lock.json @@ -0,0 +1,29 @@ +{ + "features": { + "ghcr.io/devcontainers-extra/features/npm-packages:latest": { + "version": "1.0.1", + "resolved": "ghcr.io/devcontainers-extra/features/npm-packages@sha256:0851cc312204f4044f22230986134026409565f9e632d8ab2b8c639e81cedd7c", + "integrity": "sha256:0851cc312204f4044f22230986134026409565f9e632d8ab2b8c639e81cedd7c" + }, + "ghcr.io/devcontainers/features/github-cli:latest": { + "version": "1.1.0", + "resolved": "ghcr.io/devcontainers/features/github-cli@sha256:d22f50b70ed75339b4eed1ba9ecde3a1791f90e88d37936517e3bace0bbad671", + "integrity": "sha256:d22f50b70ed75339b4eed1ba9ecde3a1791f90e88d37936517e3bace0bbad671" + }, + "ghcr.io/devcontainers/features/node:latest": { + "version": "2.0.0", + "resolved": "ghcr.io/devcontainers/features/node@sha256:fedd4c11f7adfb64283b578dddc7da906728daa25fa293351c9d913231acf12f", + "integrity": "sha256:fedd4c11f7adfb64283b578dddc7da906728daa25fa293351c9d913231acf12f" + }, + "ghcr.io/nils-geistmann/devcontainers-features/zsh:latest": { + "version": "0.0.8", + "resolved": "ghcr.io/nils-geistmann/devcontainers-features/zsh@sha256:fd57a61a5187480b5e73f8041be5b67005be48f06503736df6cfdd8d0f38f3c4", + "integrity": "sha256:fd57a61a5187480b5e73f8041be5b67005be48f06503736df6cfdd8d0f38f3c4" + }, + "ghcr.io/rocker-org/devcontainer-features/apt-packages:latest": { + "version": "1.0.2", + "resolved": "ghcr.io/rocker-org/devcontainer-features/apt-packages@sha256:87a4d7750a596a5db034ba8508782f31aebdc2ffe955c66aaecb33d9de2ecdae", + "integrity": "sha256:87a4d7750a596a5db034ba8508782f31aebdc2ffe955c66aaecb33d9de2ecdae" + } + } +} diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index f21983fb3..4f89e2184 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -5,12 +5,11 @@ "workspaceFolder": "/workspace/sentry", "features": { "ghcr.io/devcontainers/features/github-cli:latest": {}, - "ghcr.io/devcontainers-extra/features/mise:latest": {}, "ghcr.io/nils-geistmann/devcontainers-features/zsh:latest": {}, "ghcr.io/devcontainers/features/node:latest": {}, "ghcr.io/devcontainers-extra/features/npm-packages:latest": {}, "ghcr.io/rocker-org/devcontainer-features/apt-packages:latest": { - "packages": "inotify-tools" + "packages": "inotify-tools,tzdata" } }, "customizations": { diff --git a/.devcontainer/docker-compose.yml b/.devcontainer/docker-compose.yml index a85243cba..140515b11 100644 --- a/.devcontainer/docker-compose.yml +++ b/.devcontainer/docker-compose.yml @@ -5,8 +5,8 @@ services: context: .. dockerfile: .devcontainer/Dockerfile args: - IMAGE: ${IMAGE} - VERSION: ${VERSION} + BASE_IMAGE: ${BASE_IMAGE:-ubuntu:latest} + RUBY_VERSION: ${RUBY_VERSION:-} volumes: - ..:/workspace/sentry:cached working_dir: /workspace/sentry @@ -14,15 +14,19 @@ services: sentry-dev: <<: *sentry-build - entrypoint: ".devcontainer/run --service dev" - command: "sleep infinity" + entrypoint: [".devcontainer/run"] depends_on: - redis sentry-test: <<: *sentry-build - entrypoint: ".devcontainer/run --service test" - command: ["foreman", "start"] + entrypoint: [".devcontainer/run"] + command: ["mise", "run", "e2e:serve"] + environment: + BUNDLE_PATH: /home/sentry/bundle + volumes: + - ..:/workspace/sentry:cached + - bundle-gems:/home/sentry/bundle ports: - "${SENTRY_E2E_RAILS_APP_PORT}:4000" - "${SENTRY_E2E_SVELTE_APP_PORT}:4001" @@ -33,3 +37,6 @@ services: - ALLOW_EMPTY_PASSWORD=yes ports: - "6379:6379" + +volumes: + bundle-gems: diff --git a/.devcontainer/run b/.devcontainer/run index 59661dace..7b2d6e36c 100755 --- a/.devcontainer/run +++ b/.devcontainer/run @@ -1,92 +1,64 @@ #!/bin/bash - -set -e +# +# Container entrypoint. +# +# Order of operations: +# 1. Set up mise (the Ruby version manager) for this shell. +# 2. Ensure the desired Ruby is installed (precompiled, no source build). +# 3. Hand off to whatever docker-compose passes as `command`. +# +set -euo pipefail cd /workspace/sentry -sudo mkdir -p vendor/gems -sudo chown -R sentry:sentry vendor/gems - -# git config --global --replace-all safe.directory /workspace/sentry -# git config --global --replace-all safe.directory /workspace/sentry/vendor/gems/* - -sudo chown -R sentry:sentry . - -run_service_setup() { - local service="$1" - - echo "๐Ÿš€ Running setup for service: $service" - - case "$service" in - "dev") - if ! .devcontainer/setup --with-foreman --only-bundle; then - echo "โŒ Setup failed for service: $service" - exit 1 - fi - ;; - "test") - if ! .devcontainer/setup --with-foreman --only .,spec/apps/rails-mini; then - echo "โŒ Setup failed for service: $service" - exit 1 - fi - ;; - *) - echo "โŒ Unknown service: $service" - echo "Available services: dev, test" - exit 1 - ;; - esac - - echo "โœ… Setup completed for service: $service" -} - -# Function to start services in background -start_services_if_needed() { - # Check if we're running tests (bundle exec rake) - if [[ "$*" == *"bundle exec rake"* ]]; then - echo "๐Ÿš€ Starting e2e services in background for test execution..." - - # Start foreman in background - foreman start & - FOREMAN_PID=$! - - # Wait for services to be ready - echo "โณ Waiting for services to start..." - for i in {1..30}; do - if curl -f http://localhost:4000/health >/dev/null 2>&1 && \ - curl -f http://localhost:4001/health >/dev/null 2>&1; then - echo "โœ… Services are ready!" - break - fi - - if [ $i -eq 30 ]; then - echo "โŒ Services failed to start within timeout" - kill $FOREMAN_PID 2>/dev/null || true - exit 1 - fi - - sleep 2 - done - - # Set up cleanup trap - trap "echo '๐Ÿงน Stopping services...'; kill $FOREMAN_PID 2>/dev/null || true; wait $FOREMAN_PID 2>/dev/null || true" EXIT - fi -} - -# Parse arguments -if [ "$1" = "--service" ] && [ -n "$2" ]; then - service="$2" - shift 2 - - run_service_setup "$service" - - if [ $# -gt 0 ]; then - start_services_if_needed "$@" - exec "$@" - else - exec bash - fi +# In CI the workspace is checked out by the runner user (e.g. UID 1001) and +# then bind-mounted into the container where we run as sentry (UID 1000). +# Fix ownership once here so bundler, git, etc. can write freely. +sudo chown -R sentry:sentry /workspace/sentry 2>/dev/null || true + +# Git also refuses to operate in directories owned by a different user. +git config --global --add safe.directory /workspace/sentry 2>/dev/null || true + +mise trust + +# ---- 1. mise setup ----------------------------------------------------------- + +MISE_BIN="/home/sentry/.local/bin/mise" + +if [[ ! -x "$MISE_BIN" ]]; then + echo "โŒ mise not found at $MISE_BIN (it should be installed by the Dockerfile)" + exit 1 +fi + +# Activate mise for this shell so PATH/shims are resolved correctly. +eval "$("$MISE_BIN" activate bash)" + +# Trust the workspace config so mise will use it without prompting. +"$MISE_BIN" trust /workspace/sentry >/dev/null + +# ---- 2. Install Ruby (precompiled) ------------------------------------------- + +# Default to the latest Ruby unless the caller pins a specific version. +RUBY_VERSION="${RUBY_VERSION:-latest}" + +# Always pull a precompiled binary from jdx/ruby โ€” never build from source. +export MISE_RUBY_COMPILE=0 + +# Skip installation when the version is already present in the image (e.g. CI +# images built with the RUBY_VERSION build arg in the Dockerfile). +if "$MISE_BIN" list ruby 2>/dev/null | grep -qF "${RUBY_VERSION}"; then + echo "โœ… ruby@${RUBY_VERSION} already installed, skipping download." +else + echo "๐Ÿ“ฆ Installing ruby@${RUBY_VERSION} (precompiled)..." + "$MISE_BIN" install "ruby@${RUBY_VERSION}" +fi + +"$MISE_BIN" use --global "ruby@${RUBY_VERSION}" + +# ---- 3. Hand off ------------------------------------------------------------- + +if [[ $# -eq 0 ]]; then + exec sleep infinity else - start_services_if_needed "$@" exec "$@" fi diff --git a/.devcontainer/setup b/.devcontainer/setup index 9789d999f..1c93e65ff 100755 --- a/.devcontainer/setup +++ b/.devcontainer/setup @@ -35,7 +35,6 @@ class SetupScript if should_run_bundle? cleanup_ruby_lsp_directories - update_rubygems_and_bundler install_bundle_dependencies install_foreman_gem if @options[:with_foreman] end @@ -123,7 +122,7 @@ class SetupScript Dir.chdir(folder_path) do puts " Installing dependencies for #{folder_path}..." - unless system("[ -f Gemfile.lock ] && rm Gemfile.lock; bundle install") + unless system("bundle install") puts "โŒ Bundle install failed for #{folder}" exit 1 end @@ -139,22 +138,9 @@ class SetupScript def update_rubygems_and_bundler puts "๐Ÿ“ฆ Updating RubyGems and Bundler..." - if RUBY_VERSION >= "3.0" - unless system("sudo gem update --system --silent") - puts "โŒ RubyGems update failed" - exit 1 - end - else - unless system("sudo gem update --silent --system 3.4.22") - puts "โŒ RubyGems update failed" - exit 1 - end - - # sentry-sidekiq does not bundle with Bundler 2.5.x that ships with RubyGems 3.4.22 - unless system("sudo gem install bundler -v 2.4.22") - puts "โŒ Bundler installation failed" - exit 1 - end + unless system("gem update --system --silent") + puts "โŒ RubyGems update failed" + exit 1 end end diff --git a/.mise.toml b/.mise.toml new file mode 100644 index 000000000..0658c4b3d --- /dev/null +++ b/.mise.toml @@ -0,0 +1,15 @@ +[tools] +ruby = "latest" +node = "lts" + +[tasks."e2e:rails"] +description = "Start the rails-mini e2e app" +run = "cd spec/apps/rails-mini && bundle exec ruby app.rb" + +[tasks."e2e:svelte"] +description = "Start the svelte-mini e2e app" +run = "cd spec/apps/svelte-mini && npm run dev" + +[tasks."e2e:serve"] +description = "Start all e2e apps in parallel" +depends = ["e2e:rails", "e2e:svelte"] diff --git a/Procfile b/Procfile deleted file mode 100644 index 321f75768..000000000 --- a/Procfile +++ /dev/null @@ -1,2 +0,0 @@ -rails: cd spec/apps/rails-mini && bundle exec ruby app.rb -svelte: cd spec/apps/svelte-mini && npm run dev From 7df491c21e6482c8dd15abf7805d3a73658fd423 Mon Sep 17 00:00:00 2001 From: Peter Solnica Date: Mon, 11 May 2026 11:53:40 +0200 Subject: [PATCH 02/22] fix(ci): update workflows for mise-based devcontainer --- .github/workflows/build_images.yml | 59 ++++++++---------------------- .github/workflows/e2e_tests.yml | 30 ++++++++------- 2 files changed, 33 insertions(+), 56 deletions(-) diff --git a/.github/workflows/build_images.yml b/.github/workflows/build_images.yml index 0a07303ea..d4df0fbc2 100644 --- a/.github/workflows/build_images.yml +++ b/.github/workflows/build_images.yml @@ -9,11 +9,11 @@ on: - .github/workflows/build_images.yml # Uncomment if you want to test things out in a PR - # - # pull_request: - # paths: - # - .devcontainer/** - # - .github/workflows/build_images.yml + + pull_request: + paths: + - .devcontainer/** + - .github/workflows/build_images.yml permissions: contents: read @@ -23,58 +23,31 @@ jobs: build-and-push: runs-on: ubuntu-latest strategy: + fail-fast: false matrix: - ruby_image: - - ruby:2.7.8-slim-bullseye - - ruby:3.0.7-slim-bullseye - - ruby:3.1.7-slim-bookworm - - ruby:3.2.9-slim-trixie - - ruby:3.3.10-slim-trixie - - ruby:3.4.8-slim-trixie - - ruby:4.0.0-slim-trixie + include: + - flavor: modern + base_image: ubuntu:latest + ruby_version: "3.4.8" + - flavor: legacy + base_image: ubuntu:22.04 + ruby_version: "2.7.8" steps: - name: Check out current commit uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 - - name: Generate short image name and extract version - id: image_name - run: | - ruby_image="${{ matrix.ruby_image }}" - - # Extract full version for GEM_HOME (e.g., ruby:3.4.5-slim-bookworm -> 3.4.5) - if [[ "$ruby_image" == ruby:* ]]; then - full_version=$(echo "$ruby_image" | cut -d: -f2 | cut -d- -f1) - version=$(echo "$ruby_image" | cut -d: -f2 | cut -d. -f1,2) - short_name="sentry-ruby-devcontainer-${version}" - elif [[ "$ruby_image" == jruby:latest ]]; then - full_version="latest" - short_name="sentry-ruby-devcontainer-jruby-latest" - elif [[ "$ruby_image" == jruby:* ]]; then - full_version=$(echo "$ruby_image" | cut -d: -f2 | cut -d- -f1) - version=$(echo "$ruby_image" | cut -d: -f2 | cut -d. -f1,2) - short_name="sentry-ruby-devcontainer-jruby-${version}" - else - full_version="latest" - short_name="sentry-ruby-devcontainer-${ruby_image}" - fi - - echo "short_name=${short_name}" >> $GITHUB_OUTPUT - echo "full_version=${full_version}" >> $GITHUB_OUTPUT - echo "Generated short image name: ${short_name}" - echo "Extracted full version: ${full_version}" - - name: Build and push devcontainer image id: build uses: getsentry/action-build-and-push-images@8fc75e483c09a68721f2c8951292ee17f8821766 # main with: - image_name: "${{ steps.image_name.outputs.short_name }}" + image_name: "sentry-ruby-devcontainer-${{ matrix.flavor }}" dockerfile_path: ".devcontainer/Dockerfile" ghcr: true publish_on_pr: true build_args: | - IMAGE=${{ matrix.ruby_image }} - VERSION=${{ steps.image_name.outputs.full_version }} + BASE_IMAGE=${{ matrix.base_image }} + RUBY_VERSION=${{ matrix.ruby_version }} - name: Use outputs run: | diff --git a/.github/workflows/e2e_tests.yml b/.github/workflows/e2e_tests.yml index 82f7a013e..70b201813 100644 --- a/.github/workflows/e2e_tests.yml +++ b/.github/workflows/e2e_tests.yml @@ -23,11 +23,7 @@ jobs: strategy: fail-fast: false matrix: - ruby_version: ["3.4.5"] - - env: - DOCKER_IMAGE: "ghcr.io/getsentry/sentry-ruby-devcontainer-3.4" - DOCKER_TAG: "d54d0ea1ee3e0d49f2b86d2689278447ccbbe0f9" + ruby_version: ["3.4.8"] steps: - name: Checkout code @@ -37,14 +33,22 @@ jobs: run: | cd .devcontainer cp .env.example .env + echo "RUBY_VERSION=${{ matrix.ruby_version }}" >> .env - - name: Restore rubygems cache - uses: actions/cache@6f8efc29b200d32929f49075959781ed54ec270c # v3 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3 + + - name: Build test container image + uses: docker/build-push-action@14487ce63c7a62a4a324b0bfb37086795e31c6c1 # v6 with: - path: vendor/gems - key: ${{ runner.os }}-${{ matrix.ruby_version }}-gems-${{ hashFiles('Gemfile.lock', '*/Gemfile.lock', 'spec/apps/**/Gemfile.lock') }} - restore-keys: | - ${{ runner.os }}-${{ matrix.ruby_version }}-gems- + context: . + file: .devcontainer/Dockerfile + load: true + tags: sentry-ruby-devcontainer:latest + build-args: | + RUBY_VERSION=${{ matrix.ruby_version }} + cache-from: type=gha + cache-to: type=gha,mode=max - name: Restore node_modules cache uses: actions/cache@6f8efc29b200d32929f49075959781ed54ec270c # v3 @@ -60,14 +64,14 @@ jobs: --file .devcontainer/docker-compose.yml \ --env-file .devcontainer/.env \ run --rm sentry-test \ - echo "Done" + .devcontainer/setup --only .,spec/apps/rails-mini - name: Start test services run: | docker compose \ --file .devcontainer/docker-compose.yml \ --env-file .devcontainer/.env \ - up -d sentry-test + up -d --no-build sentry-test - name: "Wait for rails-mini app to be ready" uses: nev7n/wait_for_response@81b0b0eded16435202e126beb3e704fc00430f5b # v1 From d6cd2e661e48ec2ac388c05bccc16325f511d554 Mon Sep 17 00:00:00 2001 From: Peter Solnica Date: Mon, 11 May 2026 11:53:46 +0200 Subject: [PATCH 03/22] fix(e2e): use playwright-managed chromium --- spec/spec_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index ea53b64b9..fbc3cb669 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -25,7 +25,7 @@ options.add_argument("--no-sandbox") options.add_argument("--disable-gpu") options.add_argument("--temp-profile") - options.binary = "/usr/bin/chromium" if File.exist?("/usr/bin/chromium") + options.binary = "/home/sentry/.local/bin/chromium" if File.exist?("/home/sentry/.local/bin/chromium") Capybara::Selenium::Driver.new(app, browser: :chrome, options: options) end From ced5fca40593a2f705a3830b175a0289fb6e4e37 Mon Sep 17 00:00:00 2001 From: Peter Solnica Date: Mon, 11 May 2026 12:05:34 +0200 Subject: [PATCH 04/22] refa(workflows): update build_images and e2e_tests for Ruby 4.0 and 3.4 --- .github/workflows/build_images.yml | 11 +++++++---- .github/workflows/e2e_tests.yml | 30 ++++++++++++++++-------------- 2 files changed, 23 insertions(+), 18 deletions(-) diff --git a/.github/workflows/build_images.yml b/.github/workflows/build_images.yml index d4df0fbc2..22d3fee8c 100644 --- a/.github/workflows/build_images.yml +++ b/.github/workflows/build_images.yml @@ -26,10 +26,13 @@ jobs: fail-fast: false matrix: include: - - flavor: modern - base_image: ubuntu:latest - ruby_version: "3.4.8" - - flavor: legacy + - flavor: "4.0" + base_image: ubuntu:24.04 + ruby_version: "4.0.3" + - flavor: "3.4" + base_image: ubuntu:24.04 + ruby_version: "3.4.9" + - flavor: "2.7" base_image: ubuntu:22.04 ruby_version: "2.7.8" diff --git a/.github/workflows/e2e_tests.yml b/.github/workflows/e2e_tests.yml index 70b201813..99183e5aa 100644 --- a/.github/workflows/e2e_tests.yml +++ b/.github/workflows/e2e_tests.yml @@ -9,6 +9,7 @@ on: permissions: contents: read + packages: read concurrency: group: e2e-tests-${{ github.head_ref || github.run_id }} @@ -23,7 +24,11 @@ jobs: strategy: fail-fast: false matrix: - ruby_version: ["3.4.8"] + include: + - ruby_version: "3.4.9" + flavor: "3.4" + - ruby_version: "4.0.3" + flavor: "4.0" steps: - name: Checkout code @@ -34,21 +39,18 @@ jobs: cd .devcontainer cp .env.example .env echo "RUBY_VERSION=${{ matrix.ruby_version }}" >> .env + echo "DOCKER_IMAGE=ghcr.io/getsentry/sentry-ruby-devcontainer-${{ matrix.flavor }}" >> .env + echo "DOCKER_TAG=latest" >> .env - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3 - - - name: Build test container image - uses: docker/build-push-action@14487ce63c7a62a4a324b0bfb37086795e31c6c1 # v6 + - name: Log in to GHCR + uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3 with: - context: . - file: .devcontainer/Dockerfile - load: true - tags: sentry-ruby-devcontainer:latest - build-args: | - RUBY_VERSION=${{ matrix.ruby_version }} - cache-from: type=gha - cache-to: type=gha,mode=max + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Pull test container image + run: docker pull ghcr.io/getsentry/sentry-ruby-devcontainer-${{ matrix.flavor }}:latest - name: Restore node_modules cache uses: actions/cache@6f8efc29b200d32929f49075959781ed54ec270c # v3 From c15782977ba959edc05ae566d100136f006a3fdc Mon Sep 17 00:00:00 2001 From: Peter Solnica Date: Mon, 11 May 2026 12:10:28 +0200 Subject: [PATCH 05/22] fix(devcontainer): set DEBIAN_FRONTEND to noninteractive for apt-get install --- .devcontainer/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index a699e0219..eb138f265 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,7 +1,7 @@ ARG BASE_IMAGE=ubuntu:24.04 FROM ${BASE_IMAGE} -RUN apt-get update && apt-get install -y --no-install-recommends \ +RUN DEBIAN_FRONTEND=noninteractive apt-get update && apt-get install -y --no-install-recommends \ sudo \ gnupg \ git \ From 2cd8c424baa5b525d730dcf9b683c851a6eb1564 Mon Sep 17 00:00:00 2001 From: Peter Solnica Date: Mon, 11 May 2026 12:16:05 +0200 Subject: [PATCH 06/22] fix(devcontainer): correct mise command usage in entrypoint script --- .devcontainer/run | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.devcontainer/run b/.devcontainer/run index 7b2d6e36c..32726d207 100755 --- a/.devcontainer/run +++ b/.devcontainer/run @@ -15,16 +15,15 @@ cd /workspace/sentry # then bind-mounted into the container where we run as sentry (UID 1000). # Fix ownership once here so bundler, git, etc. can write freely. sudo chown -R sentry:sentry /workspace/sentry 2>/dev/null || true +MISE_BIN="/home/sentry/.local/bin/mise" # Git also refuses to operate in directories owned by a different user. git config --global --add safe.directory /workspace/sentry 2>/dev/null || true -mise trust +"$MISE_BIN" trust # ---- 1. mise setup ----------------------------------------------------------- -MISE_BIN="/home/sentry/.local/bin/mise" - if [[ ! -x "$MISE_BIN" ]]; then echo "โŒ mise not found at $MISE_BIN (it should be installed by the Dockerfile)" exit 1 From fcca3ee6a56aa72592a8bb0d960e1c0570e70d6b Mon Sep 17 00:00:00 2001 From: Peter Solnica Date: Mon, 11 May 2026 12:16:58 +0200 Subject: [PATCH 07/22] fix(devcontainer): remove unnecessary trust command from entrypoint script --- .devcontainer/run | 2 -- 1 file changed, 2 deletions(-) diff --git a/.devcontainer/run b/.devcontainer/run index 32726d207..fa262e490 100755 --- a/.devcontainer/run +++ b/.devcontainer/run @@ -20,8 +20,6 @@ MISE_BIN="/home/sentry/.local/bin/mise" # Git also refuses to operate in directories owned by a different user. git config --global --add safe.directory /workspace/sentry 2>/dev/null || true -"$MISE_BIN" trust - # ---- 1. mise setup ----------------------------------------------------------- if [[ ! -x "$MISE_BIN" ]]; then From d4888c1963c65fcaceb8c42978e21a74603fddea Mon Sep 17 00:00:00 2001 From: Peter Solnica Date: Mon, 11 May 2026 12:30:44 +0200 Subject: [PATCH 08/22] fix(e2e): use dynamic IMAGE_TAG for Docker image in e2e tests --- .github/workflows/e2e_tests.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/e2e_tests.yml b/.github/workflows/e2e_tests.yml index 99183e5aa..031e7f24b 100644 --- a/.github/workflows/e2e_tests.yml +++ b/.github/workflows/e2e_tests.yml @@ -20,6 +20,8 @@ jobs: name: e2e tests runs-on: ubuntu-latest timeout-minutes: 5 + env: + IMAGE_TAG: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }} strategy: fail-fast: false @@ -40,7 +42,7 @@ jobs: cp .env.example .env echo "RUBY_VERSION=${{ matrix.ruby_version }}" >> .env echo "DOCKER_IMAGE=ghcr.io/getsentry/sentry-ruby-devcontainer-${{ matrix.flavor }}" >> .env - echo "DOCKER_TAG=latest" >> .env + echo "DOCKER_TAG=${{ env.IMAGE_TAG }}" >> .env - name: Log in to GHCR uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3 @@ -50,7 +52,7 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Pull test container image - run: docker pull ghcr.io/getsentry/sentry-ruby-devcontainer-${{ matrix.flavor }}:latest + run: docker pull ghcr.io/getsentry/sentry-ruby-devcontainer-${{ matrix.flavor }}:${{ env.IMAGE_TAG }} - name: Restore node_modules cache uses: actions/cache@6f8efc29b200d32929f49075959781ed54ec270c # v3 From 4ba7828d826936b055a504a5123853a1264f96ca Mon Sep 17 00:00:00 2001 From: Peter Solnica Date: Mon, 11 May 2026 12:37:21 +0200 Subject: [PATCH 09/22] fix(devcontainer): set DEBIAN_FRONTEND environment variable before apt-get install --- .devcontainer/Dockerfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index eb138f265..c37adf424 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,7 +1,9 @@ ARG BASE_IMAGE=ubuntu:24.04 FROM ${BASE_IMAGE} -RUN DEBIAN_FRONTEND=noninteractive apt-get update && apt-get install -y --no-install-recommends \ +ENV DEBIAN_FRONTEND=noninteractive + +RUN apt-get update && apt-get install -y --no-install-recommends \ sudo \ gnupg \ git \ From a184ffb5a6cdb547eb810fd51ccd15dbb2db7585 Mon Sep 17 00:00:00 2001 From: Peter Solnica Date: Mon, 11 May 2026 12:45:26 +0200 Subject: [PATCH 10/22] fix(devcontainer): comment out pull_request trigger in build_images.yml --- .github/workflows/build_images.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build_images.yml b/.github/workflows/build_images.yml index 22d3fee8c..6b1f08055 100644 --- a/.github/workflows/build_images.yml +++ b/.github/workflows/build_images.yml @@ -10,10 +10,10 @@ on: # Uncomment if you want to test things out in a PR - pull_request: - paths: - - .devcontainer/** - - .github/workflows/build_images.yml + # pull_request: + # paths: + # - .devcontainer/** + # - .github/workflows/build_images.yml permissions: contents: read From 3f0330c1a03e682b6b3703797d4e3169f7d21e47 Mon Sep 17 00:00:00 2001 From: Peter Solnica Date: Mon, 11 May 2026 12:48:32 +0200 Subject: [PATCH 11/22] fix(devcontainer): update base image and Ruby version in .env.example --- .devcontainer/.env.example | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.devcontainer/.env.example b/.devcontainer/.env.example index c236eb68e..e16c507cf 100644 --- a/.devcontainer/.env.example +++ b/.devcontainer/.env.example @@ -2,8 +2,8 @@ # # Modern flavor (default): newest Ubuntu, latest stable Ruby pre-installed. # Within the container, mise can switch to any other Ruby >= 3.1 instantly. -BASE_IMAGE="ubuntu:latest" -RUBY_VERSION="3.4.8" +BASE_IMAGE="ubuntu:24.04" +RUBY_VERSION="3.4.9" # Legacy flavor: older Ubuntu where Ruby 2.7 / 3.0 still compile. # Uncomment these (and comment the modern ones above) when you need to From 9929d92b9620c69afcb293c4cb21acaaefd6bc55 Mon Sep 17 00:00:00 2001 From: Peter Solnica Date: Mon, 11 May 2026 13:02:18 +0200 Subject: [PATCH 12/22] fix(devcontainer): versioned containers --- .github/workflows/build_images.yml | 35 ++++++++++++++++++++---------- .github/workflows/e2e_tests.yml | 10 +++++---- 2 files changed, 30 insertions(+), 15 deletions(-) diff --git a/.github/workflows/build_images.yml b/.github/workflows/build_images.yml index 6b1f08055..b1784433a 100644 --- a/.github/workflows/build_images.yml +++ b/.github/workflows/build_images.yml @@ -40,18 +40,31 @@ jobs: - name: Check out current commit uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 + - name: Read devcontainer version + id: version + run: echo "version=$(cat .devcontainer/VERSION)" >> $GITHUB_OUTPUT + + - name: Log in to GHCR + uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3 + - name: Build and push devcontainer image - id: build - uses: getsentry/action-build-and-push-images@8fc75e483c09a68721f2c8951292ee17f8821766 # main + uses: docker/build-push-action@14487ce63c7a62a4a324b0bfb37086795e31c6c1 # v6 with: - image_name: "sentry-ruby-devcontainer-${{ matrix.flavor }}" - dockerfile_path: ".devcontainer/Dockerfile" - ghcr: true - publish_on_pr: true - build_args: | + context: . + file: .devcontainer/Dockerfile + push: true + tags: | + ghcr.io/getsentry/sentry-ruby-devcontainer-${{ matrix.flavor }}:${{ steps.version.outputs.version }} + ghcr.io/getsentry/sentry-ruby-devcontainer-${{ matrix.flavor }}:latest + build-args: | BASE_IMAGE=${{ matrix.base_image }} RUBY_VERSION=${{ matrix.ruby_version }} - - - name: Use outputs - run: | - echo "GHCR URL: ${{ steps.build.outputs.ghcr_image_url }}" + cache-from: type=gha,scope=${{ matrix.flavor }} + cache-to: type=gha,mode=max,scope=${{ matrix.flavor }} diff --git a/.github/workflows/e2e_tests.yml b/.github/workflows/e2e_tests.yml index 031e7f24b..4161a1502 100644 --- a/.github/workflows/e2e_tests.yml +++ b/.github/workflows/e2e_tests.yml @@ -20,8 +20,6 @@ jobs: name: e2e tests runs-on: ubuntu-latest timeout-minutes: 5 - env: - IMAGE_TAG: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }} strategy: fail-fast: false @@ -36,13 +34,17 @@ jobs: - name: Checkout code uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 + - name: Read devcontainer version + id: devcontainer-version + run: echo "version=$(cat .devcontainer/VERSION)" >> $GITHUB_OUTPUT + - name: Set up `.env` file run: | cd .devcontainer cp .env.example .env echo "RUBY_VERSION=${{ matrix.ruby_version }}" >> .env echo "DOCKER_IMAGE=ghcr.io/getsentry/sentry-ruby-devcontainer-${{ matrix.flavor }}" >> .env - echo "DOCKER_TAG=${{ env.IMAGE_TAG }}" >> .env + echo "DOCKER_TAG=${{ steps.devcontainer-version.outputs.version }}" >> .env - name: Log in to GHCR uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3 @@ -52,7 +54,7 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Pull test container image - run: docker pull ghcr.io/getsentry/sentry-ruby-devcontainer-${{ matrix.flavor }}:${{ env.IMAGE_TAG }} + run: docker pull ghcr.io/getsentry/sentry-ruby-devcontainer-${{ matrix.flavor }}:${{ steps.devcontainer-version.outputs.version }} - name: Restore node_modules cache uses: actions/cache@6f8efc29b200d32929f49075959781ed54ec270c # v3 From 5406008b4547ad607ad83e12c2b7e6dc444d4b42 Mon Sep 17 00:00:00 2001 From: Peter Solnica Date: Mon, 11 May 2026 13:04:23 +0200 Subject: [PATCH 13/22] fix(devcontainer): enable manual workflow dispatch and clean up comments --- .github/workflows/build_images.yml | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/.github/workflows/build_images.yml b/.github/workflows/build_images.yml index b1784433a..247ce1f5d 100644 --- a/.github/workflows/build_images.yml +++ b/.github/workflows/build_images.yml @@ -1,6 +1,7 @@ name: "Build & push devcontainer" on: + workflow_dispatch: push: branches: - master @@ -8,13 +9,6 @@ on: - .devcontainer/** - .github/workflows/build_images.yml - # Uncomment if you want to test things out in a PR - - # pull_request: - # paths: - # - .devcontainer/** - # - .github/workflows/build_images.yml - permissions: contents: read packages: write # Required for GHCR From b6e5dbda8a9049480ab7427650afbb6fb395e1e8 Mon Sep 17 00:00:00 2001 From: Peter Solnica Date: Mon, 11 May 2026 13:08:27 +0200 Subject: [PATCH 14/22] fix(devcontainer): update image tagging to use version from .devcontainer/VERSION --- .devcontainer/VERSION | 1 + .github/workflows/build_images.yml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 .devcontainer/VERSION diff --git a/.devcontainer/VERSION b/.devcontainer/VERSION new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/.devcontainer/VERSION @@ -0,0 +1 @@ +1 diff --git a/.github/workflows/build_images.yml b/.github/workflows/build_images.yml index 247ce1f5d..5d2db9e64 100644 --- a/.github/workflows/build_images.yml +++ b/.github/workflows/build_images.yml @@ -56,7 +56,7 @@ jobs: push: true tags: | ghcr.io/getsentry/sentry-ruby-devcontainer-${{ matrix.flavor }}:${{ steps.version.outputs.version }} - ghcr.io/getsentry/sentry-ruby-devcontainer-${{ matrix.flavor }}:latest + ${{ github.ref == 'refs/heads/master' && format('ghcr.io/getsentry/sentry-ruby-devcontainer-{0}:latest', matrix.flavor) || '' }} build-args: | BASE_IMAGE=${{ matrix.base_image }} RUBY_VERSION=${{ matrix.ruby_version }} From d4b395806215d424e9c03d0e462d590d3c902340 Mon Sep 17 00:00:00 2001 From: Peter Solnica Date: Mon, 11 May 2026 13:11:54 +0200 Subject: [PATCH 15/22] fix(devcontainer): add comments for triggering workflow in topic branches --- .github/workflows/build_images.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/build_images.yml b/.github/workflows/build_images.yml index 5d2db9e64..46496275f 100644 --- a/.github/workflows/build_images.yml +++ b/.github/workflows/build_images.yml @@ -1,7 +1,14 @@ name: "Build & push devcontainer" on: + # This works only on the default branch. To trigger it in a topic branch: + # + # gh workflow run build_images.yml --repo getsentry/sentry-ruby --ref your-branch + # + # IMPORTANT: update `.devcontainer/VERSION` for a topic branch build + # workflow_dispatch: + push: branches: - master From 7b423cd2a5dfc68fdd5a9e6bcd2fde6a1850c926 Mon Sep 17 00:00:00 2001 From: Peter Solnica Date: Mon, 11 May 2026 13:20:24 +0200 Subject: [PATCH 16/22] fix(devcontainer): update BASE_IMAGE to use Ubuntu 24.04 --- .devcontainer/docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.devcontainer/docker-compose.yml b/.devcontainer/docker-compose.yml index 140515b11..085586f06 100644 --- a/.devcontainer/docker-compose.yml +++ b/.devcontainer/docker-compose.yml @@ -5,7 +5,7 @@ services: context: .. dockerfile: .devcontainer/Dockerfile args: - BASE_IMAGE: ${BASE_IMAGE:-ubuntu:latest} + BASE_IMAGE: ${BASE_IMAGE:-ubuntu:24.04} RUBY_VERSION: ${RUBY_VERSION:-} volumes: - ..:/workspace/sentry:cached From 7b6ef3a04a7d8b14cc1ba9f98d9ee652cc29d0ba Mon Sep 17 00:00:00 2001 From: Peter Solnica Date: Mon, 11 May 2026 13:30:26 +0200 Subject: [PATCH 17/22] fix(devcontainer): clean up .env.example by removing legacy comments and base image --- .devcontainer/.env.example | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/.devcontainer/.env.example b/.devcontainer/.env.example index e16c507cf..cb5d03635 100644 --- a/.devcontainer/.env.example +++ b/.devcontainer/.env.example @@ -1,17 +1,6 @@ -# Devcontainer build configuration -# -# Modern flavor (default): newest Ubuntu, latest stable Ruby pre-installed. -# Within the container, mise can switch to any other Ruby >= 3.1 instantly. -BASE_IMAGE="ubuntu:24.04" +# Devcontainer configuration RUBY_VERSION="3.4.9" -# Legacy flavor: older Ubuntu where Ruby 2.7 / 3.0 still compile. -# Uncomment these (and comment the modern ones above) when you need to -# work on the EOL Ruby versions, then rebuild the devcontainer. -# -# BASE_IMAGE="ubuntu:22.04" -# RUBY_VERSION="2.7.8" - # E2E testing SENTRY_DSN="http://user:pass@sentry.localhost/project/42" # SENTRY_DSN_JS="http://user:pass@sentry-js.localhost/project/43" From c5e368a37226e70a9ac0e924494396509490dfa1 Mon Sep 17 00:00:00 2001 From: Peter Solnica Date: Mon, 11 May 2026 13:30:41 +0200 Subject: [PATCH 18/22] fix(devcontainer): add e2e profile to sentry-test service and update workflow --- .devcontainer/docker-compose.yml | 1 + .github/workflows/e2e_tests.yml | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.devcontainer/docker-compose.yml b/.devcontainer/docker-compose.yml index 085586f06..0289c8427 100644 --- a/.devcontainer/docker-compose.yml +++ b/.devcontainer/docker-compose.yml @@ -20,6 +20,7 @@ services: sentry-test: <<: *sentry-build + profiles: ["e2e"] entrypoint: [".devcontainer/run"] command: ["mise", "run", "e2e:serve"] environment: diff --git a/.github/workflows/e2e_tests.yml b/.github/workflows/e2e_tests.yml index 4161a1502..530fa772a 100644 --- a/.github/workflows/e2e_tests.yml +++ b/.github/workflows/e2e_tests.yml @@ -69,6 +69,7 @@ jobs: docker compose \ --file .devcontainer/docker-compose.yml \ --env-file .devcontainer/.env \ + --profile e2e \ run --rm sentry-test \ .devcontainer/setup --only .,spec/apps/rails-mini @@ -77,6 +78,7 @@ jobs: docker compose \ --file .devcontainer/docker-compose.yml \ --env-file .devcontainer/.env \ + --profile e2e \ up -d --no-build sentry-test - name: "Wait for rails-mini app to be ready" @@ -100,12 +102,13 @@ jobs: docker compose \ --file .devcontainer/docker-compose.yml \ --env-file .devcontainer/.env \ + --profile e2e \ exec sentry-test \ bundle exec rake - name: Stop e2e services if: always() - run: docker compose --file .devcontainer/docker-compose.yml down + run: docker compose --file .devcontainer/docker-compose.yml --profile e2e down - name: Upload test artifacts if: failure() From f1827bcd14d8b50d41952fede0a090ad61ecc54d Mon Sep 17 00:00:00 2001 From: Peter Solnica Date: Mon, 11 May 2026 14:15:12 +0200 Subject: [PATCH 19/22] fix(devcontainer): pre-install Java 21 in Dockerfile for JRuby support --- .devcontainer/Dockerfile | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index c37adf424..9adf56caf 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -60,8 +60,15 @@ RUN curl https://mise.run | sh \ # container starts immediately without downloading it at runtime. When it is # empty (local dev builds) Ruby is installed lazily by the `run` entrypoint. ARG RUBY_VERSION="" + +# Java is always installed (required for JRuby). It is listed in .mise.toml so +# it is available for all users regardless of which Ruby flavour they use. +RUN echo "๐Ÿ“ฆ Pre-installing java@temurin-21..." && \ + /home/sentry/.local/bin/mise install "java@temurin-21" && \ + /home/sentry/.local/bin/mise use --global "java@temurin-21" + RUN if [ -n "${RUBY_VERSION}" ]; then \ - echo "๐Ÿ“ฆ Pre-installing ruby@${RUBY_VERSION} (precompiled)..." && \ + echo "๐Ÿ“ฆ Pre-installing ruby@${RUBY_VERSION}..." && \ MISE_RUBY_COMPILE=0 /home/sentry/.local/bin/mise install "ruby@${RUBY_VERSION}" && \ /home/sentry/.local/bin/mise use --global "ruby@${RUBY_VERSION}"; \ fi From 8d20a8cfab13d4d2f936106d5bd2ee050332627f Mon Sep 17 00:00:00 2001 From: Peter Solnica Date: Mon, 11 May 2026 14:15:45 +0200 Subject: [PATCH 20/22] chore(mise): set ruby version to 'ruby@latest' and add java version to tools --- .devcontainer/Dockerfile | 2 +- .devcontainer/run | 3 --- .mise.toml | 4 ++++ 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 9adf56caf..c33b8875e 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -69,7 +69,7 @@ RUN echo "๐Ÿ“ฆ Pre-installing java@temurin-21..." && \ RUN if [ -n "${RUBY_VERSION}" ]; then \ echo "๐Ÿ“ฆ Pre-installing ruby@${RUBY_VERSION}..." && \ - MISE_RUBY_COMPILE=0 /home/sentry/.local/bin/mise install "ruby@${RUBY_VERSION}" && \ + /home/sentry/.local/bin/mise install "ruby@${RUBY_VERSION}" && \ /home/sentry/.local/bin/mise use --global "ruby@${RUBY_VERSION}"; \ fi diff --git a/.devcontainer/run b/.devcontainer/run index fa262e490..dca1c6d62 100755 --- a/.devcontainer/run +++ b/.devcontainer/run @@ -38,9 +38,6 @@ eval "$("$MISE_BIN" activate bash)" # Default to the latest Ruby unless the caller pins a specific version. RUBY_VERSION="${RUBY_VERSION:-latest}" -# Always pull a precompiled binary from jdx/ruby โ€” never build from source. -export MISE_RUBY_COMPILE=0 - # Skip installation when the version is already present in the image (e.g. CI # images built with the RUBY_VERSION build arg in the Dockerfile). if "$MISE_BIN" list ruby 2>/dev/null | grep -qF "${RUBY_VERSION}"; then diff --git a/.mise.toml b/.mise.toml index 0658c4b3d..dd108298f 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,6 +1,10 @@ +[settings] +ruby.compile = false + [tools] ruby = "latest" node = "lts" +java = "temurin-21" [tasks."e2e:rails"] description = "Start the rails-mini e2e app" From 26662b2f3589eb144ea6f7e76fc8a2c7c45b42b0 Mon Sep 17 00:00:00 2001 From: Peter Solnica Date: Mon, 11 May 2026 14:28:24 +0200 Subject: [PATCH 21/22] fix(devcontainer): pre-install precompiled Ruby version in Dockerfile --- .devcontainer/Dockerfile | 4 ++-- .devcontainer/docker-compose.yml | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index c33b8875e..91a917802 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -68,8 +68,8 @@ RUN echo "๐Ÿ“ฆ Pre-installing java@temurin-21..." && \ /home/sentry/.local/bin/mise use --global "java@temurin-21" RUN if [ -n "${RUBY_VERSION}" ]; then \ - echo "๐Ÿ“ฆ Pre-installing ruby@${RUBY_VERSION}..." && \ - /home/sentry/.local/bin/mise install "ruby@${RUBY_VERSION}" && \ + echo "๐Ÿ“ฆ Pre-installing ruby@${RUBY_VERSION} (precompiled)..." && \ + MISE_RUBY_COMPILE=0 /home/sentry/.local/bin/mise install "ruby@${RUBY_VERSION}" && \ /home/sentry/.local/bin/mise use --global "ruby@${RUBY_VERSION}"; \ fi diff --git a/.devcontainer/docker-compose.yml b/.devcontainer/docker-compose.yml index 0289c8427..257be0385 100644 --- a/.devcontainer/docker-compose.yml +++ b/.devcontainer/docker-compose.yml @@ -6,7 +6,6 @@ services: dockerfile: .devcontainer/Dockerfile args: BASE_IMAGE: ${BASE_IMAGE:-ubuntu:24.04} - RUBY_VERSION: ${RUBY_VERSION:-} volumes: - ..:/workspace/sentry:cached working_dir: /workspace/sentry From 9c277859f44e4fd70b6521f03373daed2fbdb2ba Mon Sep 17 00:00:00 2001 From: Peter Solnica Date: Mon, 11 May 2026 15:54:00 +0200 Subject: [PATCH 22/22] chore(devcontainer): remove dead method from setup --- .devcontainer/setup | 9 --------- 1 file changed, 9 deletions(-) diff --git a/.devcontainer/setup b/.devcontainer/setup index 1c93e65ff..408f7d8de 100755 --- a/.devcontainer/setup +++ b/.devcontainer/setup @@ -135,15 +135,6 @@ class SetupScript end end - def update_rubygems_and_bundler - puts "๐Ÿ“ฆ Updating RubyGems and Bundler..." - - unless system("gem update --system --silent") - puts "โŒ RubyGems update failed" - exit 1 - end - end - def install_foreman_gem unless system('gem install foreman') puts "โŒ Foreman gem installation failed"