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

Release tag points to incorrect commit SHA #7

Closed
MerricdeLauney opened this issue Sep 4, 2019 · 2 comments
Closed

Release tag points to incorrect commit SHA #7

MerricdeLauney opened this issue Sep 4, 2019 · 2 comments

Comments

@MerricdeLauney
Copy link

Hello,

There is some code here:

	versionCommitHash, err := release.FinalizeRelease(releaseName, version, tarballPath)
	if err != nil {
		api.Fatal(errors.Wrap(err, "bad release tarball"))
	}

	commit, err := repository.Commit(commitMessage, request.Params.Rebase)
	if err != nil {
		api.Fatal(errors.Wrap(err, "bad commit"))
	}

	if !request.Params.SkipTag {
		tag := fmt.Sprintf("v%s", version)
		err = repository.Tag(versionCommitHash, tag, tag)
		if err != nil {
			api.Fatal(errors.Wrap(err, "bad tag"))
		}
	}

Here, versionCommitHash is the commit SHA found inside the release manifest (releases/<>/foo-21.yml), which is the commit that the final release was built on.

Right below, we make a commit with all the final release artifacts.

After that, we tag the repository...but we do so using versionCommitHash instead of commit.

@dpb587
Copy link
Owner

dpb587 commented Sep 4, 2019

Hi – if I understand correctly, what you're describing is expected behavior of this resource – it intentionally tags from the commit_hash of the manifest, not the commit which is made. From the Caveats section of the readme:

This tags the commit from which the release tarball was created (commit_hash), not the commit which finalizes the release in the releases directory. This is primarily to ensure git tags match commit_hash and refer to the underlying source where changes between versions occur (as opposed to when it was finalized which may have a different set of files).

This behavior hasn't changed since the resource was first released. Are you seeing a particular problem with this approach, or is it just a surprise / unset expectations? Happy to chat more.

@dpb587
Copy link
Owner

dpb587 commented Sep 10, 2019

Closing - working as expected and discussed further offline.

@dpb587 dpb587 closed this as completed Sep 10, 2019
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

No branches or pull requests

2 participants