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 number determination should be more robust #13

Open
ximon18 opened this issue Nov 1, 2022 · 2 comments
Open

Version number determination should be more robust #13

ximon18 opened this issue Nov 1, 2022 · 2 comments
Labels
bug Something isn't working enhancement New feature or request

Comments

@ximon18
Copy link
Member

ximon18 commented Nov 1, 2022

Currently O/S packaging takes the version number to use from Cargo.toml while Docker packaging determines the version number based on the current Git branch or tag name. This is inconsistent and could lead to a Docker image being published with a version number in the tag that differs to the version number in the Cargo.toml.

@ximon18 ximon18 added bug Something isn't working enhancement New feature or request labels Nov 1, 2022
@ximon18
Copy link
Member Author

ximon18 commented Nov 3, 2022

Additionally, the version tag determination for Docker images makes assumptions about the primary Git branch being called main.

@ximon18 ximon18 changed the title Inconsistent determination version number determination Inconsistent version number determination Nov 3, 2022
@ximon18 ximon18 changed the title Inconsistent version number determination Version number determination should be more robust. Nov 3, 2022
@ximon18 ximon18 changed the title Version number determination should be more robust. Version number determination should be more robust Nov 3, 2022
@ximon18
Copy link
Member Author

ximon18 commented Nov 3, 2022

Also the Docker tag generation rules have what looks like a possible mistake:

- name: Apply rules to Git metadata to generate potential Docker tags
  id: meta
  uses: docker/metadata-action@v4
  with:
    images: ${{ inputs.docker_repo }}
    flavor: |
      latest=false
    tags: |
      type=semver,pattern={{version}},prefix=v
      type=raw,value=unstable,enable=${{ github.ref == 'refs/heads/main' }}
      type=raw,value=latest,enable=${{ github.ref != 'refs/heads/main' && !contains(github.ref, '-') }}
      type=raw,value=test,enable=${{ !contains(github.ref, 'refs/tags/v') && github.ref != 'refs/heads/main' }}

This bit looks suspect:

      type=raw,value=latest,enable=${{ github.ref != 'refs/heads/main' && !contains(github.ref, '-') }}

Shouldn't that be:

      type=raw,value=latest,enable=${{ contains(github.ref, 'refs/tags/v' && !contains(github.ref, '-') }}

?

@ximon18 ximon18 transferred this issue from NLnetLabs/.github Nov 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant