Skip to content

Prevent cosmetic issue where component versions are sometimes labeled as commit hashes #1866

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

Merged
merged 1 commit into from
Jul 14, 2025

Conversation

PromoFaux
Copy link
Member

What does this PR aim to accomplish?:

Occasionally core and web master branches can have additional commits ahead of the latest tagged commit - not often, but often enough to make me kick myself when I tag this repo.

This copies the behaviour of bare metal, where the local repository is hard reset to the latest tag.


By submitting this pull request, I confirm the following:

  1. I have read and understood the contributors guide, as well as this entire template. I understand which branch to base my commits and Pull Requests against.
  2. I have commented my proposed changes within the code and I have tested my changes.
  3. I am willing to help maintain this change if there are issues with it later.
  4. It is compatible with the EUPL 1.2 license
  5. I have squashed any insignificant commits. (git rebase)

  • I have read the above and my PR is ready for review. Check this box to confirm

…ntially being additonal commits ahead of the latest tag in both web and core repos.

This is not always the case, but it prevents the built docker container having a broken version string

Signed-off-by: Adam Warner <[email protected]>
@PromoFaux PromoFaux requested a review from a team as a code owner July 14, 2025 21:52
@PromoFaux PromoFaux merged commit 1f618bb into development Jul 14, 2025
9 checks passed
@PromoFaux PromoFaux deleted the slightly-deeper-clone branch July 14, 2025 21:56
@yubiuser
Copy link
Member

This will increase the image size as we don't need a clone depth 5 in most cases. I think the better approach would be to first check for the branch name and if it's master only clone latest tag; in all other cases only clone depth 1

@PromoFaux
Copy link
Member Author

PromoFaux commented Jul 15, 2025

Indeed, by just over 1mb. I can live with that :)

Edit: also, I tried that approach first, but it doesn't work unfortunately. Cloning a specific tag rather than the branch means the repo ends up in a headless state and then the version script does not work.

It's also not possible to change the depth after it has been cloned - which was another approach I looked at.

In the end, I realised i was starting to add a lot of code just to save 1MB

@yubiuser
Copy link
Member

Cloning a specific tag rather than the branch means the repo ends up in a headless state and then the version script does not work.

The trick is to checkout a fake 'master' branch

#1869

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