feat(gitcommit): add Git commit source resource - #9609
Conversation
Signed-off-by: ihopenre-eng <247072151+ihopenre-eng@users.noreply.github.com>
|
Thanks for the pullrequest, I'll try to find some time in the coming days to review it |
|
I just gave a quick test and it works as expected thanks for the e2e tests. |
|
Tick the box to add this pull request to the merge queue (same as
|
The condition checks that a commit exists in the repository. The commit hash defaults to the source output and can be overridden with spec.hash. Repository selection follows the same order as the source: URL, path, then SCM working directory. Abbreviated hashes are resolved with the Git revision syntax. Signed-off-by: ihopenre-eng <247072151+ihopenre-eng@users.noreply.github.com>
|
Thanks for testing it! I went ahead and added the condition in this PR (9b60f1d). The condition checks that a commit exists in the repository: the commit hash defaults to the source output and can be overridden with The e2e manifest now covers two condition scenarios — checking the source commit against the SCM working directory, and checking a pinned hash against a cloned URL — and the website documentation PR (updatecli/website#3563) is updated accordingly. |
Fix #2052
Add a
gitcommitresource. The source returns the latest commit hash for a Git branch; the condition checks that a commit exists in a repository. Both support repository URLs, local paths, and SCM working directories. Branch lookup resolves local andoriginrefs without checking out the branch or modifying the working tree.The condition hash defaults to the source output and can be overridden with
spec.hash; abbreviated hashes are resolved with the Git revision syntax.The resource is registered in the pipeline mapping and includes an end-to-end manifest covering URL, path, and SCM inputs plus two condition scenarios.
Test
Additional Information
Checklist
Tradeoff
The target stage returns an explicit unsupported error because a commit hash is immutable. The condition checks commit existence, defaulting to the source output with
spec.hashas an override.Potential improvement
A future changelog implementation could expose commits between two source revisions.