Feat: Add sole-org fallback for config resolution - #181
Open
ModeSevenIndustrialSolutions wants to merge 1 commit into
Open
Feat: Add sole-org fallback for config resolution#181ModeSevenIndustrialSolutions wants to merge 1 commit into
ModeSevenIndustrialSolutions wants to merge 1 commit into
Conversation
Copilot started reviewing on behalf of
ModeSevenIndustrialSolutions
August 1, 2026 06:55
View session
There was a problem hiding this comment.
Pull request overview
Adds a “sole-org fallback” to config resolution so short-form config references can still resolve correctly when the workflow runs from a fork (where the derived workflow org differs from the upstream org that owns the pinned .github config tree).
Changes:
- Extend
resolve()to exposefallback_dir/fallback_filenamefor auto-derived search modes (but not explicit-path mode). - Extend
fetch_file()to scan the fetched tree viagit ls-treefor exactly one<family-dir>/<org>/<filename>match when all candidates miss, and reportfallback_used. - Add tests covering fork scenario, ambiguity, filename/depth filtering, non-blob rejection, and explicit-path bypass; update README search-chain docs.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
src/resolve_config_source.py |
Implements the sole-org fallback scan and plumbs fallback coordinates + reporting through the resolver/main flow. |
tests/test_resolve_config_source.py |
Extends the fake git harness for ls-tree and adds fallback-focused unit tests. |
README.md |
Documents the new search/fallback step in the config resolution chain. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Port the shared resolver fix from harden-runner-block-action (their PR lfreleng-actions#45): short-form config references such as '@<sha>' derive both the host org and the org-specific search path from the running repository owner, and resolution can never succeed in a fork even though the fork's .github tree carries the upstream org's file at the pinned ref. When the default search chain misses and the candidates were auto-derived, scan the fetched tree for <family-dir>/<org>/<filename> entries. A single match resolves as a sole-org fallback: the choice is unambiguous and the ref-pinned content is byte-identical to upstream. Zero or multiple matches keep the miss (which stays soft here, consistent with this action's default-path semantics), and explicit paths never fall back. The fallback applies the same blob-type guard and size limit as the candidate loop, and matched_candidate reports 'sole-org-fallback'. The resolver and its test module were byte-identical to the sibling repository before the fix, and stay byte-identical after it; only the README search-chain section is adapted to this action's soft-miss behaviour. 59 tests pass. Co-authored-by: Claude <noreply@anthropic.com> Signed-off-by: Matthew Watkins <mwatkins@linuxfoundation.org>
ModeSevenIndustrialSolutions
force-pushed
the
feat/sole-org-fallback
branch
from
August 1, 2026 07:01
2a726d4 to
3fbffeb
Compare
Copilot started reviewing on behalf of
ModeSevenIndustrialSolutions
August 1, 2026 07:01
View session
askb
approved these changes
Aug 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Feat: Add sole-org fallback for config resolution
Ports the shared-resolver fix from
harden-runner-block-action#45(seeharden-runner-block-action#44for the full root-cause analysis) — flagged there as a follow-up for this sibling action.Problem
Short-form config references (
config: '@<sha>') derive both the host org and the org-specific search candidate from the running repository owner. In a fork, the fetched.githubtree carries the upstream org's file at the pinned ref, but the candidate path names the fork owner — so resolution can never succeed there.Fix
When the auto-derived search chain misses, scan the fetched (ref-pinned) tree for
<family-dir>/<org>/<filename>entries viagit ls-tree:matched_candidate: sole-org-fallback) — unambiguous, byte-identical to upstream at the pinned SHAignore_vulnsalone), consistent with its existing default-path semanticscat-file -t) and size limit as the candidate loopScope
src/resolve_config_source.pyandtests/test_resolve_config_source.pywere byte-identical to the sibling repository before the fix and remain byte-identical after it (straight copy of the reviewed, merged versions — including all the hardening from that PR's Copilot cycles: blob guard, generic ambiguity diagnostic,./..segment guard)README.mdsearch-chain section updated, adapted to this action's soft-miss behaviour