Skip to content

Commit

Permalink
ci(docker): increase git commit sha slug to 12 characters
Browse files Browse the repository at this point in the history
- we are still having some issues with Docker pulling containers, maybe
  increasing the short git commit sha form default 8 characters to 12
  will improve things (it will certainly decrease the likelihood of
  collision)

Signed-off-by: AtomicFS <[email protected]>
  • Loading branch information
AtomicFS committed Jan 31, 2025
1 parent 5b8c9e6 commit b146d3d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion .dagger-ci/daggerci/lib/git.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ def git_get_latest_commit_sha_short() -> str:
Assuming that current working directory is part of git repository,
get the sha of latest commit and return it.
"""
return git_get_latest_commit_sha_long()[:7]
# Typical git short sha which is 8-characters long:
# return git_get_latest_commit_sha_long()[:7]
# 12-character long short sha:
return git_get_latest_commit_sha_long()[:11]


def git_describe() -> str | None:
Expand Down
2 changes: 1 addition & 1 deletion .dagger-ci/daggerci/tests/test_git.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def test__git_get_latest_commit_sha_long():


def test__git_get_latest_commit_sha_short():
assert re.match(r"^[a-z\d]{7}$", git_get_latest_commit_sha_short())
assert re.match(r"^[a-z\d]{11}$", git_get_latest_commit_sha_short())


@pytest.mark.parametrize(
Expand Down

0 comments on commit b146d3d

Please sign in to comment.