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

Use commit hash for image tag #11233

Merged
merged 2 commits into from
Dec 5, 2023

Conversation

montaguethomas
Copy link
Contributor

@montaguethomas montaguethomas commented Oct 30, 2023

Description:

Currently all published images can only be referenced by image digest. These image digests cannot be linked to the actual commit or tag it was built for. The workflow recommends to use the GITHUB_REF_NAME environment variable for the tag. Unforuntiatly that value would end up being just the branch name of master. Instead suggest to use the GITHUB_SHA variable to tag every image built with the commit hash. This change will still tag the head of the master branch as latest.

Rationale:

By using the git reference variable for the tag, it makes it clear which commit/tag the image was built from in the image versions list: https://github.com/ComplianceAsCode/content/pkgs/container/k8scontent/versions

@openshift-ci openshift-ci bot added the needs-ok-to-test Used by openshift-ci bot. label Oct 30, 2023
@openshift-ci
Copy link

openshift-ci bot commented Oct 30, 2023

Hi @montaguethomas. Thanks for your PR.

I'm waiting for a ComplianceAsCode member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@github-actions
Copy link

Start a new ephemeral environment with changes proposed in this pull request:

Fedora Environment
Open in Gitpod

Oracle Linux 8 Environment
Open in Gitpod

Turns out [GITHUB_REF_NAME](https://docs.github.com/en/actions/learn-github-actions/variables) will match the branch name instead of a git describe value.
@montaguethomas montaguethomas changed the title Use recommended Github reference name for image tag. Use commit hash for image tag. Oct 30, 2023
@codeclimate
Copy link

codeclimate bot commented Oct 30, 2023

Code Climate has analyzed commit af429e2 and detected 0 issues on this pull request.

The test coverage on the diff in this pull request is 100.0% (50% is the threshold).

This pull request will bring the total coverage in the repository to 58.4%.

View more on Code Climate.

@jan-cerny jan-cerny changed the title Use commit hash for image tag. Use commit hash for image tag Nov 2, 2023
@marcusburghardt
Copy link
Member

/packit build

@marcusburghardt marcusburghardt added the Kubernetes Kubernetes remediation update. label Nov 8, 2023
@vojtapolasek vojtapolasek added this to the 0.1.72 milestone Nov 29, 2023
Copy link
Member

@yuumasato yuumasato left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@yuumasato yuumasato merged commit 13bbd54 into ComplianceAsCode:master Dec 5, 2023
35 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Kubernetes Kubernetes remediation update. needs-ok-to-test Used by openshift-ci bot.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants