Skip to content

feat: add CommitClient.Get to resolve HEAD for a branch or tag - #327

Open
amarkdotdev wants to merge 1 commit into
fluxcd:mainfrom
amarkdotdev:feat/84-get-commit-ref
Open

feat: add CommitClient.Get to resolve HEAD for a branch or tag#327
amarkdotdev wants to merge 1 commit into
fluxcd:mainfrom
amarkdotdev:feat/84-get-commit-ref

Conversation

@amarkdotdev

Copy link
Copy Markdown

Summary

  • Add CommitClient.Get(ctx, ref) to resolve a commit for a branch, tag, or SHA without listing commits first
  • Implement for GitHub (Git Refs API), GitLab (GetCommit), Gitea, and Stash (with list fallback where needed)
  • Add unit coverage for GitHub ref candidate resolution and e2e checks that Get matches ListPage HEAD

Fixes #84

Test plan

  • go test ./github/ ./gitlab/ ./gitea/ ./stash/ (non-e2e)
  • make test-e2e-github / make test-e2e-gitlab with tokens

Add Get(ctx, ref) across providers so callers can resolve a commit SHA
for a branch/tag without listing recent commits first.

Fixes fluxcd#84

Signed-off-by: amarkdotdev <amarkdotdev@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement getting the HEAD for a ref in a branch/tag

1 participant