Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

git: Add support for adding tag info to commit #597

Merged
merged 5 commits into from
Aug 21, 2023
Merged

Conversation

aryan9600
Copy link
Member

@aryan9600 aryan9600 commented Jun 30, 2023

Add a new struct Tag that represents a Git annotated tag and add it as a new field Commit.ReferencingTag, allowing for a commit to contain information about its referencing tag. Add support for verifying the referencing tag as well.
Update the cloning logic to include the tag object in the returned commit object when checking out via a specific tag, a semver range or if the provided refname points to a tag.

Related to: fluxcd/source-controller#1133
Example usage: fluxcd/source-controller#1187

@aryan9600 aryan9600 requested a review from hiddeco as a code owner June 30, 2023 09:53
@aryan9600 aryan9600 marked this pull request as draft June 30, 2023 09:57
@stefanprodan
Copy link
Member

Is this part of fluxcd/source-controller#1133? if so please add it to the PR description.

@stefanprodan stefanprodan added the area/git Git and SSH related issues and pull requests label Jun 30, 2023
@aryan9600 aryan9600 marked this pull request as ready for review July 3, 2023 08:10
@aryan9600 aryan9600 added the enhancement New feature or request label Jul 3, 2023
git/git.go Outdated Show resolved Hide resolved
git/git.go Outdated Show resolved Hide resolved
git/utils.go Outdated Show resolved Hide resolved
git/git.go Outdated Show resolved Hide resolved
git/gogit/clone.go Outdated Show resolved Hide resolved
@aryan9600 aryan9600 force-pushed the tag-verification branch 2 times, most recently from 721ba7d to 0830185 Compare July 31, 2023 13:03
git/git.go Outdated Show resolved Hide resolved
Copy link
Member

@hiddeco hiddeco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thank you @aryan9600 🙇

@aryan9600
Copy link
Member Author

aryan9600 commented Aug 9, 2023

wondering whether we should also add support for verifying tags if the name provided to cloneRefName() points to a tag?

@hiddeco
Copy link
Member

hiddeco commented Aug 9, 2023

If we can automagically resolve this, it would probably be good for feature completeness.

git/gogit/clone.go Outdated Show resolved Hide resolved
git/git.go Outdated Show resolved Hide resolved
@aryan9600 aryan9600 force-pushed the tag-verification branch 2 times, most recently from fbb668e to 8fe69f8 Compare August 18, 2023 11:27
Copy link
Member

@stefanprodan stefanprodan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Thanks @aryan9600 🏅

Add a new struct `AnnotatedTag` that represents a Git annotated tag and
add it as a new field `Commit.ReferencingTag`, allowing for a commit to
contain information about its referencing tag. Add support for verifying
referecning tag as well.

Signed-off-by: Sanskar Jaiswal <[email protected]>
Add support for lightweight tags by checking the presence of a tag
reference and a tag object. Modify the cloning logic to always attach a
tag object to a commit object if checking out via a tag.

Signed-off-by: Sanskar Jaiswal <[email protected]>
@aryan9600
Copy link
Member Author

Failing BitBucket Server test is due to TLS issues on the upstream server and not related to these changes.

@aryan9600 aryan9600 merged commit 04a0963 into main Aug 21, 2023
12 of 13 checks passed
@aryan9600 aryan9600 deleted the tag-verification branch August 21, 2023 17:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/git Git and SSH related issues and pull requests enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants