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

build: fix github checkout tag handling #12417

Merged
merged 1 commit into from
Apr 3, 2023

Conversation

sfoster1
Copy link
Member

@sfoster1 sfoster1 commented Apr 3, 2023

The github actions/checkout action tries to smoothly handle tag changes by converting annotated tags to lightweight tags when you specify an annotated tag to checkout:
actions/checkout#290

This breaks our version-gathering infrastructure in the case where multiple annotated tags point to a single commit. The one that's checked out - which is usually the most recent one, that we want the git describe command to return - won't be returned properly because (a) it isn't annotated and we're not passing --tags and we don't want to because we really like having tag annotations and (b) the history is slightly wrong since now it's a lightweight tag on the specific commit and for that we need --contains, and we don't want to do that because we don't want containing tags.

We can fix this by undoing the tag rewriting by forcing an update back to the original annotated tag from the server and then checking it out.

This should be testable by pushing a couple tags to this branch on the same commit and inspecting the resultant build logs.

Closes RQA-602

The github actions/checkout action tries to smoothly handle tag changes
by converting annotated tags to lightweight tags when you specify an
annotated tag to checkout:
actions/checkout#290

This breaks our version-gathering infrastructure in the case where
multiple annotated tags point to a single commit. The one that's checked
out - which is usually the most recent one, that we want the git
describe command to return - won't be returned properly because (a) it
isn't annotated and we're not passing --tags and we don't want to
because we really like having tag annotations and (b) the history is
slightly wrong since now it's a lightweight tag on the specific commit
and for that we need --contains, and we don't want to do that because we
don't want containing tags.

We can fix this by undoing the tag rewriting by forcing an update back
to the original annotated tag from the server and then checking it out.
@sfoster1 sfoster1 requested a review from a team as a code owner April 3, 2023 16:11
@codecov
Copy link

codecov bot commented Apr 3, 2023

Codecov Report

Merging #12417 (fcdd02d) into internal_release-0.2.0 (86401f2) will decrease coverage by 0.01%.
The diff coverage is n/a.

Impacted file tree graph

@@                    Coverage Diff                     @@
##           internal_release-0.2.0   #12417      +/-   ##
==========================================================
- Coverage                   73.81%   73.81%   -0.01%     
==========================================================
  Files                        2202     2202              
  Lines                       60968    60962       -6     
  Branches                     6213     6213              
==========================================================
- Hits                        45005    44998       -7     
- Misses                      14489    14490       +1     
  Partials                     1474     1474              
Flag Coverage Δ
app 72.57% <ø> (ø)
shared-data 75.71% <ø> (-0.19%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

see 4 files with indirect coverage changes

@sfoster1 sfoster1 changed the title build: fix github api tag build: fix github checkout tag handling Apr 3, 2023
Copy link
Contributor

@SyntaxColoring SyntaxColoring left a comment

Choose a reason for hiding this comment

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

The github actions/checkout action tries to smoothly handle tag changes by converting annotated tags to lightweight tags when you specify an annotated tag to checkout

Good God. Why...would they do that?

@sfoster1
Copy link
Member Author

sfoster1 commented Apr 3, 2023

It's something about better handling for if you delete a tag then push it referring to something else I think. It doesn't fit our workflow.

@sfoster1
Copy link
Member Author

sfoster1 commented Apr 3, 2023

Pushed [email protected] and [email protected] in sequence; this https://github.com/Opentrons/opentrons/actions/runs/4599584524/jobs/8125131813 is the build for 0.0.4-alpha.1 and it got the right version so this seems fixed.

@sfoster1 sfoster1 merged commit 12bb4ec into internal_release-0.2.0 Apr 3, 2023
@sfoster1 sfoster1 deleted the fix-gh-tag-pull branch April 3, 2023 19:12
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.

2 participants