Fixes lagging version of jimm release in our CI/CD#1054
Fixes lagging version of jimm release in our CI/CD#1054mina1460 wants to merge 2 commits intocanonical:feature-rebacfrom mina1460:get_latest_tag_attempt
Conversation
Signed-off-by: mina1460 <mina146@aucegypt.edu>
.github/workflows/charm-build.yaml
Outdated
| with: | ||
| fetch-depth: 0 | ||
| fetch-tags: true | ||
| - run: git fetch --tags --prune --unshallow |
There was a problem hiding this comment.
This may cause confusion because we've already fetched the tags (by fetch-* fields), so if it's not a necessary thing I think it's best to drop it.
Of course, except if you've already checked that and it should be there for things to work as expected. If this is the case, a simple comment would be great.
There was a problem hiding this comment.
I agree that it shouldn't be necessary, but people seem to be recommending this as a workaround in multiple issues online. Including this popular one
actions/checkout#701 (comment)
There was a problem hiding this comment.
Iirc I think they fixed this, also that's v3
There was a problem hiding this comment.
yeah I think they fixed it in v4 so I moved all actions to v4 @ale8k
.github/workflows/charm-release.yaml
Outdated
| fetch-depth: 0 | ||
| fetch-tags: true | ||
| - name: Get latest tags | ||
| run: git fetch --tags |
There was a problem hiding this comment.
it is just an extra step that costs us practically nothing just to be extra sure
There was a problem hiding this comment.
I agree with babak though, if it isn't needed, just remove it, I feel like fetch-tags will work
.github/workflows/charm.yaml
Outdated
| - uses: actions/checkout@v3 | ||
| - run: git fetch --prune --unshallow | ||
| - uses: actions/checkout@v4 | ||
| - run: git fetch --tags --prune --unshallow |
| steps: | ||
| - uses: actions/checkout@v3 | ||
| - run: git fetch --prune --unshallow | ||
| - uses: actions/checkout@v4 |
There was a problem hiding this comment.
Why fetch-* options are not used here (i.e., in charm.yaml), but have been used in charm test actions? I imagine both should have the same interest in git tags, right?
.github/workflows/snap-release.yaml
Outdated
| fetch-depth: 0 | ||
| fetch-tags: true | ||
| - name: fetch newest tags | ||
| run: git fetch --tags |
.github/workflows/snap.yaml
Outdated
| with: | ||
| fetch-depth: 0 | ||
| fetch-tags: true | ||
| - run: git fetch --tags --prune --unshallow |
|
This PR should go into |
Description
Multiple issues reported issues with fetching tags and latest versions in older actions/checkout version.
see actions/checkout#579 and actions/checkout#448
Hopefully by migrating to the new checkout v4 and forcing fetch-depth to 0 and asking for fetch-tags can solve the issue. In some cases, I add a separate command to git fetch --tags explicitly which should come at no cost given that tags should already be fetched in the previous steps.
Fixes CSS-5482
Engineering checklist
Check only items that apply
Test instructions
We need to push a new tag and check. this can be unit-tested or anything similar