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>
@amarkdotdev

Copy link
Copy Markdown
Author

Friendly bump on this one. CI is green on my side and it's been sitting a few weeks with no review yet. Happy to adjust if priorities shifted or if there's anything I can do to help move it forward. Thanks!

@matheuscscp

matheuscscp commented Sep 4, 2026

Copy link
Copy Markdown
Member

@amarkdotdev If you're talking about priorities taking #84 into consideration, yes, priorities have shifted. That issue is from 5 years ago. If you are really using these libraries and need the feature for a specific reason, that's another story.

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

2 participants