Skip to content

docs: record release trigger scoping granularity as an ADR - #2043

Merged
hatayama merged 2 commits into
v3-betafrom
docs/shared-release-inputs-granularity
Jul 28, 2026
Merged

hatayama merged 2 commits into
v3-betafrom
docs/shared-release-inputs-granularity

Conversation

@hatayama

@hatayama hatayama commented Jul 28, 2026 •

Copy link
Copy Markdown
Owner

Why

Reviewing #2036 raised the question of why a runner-only change (cli/common/errors/busy_editor_state.go, reachable only through the Unity RPC path the dispatcher never uses) released the dispatcher too. The trigger rule was documented in docs/shared-release-inputs.md, but the decision behind its granularity was not, so the settled question had no reversal condition to consult and was relitigated from scratch — with several wrong guesses about the mechanism along the way.

What

  • New docs/adr/0003-release-trigger-scoping-granularity.md: records the decision that trigger rules resolve component reachability at package granularity (whitelists test-enforced against go list -deps ./... by TestReleaseTriggerGuardCommonPackageWhitelistsMatchGoDependencies) and deliberately stop there. Rationale: the two failure directions are asymmetric (a missed release causes invisible version skew, an extra one costs a beta increment plus one cli-release approval), and package-level scoping has a one-line ground truth to enforce against while call-graph scoping has none. Both finer alternatives — symbol-level call-graph reachability and reproducible-build comparison — are recorded as feasible-but-rejected, each with an explicit reversal condition.
  • docs/shared-release-inputs.md: adds a section stating the observable behaviour (a shared-package change reachable from only one component still releases both, by design, with feat: configurable compile wait timeout and working timeout recovery #2036 as the worked example) and pointing to the ADR before anyone proposes finer scoping.

The ADR also records the facts that were guessed wrong during the discussion, to close off the same wrong turns next time: sharedInputsHash is a change marker no consumer compares across commits, the gap is a cost trade rather than a limit of static analysis, and whitelist alignment is machine-enforced rather than manual.

Verification

  • Docs-only change; matches no releaseTriggerRules input, so no stamp update is required.
  • go test ./internal/automation/ -run ReleaseTrigger -count=1 in cli/release-automation passes (no behaviour touched).

Related: #2042 (typed decoding of Unity JSON-RPC error data, filed from the same review thread).

Review in cubic

@coderabbitai

coderabbitai Bot commented Jul 28, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@hatayama, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 21 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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 638f0832-9951-41a5-a4c3-94fe891064c7

📥 Commits

Reviewing files that changed from the base of the PR and between 242703e and 553f548.

📒 Files selected for processing (2)
  • docs/adr/0003-release-trigger-scoping-granularity.md
  • docs/shared-release-inputs.md
📝 Walkthrough

Walkthrough

Documents package-level release-trigger scoping, whitelist enforcement, sharedInputsHash semantics, expected no-op releases, rejected alternatives, and reversal conditions.

Changes

Release trigger scoping

Layer / File(s) Summary
Package-level scoping decision and guidance
docs/adr/0003-release-trigger-scoping-granularity.md, docs/shared-release-inputs.md
The ADR defines package-level whitelist enforcement, documents cross-component and no-op release behavior, records the rationale against symbol-level and reproducible-build analysis, and states reversal conditions. Shared-input documentation explains the same behavior with a worked example and links to the ADR.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: documenting release trigger scoping granularity in an ADR.
Description check ✅ Passed The description is directly related to the docs-only ADR and shared-release-inputs updates described in the changeset.
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 docs/shared-release-inputs-granularity

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@hatayama
hatayama force-pushed the docs/shared-release-inputs-granularity branch from a3a1b6d to 242703e Compare July 28, 2026 10:10
coderabbitai[bot]
coderabbitai Bot previously requested changes Jul 28, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 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 `@docs/adr/0003-release-trigger-scoping-granularity.md`:
- Around line 40-45: The ADR’s call-graph discussion should avoid claiming that
govulncheck can classify every changed file exactly. Rephrase the reachability
statement to acknowledge overapproximation and the assumptions around dynamic
behavior, CI entry points, full-package analysis, and platform-specific paths,
or document the entry-point validation needed to support the claim.

In `@docs/shared-release-inputs.md`:
- Around line 30-36: Update the earlier blanket rule for common Go sources to
state that packages in the shared whitelist trigger both components, while
packages in dispatcherOnlyCommonPackageRoots—including
cli/common/version/—trigger only the dispatcher. Ensure the documentation no
longer claims every common package requires both triggers and remains consistent
with the trigger behavior described around sharedCommonPackageRoots and
dispatcherOnlyCommonPackageRoots.
🪄 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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: eeb8b89f-abad-421d-8c7c-ea99a7cac3ee

📥 Commits

Reviewing files that changed from the base of the PR and between fc867c3 and 242703e.

📒 Files selected for processing (2)
  • docs/adr/0003-release-trigger-scoping-granularity.md
  • docs/shared-release-inputs.md

Comment thread docs/adr/0003-release-trigger-scoping-granularity.md
Comment thread docs/shared-release-inputs.md Outdated
Comment on lines +30 to +36
Trigger rules resolve which components a shared input reaches by package, not by
symbol. `sharedCommonPackageRoots` and `dispatcherOnlyCommonPackageRoots` in
`release_trigger_guard.go` are whitelists whose alignment with
`go list -deps ./...` is test-enforced, so a `cli/common` package only one
component links triggers only that component. Within a package on the shared list, every
non-test Go change triggers both components regardless of which one can actually
execute the changed code.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Align the blanket common-module rule with dispatcher-only packages.

The earlier bullets at Lines 15-16 say every common Go source requires both component triggers, but dispatcherOnlyCommonPackageRoots includes cli/common/version/, which should trigger only the dispatcher. Update the earlier rule to describe the shared whitelist and dispatcher-only exceptions; otherwise this page gives contradictory release instructions.

Suggested wording update
-- Common module sources (non-test `cli/common/**/*.go`, `cli/common/go.mod`, `cli/common/go.sum`) must be
-  accompanied by changes under both `cli/project-runner/` and `cli/dispatcher/`.
+- Common module sources in the shared whitelist must be accompanied by changes under both
+  `cli/project-runner/` and `cli/dispatcher/`; dispatcher-only packages such as
+  `cli/common/version/` require only a `cli/dispatcher/` change.
🤖 Prompt for 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.

In `@docs/shared-release-inputs.md` around lines 30 - 36, Update the earlier
blanket rule for common Go sources to state that packages in the shared
whitelist trigger both components, while packages in
dispatcherOnlyCommonPackageRoots—including cli/common/version/—trigger only the
dispatcher. Ensure the documentation no longer claims every common package
requires both triggers and remains consistent with the trigger behavior
described around sharedCommonPackageRoots and dispatcherOnlyCommonPackageRoots.

Reviewing #2036 raised the question of why a runner-only change released
the dispatcher too, and answering it took several wrong guesses about the
mechanism before the facts were checked. The rule was documented but the
decision behind its granularity was not, so the settled question had no
reversal condition to consult and was relitigated from scratch.

Add ADR 0003 with the decision, why the coarse rule stays, and the two
finer alternatives (call-graph reachability, reproducible-build
comparison) with their reversal conditions. Record the facts that were
guessed wrong during the discussion: sharedInputsHash is a change marker
no consumer compares across commits, the gap is a cost trade rather than
a limit of static analysis, whitelist alignment with go list -deps is
already test-enforced rather than manual, and no-op releases already
carry a cli-release approval click today. Keep shared-release-inputs.md
operational with the observable behaviour and a pointer to the ADR.
@hatayama
hatayama force-pushed the docs/shared-release-inputs-granularity branch from 242703e to 9deedf9 Compare July 28, 2026 10:16
RTA/CHA/VTA compute an overapproximation of dynamic calling behaviour,
so per-file trigger classification derived from them is conservative
rather than exact: spurious edges can only add a trigger, never drop
one. Also note platform-specific files need per-platform analysis runs.
Raised by CodeRabbit review on #2043.
@hatayama
hatayama merged commit c0e392c into v3-beta Jul 28, 2026
8 checks passed
@hatayama
hatayama deleted the docs/shared-release-inputs-granularity branch July 28, 2026 11:15
RyanXie123 pushed a commit to RyanXie123/unity-cli-loop that referenced this pull request Sep 22, 2026
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