Repository navigation
Hand a Caller's hook-input to the validate and resolve-upstream Hooks - #4465
Conversation
validate-task.yml and check-upstream-version-task.yml each take an optional hook-input string and pass a non-empty value to the caller's hook from a guarded step of its own, so a hook declaring no such input is never handed one. A repository calling the upstream tracker twice can now tell its one hook which caller runs it, and a caller can hand its change-gate result to an expensive validate hook. The hub's own validate and resolve-upstream hooks declare the input, so actionlint accepts the new steps. The adoption doc's second tracker now passes hook-input and a state file of its own. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…gether The hook-input test now reads required as well as type and default, with a mutation flipping it to true. The doc moves the hook-input sentences past the package-hook ones, so "A package hook also" follows the release-asset text it continues. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
|
|
A recorded local strict-review pass covers head |
There was a problem hiding this comment.
🟡 Changes recommended
The change still contains three active documentation and workflow-contract inconsistencies about how non-empty hook inputs are handled, so clarification is needed before approval.
3 open issues
What changed in this PR
This pull request extends reusable validation and upstream-version workflows so callers can optionally pass a string to their repository-owned hooks while preserving existing behavior when no input is provided.
Changes:
- Adds guarded
hook-inputhandling to both reusable tasks. - Declares the optional input in the hub's validation and upstream-resolution hooks.
- Updates upstream output selection, documentation, and structural workflow tests.
| File | Description |
|---|---|
| tests/test_workflow_steps.py | Adds structural and mutation tests for hook routing, input forwarding, declarations, and upstream output selection. |
| docs/reusable-workflows.md | Documents the hook-input contract and downstream adoption patterns, including the second upstream tracker. |
| .github/workflows/validate-task.yml | Adds optional hook-input handling for repository validation hooks. |
| .github/workflows/check-upstream-version-task.yml | Adds optional hook-input handling for upstream version resolution and supports output from either hook route. |
| .github/actions/validate/action.yml | Declares the optional validation hook input for actionlint compatibility and caller guidance. |
| .github/actions/resolve-upstream/action.yml | Declares the optional upstream-resolution hook input for actionlint compatibility and caller guidance. |
Review effort: Lite
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #4465 +/- ##
===========================================
- Coverage 81.60% 79.74% -1.87%
===========================================
Files 26 48 +22
Lines 9070 16517 +7447
===========================================
+ Hits 7402 13172 +5770
- Misses 1668 3345 +1677
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
@coderabbitai review |
|
/review |
Action not completed
|
A caller setting hook-input still hands it to a hook that declares no such input, so the comments, the doc, and the test docstring now promise unchanged behavior only to a caller passing none, and say a caller setting it needs a hook that declares it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
A recorded local strict-review pass covers head |

Summary
Per the maintainer's 2026-11-01 answer on #3325 (option 1), a hub task's hook can now learn which caller runs it.
check-upstream-version-task.ymlandvalidate-task.ymleach take an optionalhook-inputstring, default empty.hook-inputis empty and passes nothing, as today. The second runs only when it is set and passeswith: hook-input. So a caller passing nothing runs its hook exactly as before, a hook declaring no such input included. A caller that sets the value needs a hook declaringhook-input.versionsfrom whichever of the two steps ran.validate-defaultnever receives the value.resolve-upstreamandvalidatehooks declare the input, ignored, so actionlint accepts the newwith:blocks against them. They also show the declaration a caller's hook copies.docs/reusable-workflows.mdstates the input in "The Hook Contract" and in "Adopting the Gates". "Adopting the Type-Specific Tasks" now has ESPHome-NonRoot's second tracker passhook-input: dependencyand its ownstate-file, so its one hook can branch and the two trackers no longer share one state file.tests/test_workflow_steps.pypins both routes, with a mutation test for each guard, the passed value, and the input's declaration.No caller stub changes, since every fleet caller is outside this repository. WORKFLOW.md describes no hook inputs, so it stays true.
Closes on promotion: #3325
Verification
scripts/docker_lint.py: clean. Before the hub hooks declared the input, actionlint failed on both new steps, which is why they declare it.HookInputCaseintest_workflow_steps.py.required, and the doc sentences were misplaced. The third is listed below. The second pass was clean.Pre-existing findings, not filed
.agents/skills/branching-and-release-model/references/release-publish-mechanics.md"Wrapper repos that track an upstream release" (pre-existing, incomplete instruction): it gives a package-list snapshot tracker as itsauto-merge: falseexample without saying that a second tracker in a repository that already runs one needs its ownstate-fileand ahook-inputfor the shared hook. The text predates this change and stays true as written. This change put the full second-caller shape indocs/reusable-workflows.md"Adopting the Type-Specific Tasks".🤖 Generated with Claude Code