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

feat(release-to-candidate): Support projects that doesn't specify the version property #46

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

brlin-tw
Copy link

@brlin-tw brlin-tw commented Aug 22, 2024

It is possible that the Snapcraft project doesn't specify the version property in the snapcraft.yaml, instead of setting the snap version string via the craftctl set version=_version_ mechanism. In this case, the parse-snapcraft-yaml job will set the version variable to null, making the release-to-candidate job unable to detect the built snap due to a filename mismatch:

Created snap package tesseract_5.4.1+pkg-481c_amd64.snap
b0c0e58155889237f0b06b0fde00022b99079102e00be507be13ecd891ab44c13637957525631012869dafb04aeefc7794526af071f76523fbedfb26e581e01d  tesseract_5.4.1+pkg-481c_amd64.snap
Revoking proxy token...
RUN: /usr/share/launchpad-buildd/bin/in-target scan-for-processes --backend=lxd --series=jammy --arch=amd64 SNAPBUILD-2576220
Scanning for processes to kill in build SNAPBUILD-2576220
Could not find tesseract_null_amd64.snap
Error: Process completed with exit code 1.

This patch enhances the release-to-candidate job so that the built snap will still be matched via filename matching.

Although projects that don't specify the version property aren't really compliant with the Snapcrafters policy, supporting this use case allows external projects to reuse the snapcrafters/ci/release-to-candidate GitHub Action job without the need to fork the project.

… `version` property

It is possible that the Snapcraft project doesn't specify the `version`
property in the snapcraft.yaml, instead setting the snap version string
via the `craftctl set version=_version` mechanism.  In this case the
parse-snapcraft-yaml job will set the version variable to `null`, making
the release-to-candidate job unable to detect the built snap due to
filename mismatch.

This patch enhances the release-to-candidate job so that the built
snap will still be matched via filename matching.

Signed-off-by: 林博仁(Buo-ren Lin) <[email protected]>
@jnsgruk
Copy link
Member

jnsgruk commented Aug 22, 2024

Failing on projects that don't specify a version is more of a design choice than an oversight.

Ideally we'd like projects to be pulling versioned releases from tags, and having the version set makes it easier for us to automatically bump versions and trigger rebuilds.

@brlin-tw
Copy link
Author

brlin-tw commented Aug 22, 2024

@jnsgruk

Ideally we'd like projects to be pulling versioned releases from tags, and having the version set makes it easier for us to automatically bump versions and trigger rebuilds.

Yeah this is rather a change for non-Snapcrafters projects(e.g. tesserarct-snap) with a different upstream version select strategy(e.g. selective-checkout) to work without implementing their own release-to-{candidate,beta,edge} GH action jobs.

I'm currently working with the Tesseract OCR upstream to re-enable their snap distribution and would like to reuse the Snapcrafters automation when possible.

Signed-off-by: 林博仁(Buo-ren Lin) <[email protected]>
@brlin-tw brlin-tw marked this pull request as draft August 22, 2024 21:39
@brlin-tw
Copy link
Author

The Create tag step also depends on the version output from the snapcraft-yaml job so more changes need to be done in order for this to work.

…ify the `version` property

Signed-off-by: 林博仁(Buo-ren Lin) <[email protected]>
@brlin-tw brlin-tw added the enhancement New feature or request label Aug 26, 2024
@brlin-tw brlin-tw marked this pull request as ready for review August 26, 2024 17:21
Avoid parameter expansion result being treated as a filename pattern.

Signed-off-by: 林博仁(Buo-ren Lin) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants