7 Commits

Author SHA1 Message Date
ajay@krishnan.ca
9006505cd2 Merge pull request 'Use loopback for host builder probes' (#5) from fix/gitea-builder-loopback-20260727 into main 2026-07-27 17:42:06 -07:00
755b9d2f0a Use loopback for host builder probes 2026-07-27 17:38:11 -07:00
ajay@krishnan.ca
8a90d1f46f Merge pull request 'Route Gitea image contract to trusted runner' (#4) from fix/gitea-runner-topology-20260727 into main 2026-07-27 16:59:29 -07:00
c846fb3d66 Install standalone test dependency in CI 2026-07-27 16:16:51 -07:00
69863a0b7f Route Gitea image contract to trusted runner 2026-07-27 15:04:59 -07:00
Ajay Krishnan
82378391c6 Merge pull request #8 from ajaynomics/fix/github-only-upstream-watcher-20260720
All checks were successful
Candidate compatibility / prepare (push) Successful in 33s
Candidate compatibility / image ${{ matrix.id }} (push) Has been skipped
Candidate compatibility / repository (push) Successful in 47s
Candidate compatibility / fixture-contract (push) Successful in 1m56s
Candidate compatibility / lockstep clients Ruby 3.4 (push) Successful in 2m8s
Candidate compatibility / lockstep clients Ruby 3.3 (push) Successful in 2m23s
Candidate compatibility / lockstep clients Ruby 3.2 (push) Successful in 2m53s
Candidate compatibility / lockstep clients Ruby 4.0 (push) Successful in 3m4s
Candidate compatibility / Gitea full exact image matrix (push) Successful in 3m51s
Watch upstream OpenCode / open-compatibility-pr (push) Has been skipped
Run upstream watcher only on GitHub
2026-07-20 11:44:38 -07:00
b25ac238f5 Run upstream watcher only on GitHub 2026-07-20 11:41:52 -07:00
4 changed files with 35 additions and 7 deletions

View File

@@ -18,6 +18,8 @@ jobs:
- uses: ruby/setup-ruby@003a5c4d8d6321bd302e38f6f0ec593f77f06600 # v1 - uses: ruby/setup-ruby@003a5c4d8d6321bd302e38f6f0ec593f77f06600 # v1
with: with:
ruby-version: "3.4" ruby-version: "3.4"
- name: Install standalone test dependency
run: gem install minitest --version 6.0.6 --no-document
- run: | - run: |
ruby test/repository_test.rb ruby test/repository_test.rb
ruby test/runtime_tuple_promoter_test.rb ruby test/runtime_tuple_promoter_test.rb
@@ -267,9 +269,12 @@ jobs:
retention-days: 30 retention-days: 30
exact-image-contract-gitea: exact-image-contract-gitea:
if: github.server_url != 'https://github.com' if: >-
github.server_url != 'https://github.com' &&
(github.event_name == 'workflow_dispatch' ||
(github.event_name == 'push' && github.ref == 'refs/heads/main'))
needs: prepare needs: prepare
runs-on: ubuntu-latest runs-on: heyoka-image-build
name: Gitea full exact image matrix name: Gitea full exact image matrix
steps: steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
@@ -299,9 +304,7 @@ jobs:
test "$actual_client_sha" = "$EXPECTED_CLIENT_SHA" test "$actual_client_sha" = "$EXPECTED_CLIENT_SHA"
echo "value=$actual_client_sha" >> "$GITHUB_OUTPUT" echo "value=$actual_client_sha" >> "$GITHUB_OUTPUT"
- name: Resolve the private Docker host transport - name: Resolve the private Docker host transport
run: | run: echo "OPENCODE_PROBE_HOST=127.0.0.1" >> "$GITHUB_ENV"
probe_host="$(ruby scripts/private_default_gateway.rb)"
echo "OPENCODE_PROBE_HOST=$probe_host" >> "$GITHUB_ENV"
- name: Exercise the complete manifest matrix without artifact claims - name: Exercise the complete manifest matrix without artifact claims
env: env:
BUNDLE_GEMFILE: ${{ github.workspace }}/ruby-client/Gemfile BUNDLE_GEMFILE: ${{ github.workspace }}/ruby-client/Gemfile

View File

@@ -15,6 +15,7 @@ concurrency:
jobs: jobs:
open-compatibility-pr: open-compatibility-pr:
if: github.server_url == 'https://github.com'
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0

View File

@@ -335,6 +335,13 @@ class RepositoryTest < Minitest::Test
end end
end end
def test_repository_job_installs_its_pinned_standalone_test_dependency
workflow = File.read(File.join(ROOT, ".github/workflows/candidate.yml"))
repository_job = workflow.split(/^ repository:\n/, 2).fetch(1).split(/^ prepare:\n/, 2).fetch(0)
assert_includes repository_job, "gem install minitest --version 6.0.6 --no-document"
end
def test_candidate_workflow_verifies_and_preserves_the_lockstep_client_tuple def test_candidate_workflow_verifies_and_preserves_the_lockstep_client_tuple
workflow = File.read(File.join(ROOT, ".github/workflows/candidate.yml")) workflow = File.read(File.join(ROOT, ".github/workflows/candidate.yml"))
@@ -374,8 +381,7 @@ class RepositoryTest < Minitest::Test
assert_includes workflow, "exact-image-contract-gitea:" assert_includes workflow, "exact-image-contract-gitea:"
assert_includes workflow, "if: github.server_url != 'https://github.com'" assert_includes workflow, "if: github.server_url != 'https://github.com'"
assert_includes workflow, "run: scripts/run_image_matrix_contract.sh" assert_includes workflow, "run: scripts/run_image_matrix_contract.sh"
assert_includes workflow, 'probe_host="$(ruby scripts/private_default_gateway.rb)"' assert_includes workflow, 'echo "OPENCODE_PROBE_HOST=127.0.0.1" >> "$GITHUB_ENV"'
assert_includes workflow, 'echo "OPENCODE_PROBE_HOST=$probe_host" >> "$GITHUB_ENV"'
assert_operator workflow.scan('BUNDLE_GEMFILE: ${{ github.workspace }}/ruby-client/Gemfile').length, :>=, 2 assert_operator workflow.scan('BUNDLE_GEMFILE: ${{ github.workspace }}/ruby-client/Gemfile').length, :>=, 2
assert_operator workflow.scan("generated JSON is transient and is not review evidence").length, :>=, 3 assert_operator workflow.scan("generated JSON is transient and is not review evidence").length, :>=, 3
@@ -383,6 +389,20 @@ class RepositoryTest < Minitest::Test
refute_includes gitea_job, "actions/upload-artifact@" refute_includes gitea_job, "actions/upload-artifact@"
end end
def test_gitea_exact_image_contract_uses_the_trusted_builder_only_for_main_pushes_or_manual_dispatches
workflow = File.read(File.join(ROOT, ".github/workflows/candidate.yml"))
ordinary_jobs = workflow.split(/^ exact-image-contract:\n/, 2).fetch(0)
github_job, gitea_job = workflow.split(/^ exact-image-contract:\n/, 2).fetch(1)
.split(/^ exact-image-contract-gitea:\n/, 2)
assert_equal 4, ordinary_jobs.scan("runs-on: ubuntu-latest").length
assert_includes github_job, "runs-on: ubuntu-latest"
assert_includes gitea_job, "runs-on: heyoka-image-build"
assert_includes gitea_job, "github.server_url != 'https://github.com'"
assert_includes gitea_job, "github.event_name == 'workflow_dispatch'"
assert_includes gitea_job, "github.event_name == 'push' && github.ref == 'refs/heads/main'"
end
def test_gitea_matrix_runner_uses_every_generated_entry_without_hardcoded_coordinates def test_gitea_matrix_runner_uses_every_generated_entry_without_hardcoded_coordinates
runner = File.read(File.join(ROOT, "scripts/run_image_matrix_contract.sh")) runner = File.read(File.join(ROOT, "scripts/run_image_matrix_contract.sh"))

View File

@@ -170,6 +170,10 @@ class WatcherTest < Minitest::Test
def test_workflow_can_only_update_manifests_and_open_a_pr def test_workflow_can_only_update_manifests_and_open_a_pr
workflow = File.read(File.join(ROOT, ".github/workflows/watch-upstream.yml")) workflow = File.read(File.join(ROOT, ".github/workflows/watch-upstream.yml"))
assert_match(
/\n open-compatibility-pr:\n if: github\.server_url == 'https:\/\/github\.com'\n runs-on:/,
workflow
)
assert_includes workflow, "contents: write" assert_includes workflow, "contents: write"
assert_includes workflow, "pull-requests: write" assert_includes workflow, "pull-requests: write"
assert_includes workflow, "git add manifests/image-matrix.json manifests/upstream.json" assert_includes workflow, "git add manifests/image-matrix.json manifests/upstream.json"