-
Notifications
You must be signed in to change notification settings - Fork 111
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
CreateRelease action tags wrong commit #229
Comments
@freddydk The commit used for the artifcat can be gotten from $_.workflow_run.head_sha The problem is what commit should be used in multi-project repos?
|
Looking at this. If this is not the case and the latest CI/CD was successful, then tagging the latest commit should give you the source which was used to provide the bits. I don't think you can get the workflow_run.head_sha during the create release. But... first let me understand the issue and whether this is how you see it - and whether this is an actual problem you ran into or a problem you can see will occur? Thanks |
Yes this is exactly what happened. In a multi-project repo this failure might not have even been the last run. Imagine...
Depending how many project you have and how many build were since that failure It would be easy to overlook this and only realise there was an error after deployment. I think its not correct to tag the latest since its just not true that the source code present in the latest commit was completely released. But maybe im wrong I havn't had this in a multi project repo.
I actually had this error. And when I deployed the code and didn't find the latest feature, I tried to figure out why the new feature was not present and the first thing I did was to look at the tagged commit. Which I then realised was wrong. The reason the action failed was because of a 404 error when getting the artifact. - I know there were fixes made to better handle these - but a failure for some outside reason could always happen and would not have been caught in a PR. Maybe the solution is to fail the release if not all code from the latest commit is released - but this might be difficult to figure out. You would need to iterate through the git history since last release and figure this out.
I havn't actually ran the code. But I would have done the change within this loop
You request the following endpoint which gives you accest to the workflow_run properties. https://docs.github.com/en/rest/actions/artifacts |
Got it, |
The tag will never be perfect. |
Even if you create a release branch the commits will still have the same hash. Or do I have something wrong here?
I think this could be a good solution - even in single project repos. It would increase the release time, but you could make sure the build you invoked was actually successful, if not - don't release. |
Correct - but the tag cannot tag one SHA for one project and another SHA for another project and if the idea is to be able to create a release branch based on this tag - then that will never work. Some people are using release branches to create hotfixes from - those might be wrong. I will look into somehow "demanding" a complete build for a release. |
I'm sorry... |
Implementation
|
I think this is a good compromise. Thanks |
CreateRelease will release the latest CICD artifact and also tag the latest git commit.
But not in all case this is correct.
It would be better to tag the commit that's actually used in the artifact.
If you want to look at the source code that was actually released you might be looking at the wrong code in the current configuration.
The release rest api allows you to specify a different commit.
The text was updated successfully, but these errors were encountered: