Skip to content

test(ci): lock image gate ruleset authority - #435

Merged
thebtf merged 2 commits into
mainfrom
test/v646-image-gate-final
Jul 17, 2026
Merged

test(ci): lock image gate ruleset authority#435
thebtf merged 2 commits into
mainfrom
test/v646-image-gate-final

Conversation

@thebtf

@thebtf thebtf commented Jul 17, 2026

Copy link
Copy Markdown
Owner

Summary

Tighten the critical image-publishing contract after the protected-path repair landed.

  • require the exact post-transition credential shape: two trusted ruleset-audit bindings/consumers, one candidate clearing, and no candidate package credentials
  • exercise live GitHub ruleset array responses through both ValidateRelease and the production ValidateWorkflowRun -EventOnlyValidation path
  • keep the workflow-run live test hermetic by using a local Git remote whose canonical path still satisfies repository-origin validation
  • reject omitted tag/main bypass_actors fields and partial credential states

Verification

go test -tags critical ./tests/critical/runtime -run TestDockerReleaseRefFreshnessGuard -count=1

Summary by CodeRabbit

  • Тесты
    • Усилена проверка безопасности и корректности токенов в релизном процессе.
    • Добавлены интеграционные сценарии для проверки взаимодействия с API правил репозитория.
    • Расширено тестирование валидации релизов и запусков workflow с использованием API.
    • Уточнены проверки изоляции секретов и очистки чувствительных данных в шагах сборки.
    • Повышена стабильность сценариев работы с удалёнными репозиториями и свежестью ссылок.

@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 44 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 83204bd8-23f0-4a28-8e39-5904c7bf5c3c

📥 Commits

Reviewing files that changed from the base of the PR and between a52e9e9 and 19a9585.

📒 Files selected for processing (1)
  • tests/critical/runtime/image_runtime_contract_test.go

Walkthrough

Тесты усиливают контрактные проверки RULESET_AUDIT_TOKEN, добавляют интеграционный сценарий с эмулированным GitHub Rulesets API и обновляют fixture для freshness guard.

Changes

Ruleset-аудит

Layer / File(s) Summary
Контракты токенов workflow
tests/critical/runtime/image_runtime_contract_test.go
Проверяются точные количества биндингов, consumer-ов и очисток RULESET_AUDIT_TOKEN, а также ограничения секретов в candidate build.
Интеграция с Rulesets API
tests/critical/runtime/image_runtime_contract_test.go
Добавлен httptest-сервер, проверка Bearer-токена и запуск ValidateRelease и ValidateWorkflowRun с параметрами GitHub API. Fixture использует вложенный remote path github.com/thebtf/engram.git.

Estimated code review effort: 4 (Complex) | ~45 minutes

Possibly related PRs

  • thebtf/engram#432: Добавляет RULESET_AUDIT_TOKEN в Docker publish gate, который проверяется в этом PR.

Poem

Прыг-скок, токен очищен,
Ruleset API ловко слышен.
Bearer скачет по сети,
Все проверки расцвели.
Рады кролики в CI!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed Заголовок соответствует основному изменению: ужесточению тестов image gate и контрактов ruleset/audit token.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch test/v646-image-gate-final

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@tests/critical/runtime/image_runtime_contract_test.go`:
- Around line 530-537: Замените глобальные проверки strings.Count в
tests/critical/runtime/image_runtime_contract_test.go:530-537 проверками
содержимого каждого отдельного шага ValidateWorkflowRun: в каждом шаге
подтвердите ровно одну привязку RULESET_AUDIT_TOKEN и одного consumer-а
-GitHubToken, а для candidate execution сохраните проверку явной очистки
credential. В tests/critical/runtime/image_runtime_contract_test.go:712-719
аналогично проверяйте MARKETPLACE_PAT и READ_ONLY_GITHUB_TOKEN внутри ожидаемых
job/step-секций, а не по всему publisher.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: f1fa8478-b415-47cd-8f16-a662fa82abc8

📥 Commits

Reviewing files that changed from the base of the PR and between aacdfcf and a52e9e9.

📒 Files selected for processing (1)
  • tests/critical/runtime/image_runtime_contract_test.go

Comment thread tests/critical/runtime/image_runtime_contract_test.go Outdated
@thebtf
thebtf merged commit 066ec17 into main Jul 17, 2026
11 checks passed
@thebtf
thebtf deleted the test/v646-image-gate-final branch July 17, 2026 06:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant