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

Tag's sha hash is not long enough in the hash collision case #453

Open
3 tasks done
jung-kim opened this issue Sep 11, 2024 · 0 comments
Open
3 tasks done

Tag's sha hash is not long enough in the hash collision case #453

jung-kim opened this issue Sep 11, 2024 · 0 comments

Comments

@jung-kim
Copy link

Contributing guidelines

I've found a bug, and:

  • The documentation does not mention anything about my problem
  • There are no open or closed issues that are related to my problem

Description

Our repository has grown and we now see git sha hash collisions and 7 characters are not enough. In our case 7 character long git sha hash we receive at the tag output isn't enough to uniquely tag an image.

> git checkout  356defb
error: short object ID 356defb is ambiguous
hint: The candidates are:
hint:   356defb93 commit 2024-09-11 - Merge remote-tracking branch 'origin/master' into release/v3.4
hint:   356defbc8 blob
error: pathspec '356defb' did not match any file(s) known to git

Can we use the output of the git rev-parse --short=7 to generate the tag so we can uniquely tag?

Expected behaviour

Tags output to be unique for all git commits

Actual behaviour

Tage output is not unique for all git commits

Repository URL

No response

Workflow run URL

No response

YAML workflow

# our github action step
      - name: Docker meta for ui
        id: docker_meta_ui
        uses: docker/metadata-action@v5
        with:
          images: |
            gcr.io/affable-ray-226821/streamnative/cloud-manager-ui
          tags: |
            type=sha
      # outputs JSON outputs tags with `sha-356defb` not `sha-356defb9` or `sha-356defbc` and causes collision

Workflow logs

No response

BuildKit logs

No response

Additional info

No response

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

No branches or pull requests

1 participant