Repository navigation
fix(bin): skip push-disabled remotes when resolving role-gate publication target - #190
Merged
Merged
Conversation
sKeLe100
force-pushed
the
fm/role-gate-ignore-disabled-upstream
branch
from
October 16, 2026 00:15
4d27af5 to
258c9d7
Compare
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.
Intent
Make the publishing-permission gate resolve this fork's real publication target. The gate (bin/fm-role-lib.sh, fm_role_publication_target) picks the first remote in the order upstream, github, origin, but in this fork upstream is the fetch-only clone of the original project (push URL DISABLED), so a maintainer grant written for the fork never matches and every self-repo ship needs a one-task consent. Background: ledger entry FM-20261014-role-gate-01 in data/mistakes.md. The captain approved one-task consent for this ship only.
What Changed
fm_role_publication_targetinbin/fm-role-lib.shnow reads each remote's push URL (git remote get-url --push) instead of its fetch URL. It skips remotes in theupstream,github,originorder whose push URL is empty orDISABLED. In this fork, the fetch-onlyupstreamclone is skipped, so the gate resolves the fork's real target and a maintainer grant written for the fork can match.docs/configuration.mdnow says the publication target is the push URL of the first usable remote. It also notes that Git treats the fetch URL as the push URL when none is configured.tests/fm-self-repo-role.test.shhas 35 new lines of tests for this behavior.Risk Assessment
✅ Low: Small, well-bounded change to remote selection that uses
git remote get-url --push, skips empty or DISABLED push URLs, and is covered by a behavioral test and matching docs.Testing
tests/fm-self-repo-role.test.sh passes in full. I also ran fm_role_publication_target against a disposable repo for three cases: a disabled upstream with a fork origin, a remote whose push URL differs from its fetch URL, and only a disabled upstream. All three gave the expected result. I did not run the full suite, which hit the 3600s cap earlier.
Evidence: live publication-target resolution
Source: live publication-target resolution
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
✅ **Review** - passed
✅ No issues found.
bin/fm-test-run.sh --changed --exclude-family real-herdr-gated --pc02-if-idlebash tests/fm-self-repo-role.test.shfm_role_publication_target on a disposable git repo: upstream with push URL DISABLED plus fork originfm_role_publication_target on a disposable git repo: github remote with differing pushurlfm_role_publication_target on a disposable git repo: only a disabled upstream remote✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.