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

version:latest tag not applied #60

Open
jtojnar opened this issue Jun 12, 2024 · 1 comment
Open

version:latest tag not applied #60

jtojnar opened this issue Jun 12, 2024 · 1 comment

Comments

@jtojnar
Copy link

jtojnar commented Jun 12, 2024

For selfoss, we use $nextVersion-$commit as a version string but this confuses Cloudsmith, which expects version strings to follow Semantic Versioning specification.1 As a result, the git commit hash after the dash is considered a pre-release version so Cloudsmith assigns the automatic version:latest tag to the snapshot with the numerically greatest commit hash (e.g. fffffff).

Compare https://github.com/fossar/selfoss/commits/36d9205ba6c0271f99bc2f4e292c160eb20fc24b and https://cloudsmith.io/~fossar/repos/selfoss-git/packages

It is possible to workaround this broken detection of latest version by manually setting version:latest tag (as recommended by your Cloudsmith support agent in 2022). Unfortunately, that only works when done using a separate cloudsmith tags add command after uploading the package, not with the --tags option of push command used by the action.

I guess there is/was some hook updating version:latest that triggers only after the package is pushed, so it clobbers the version:latest tag passed through --tags to push command.

I can try to resurrect the workaround I implemented in #35 if desired.

Footnotes

  1. I also tried using fixed pre as the pre-release version, which will be greater than any commit hash, and relegate the commit hash to build metadata. The SemVer spec mandates that “Build metadata MUST be ignored when
    determining version precedence.” But looks like Cloudsmith considers the build metadata part of the sort key, in contradiction with the SemVer spec.

@nickxn
Copy link

nickxn commented Jun 24, 2024

You're spot on @jtojnar, adding a tag needs to happen in a separate command after package sync. Let me check in with the team, but we should automatically detect the latest version on sync and auto-tag this. We see the git commit hash getting pushed in frequently as part of version - let me see whether we can resolve that on our side 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants