feat(entity): add git:// ChangeID parser#242
Open
mnoah1 wants to merge 2 commits into
Open
Conversation
| const refPrefix = "refs/" | ||
|
|
||
| // changeIDFormat is the expected format for change IDs, included in error messages. | ||
| const changeIDFormat = "git://{owner}/{repo}/{ref}/{head_commit_sha}" |
Collaborator
There was a problem hiding this comment.
Suggested change
| const changeIDFormat = "git://{owner}/{repo}/{ref}/{head_commit_sha}" | |
| const changeIDFormat = "git://{remote}/{repo}/{refspec}/{commit_sha}" |
basically something like git://git.remote.com/<repo>/<refspec>/<commit_sha>? how do we handle port? ideally all URLs support port usage
Contributor
Author
There was a problem hiding this comment.
With my latest update, port can be part of the remote URL.
Contributor
Author
There was a problem hiding this comment.
Any reason we would want refspec over ref? Ref feels less ambiguous.
Adds entity/change/git, a git-scheme change URI parser that mirrors the
github provider (same field/structure naming), differing only where the
schemes genuinely differ: a fixed git scheme and a fully-qualified,
percent-encoded git ref in place of pull/{pr_number}.
The ref segment carries refs/heads/<branch> or refs/tags/<tag>, percent-
encoded so branches, tags, and slash-containing ref names fit a single path
segment unambiguously.
Extracts the lowercase-hex-SHA check into a shared
entity/change/changeutil.IsFullHex(s, length) helper now used by both the
github and git providers, with the expected length passed in per provider.
fefbedb to
f7ae090
Compare
f7ae090 to
05bcab5
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.
Adds entity/change/git, a git-scheme change URI parser that mirrors the github provider (similar field/structure naming), but is used to refer to a change based on ref + commit instead of by pull request.
The ref segment carries refs/heads/ or refs/tags/, percent- encoded in case of slashes in a branch name.
Move existing SHA check into a shared entity/change/changeutil.IsFullHex(s, length) helper now used by both the github and git providers, with the expected length passed in per provider.
Why?
Stovepipe validation will act on changes that are already merged, and referenced by branch + SHA instead of pull request or phabricator revision.
What?
git:// schema definition
Test Plan