feat(bin): support GitHub Enterprise PR URLs via config/pr-hosts allowlist#954
Open
pchuri wants to merge 1 commit into
Open
feat(bin): support GitHub Enterprise PR URLs via config/pr-hosts allowlist#954pchuri wants to merge 1 commit into
pchuri wants to merge 1 commit into
Conversation
pchuri
marked this pull request as draft
July 24, 2026 03:02
…wlist Rebuilt on top of upstream PR kunchenguid#797's provider/host/path/number identity model (GitLab merge-request support), which landed while this branch was in flight and already threads a validated host through the whole poll prepare/publish/verify/retire chain generically. The only place github.com was still hardcoded was fm_pr_url_parse()'s github branch, so this change is now surgical: an operator-approved GHE host (config/pr-hosts, local and gitignored) can arm the canonical merge poll and merge through fm-pr-merge.sh with a scoped GH_HOST, while github.com and gitlab both keep working byte-for-byte identically with zero configuration. config/pr-hosts is deliberately local-only and never inherited into secondmate homes (a security access-control boundary, not an operational preference), matching the captain's explicit correction of an earlier accidental answer to the opposite.
pchuri
force-pushed
the
fm/fm-pr-ghe-ship-j7
branch
from
July 24, 2026 04:20
c29a790 to
46b4a7c
Compare
pchuri
marked this pull request as ready for review
July 24, 2026 04:21
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.
Summary
Threads a validated host through
fm_pr_url_parse()so an operator-approved GitHub Enterprise (GHE) host (config/pr-hosts, local and gitignored) can arm the canonical merge poll and merge throughfm-pr-merge.shwith a scopedGH_HOST, whilegithub.comkeeps working byte-for-byte identically with zero configuration.Rebuilt on top of #797's provider/host/path/number identity model (GitLab merge-request support), which landed while this branch was in flight. That model already threads a validated host generically through the entire poll prepare/publish/verify/retire chain, so this change is now surgical: only
fm_pr_url_parse()'sgithubbranch still hardcodedgithub.com.config/pr-hostsexact-match allowlist for thegithubprovider (RFC-1123 syntax validated, fail-closed on malformed lines, at least one dot so bare hostnames likelocalhostare excluded even if mistakenly allowlisted);github.comalways allowed.bin/fm-pr-poll.shre-derives and re-checks the allowlist independently on every poll execution.bin/fm-pr-merge.shscopesGH_HOSTonly as a single-command prefix for a non-github.comallowlisted host, skipped entirely forgithub.com;gitlabURLs are still refused by the merge path exactly as before.config/pr-hostsis deliberately not inherited into secondmate homes: it is a security access-control boundary, unlike operational preferences such asconfig/backlog-backend.Testing
tests/fm-pr-check-security.test.shwith GHE-host positive cases and adversarial-host rows (suffix tricks, port, userinfo, bare IP,localhost, double/percent-encoding, oversized host), mirroring the existing GitLab test stylemain: Herdr-lab fleet-state tripwire, an Orca metadata-write test, and a macOS stock-bash-3.2 parser quirk inbin/fm-brief.shunrelated to this change)bin/fm-lint.sh(shellcheck) cleanPipeline
This branch was driven through
no-mistakes axi run(intent/rebase/review/test/document/lint all passed for the final commit).Its automated push step failed because the repo's
originpush target resolved to the upstreamkunchenguid/firstmaterather than this fork, and the authenticated identity has no write access there; the branch was pushed to this fork and this PR opened manually as the documented fallback for that routing gap.Updates from git push no-mistakes