feat: infer repo for bare issue numbers#37
Merged
Conversation
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.
Opened on behalf of Onur Solmaz (
osolmaz).Summary
Running
gzg 1234from inside a GitHub checkout should open issue or PR number 1234 in that repo.This change makes startup parsing and
gzg openinferowner/repofrom the current git remote before treating a bare number as invalid.It also documents the shortcut and keeps the capture manifests aligned with the new app tree.
What Changed
Bare resource numbers now work when the current directory has a GitHub remote.
The parser still accepts full GitHub URLs,
owner/repo#number, andowner/repo numberexactly as before.ResourceId::parse_with_repo_contextfor bare1234and#1234parsing.originand falling back to another GitHub remote.gzg opensession-control parsing.Testing
I tested the new parser paths directly, then ran the full local gate.
I also ran a real CLI smoke from a temporary git checkout with
origin=https://github.com/openclaw/openclaw.gitand verifiedgzg ... 81834rendered the OpenClaw PR fixture.cargo test repo_contextcargo test relative_numberscargo test open_parsercargo test github_remotegzg --oncesmoke viacargo run --manifest-path /home/bob/repos/ghzinga/Cargo.toml --bin gzg -- --once --offline-fixture /home/bob/repos/ghzinga/fixtures/pr-81834.json 81834from a temp GitHub checkoutscripts/ci-local.shRisks
The behavior is low risk because bare numbers only resolve when a GitHub remote is available.
Without that repo context, existing invalid-input behavior remains in place.
git remote, matching the existing session-context approach.originfirst, then the first non-origin GitHub remote reported by git.