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

ROX-27384, ROX-26026: Unify determine-image-tag task #16

Merged
merged 11 commits into from
Jan 17, 2025

Conversation

msugakov
Copy link
Contributor

@msugakov msugakov commented Jan 2, 2025

Description

Here's the unified determine-image-tag task with git tags support.

It's probably easier to review this PR in its eventual state, although it can be reviewed by commits too.

Factored out of stackrox/stackrox#13422.

Testing

For Collector: stackrox/collector#2001 (ready)
For Scanner: stackrox/scanner#1771 (ready)
For StackRox: stackrox/stackrox#13850 (wip)

msugakov added a commit to stackrox/collector that referenced this pull request Jan 2, 2025
@msugakov msugakov force-pushed the misha/ROX-27384-unify-determine-image-tag branch 4 times, most recently from 346f018 to c0507d4 Compare January 7, 2025 13:39
msugakov added a commit to stackrox/collector that referenced this pull request Jan 7, 2025
@msugakov msugakov force-pushed the misha/ROX-27384-unify-determine-image-tag branch 2 times, most recently from c1466d8 to e5dbcab Compare January 13, 2025 18:54
msugakov added a commit to stackrox/collector that referenced this pull request Jan 13, 2025
I tried having this logic as part of the regular
`determine-image-tag` task but it turned to be oddly-looking when
I started adding tagging support and so here I just move it to its
own place to live its own life.

Note tha this task doesn't call `fail-build-if-git-is-dirty.sh`
script because the outputs aren't affected by whether git changes
are committed.
We're moving towards https://issues.redhat.com/browse/ROX-27488 and
so there's no need to call the external script if the check can be
made locally.

Note that compared to
https://github.com/stackrox/stackrox/blob/b170ccb6e8193151ed5d14799ae984c8c1402724/.konflux/scripts/fail-build-if-git-is-dirty.sh
this script doesn't try to restore Dockerfiles because it is executed
before prefetch task which makes those changes.
After thinking about it, I concluded that the suppression may have to
be done differently and it's not the right time to introduce it yet.
(If needed in this form, I could restore it from the git history.)
@msugakov msugakov force-pushed the misha/ROX-27384-unify-determine-image-tag branch from e5dbcab to b0e85e0 Compare January 16, 2025 11:04
msugakov added a commit to stackrox/collector that referenced this pull request Jan 16, 2025
```
Tag from Tekton event: ''
Tag reported by Makefile: 'misha-test-8'
Tags seen by git: 'misha-test-8'
Long git describe output: 'misha-test-8-0-g8d18e3b812'
This is not a tag push event but Makefile reports literally the git tag 'misha-test-8'.
This happens when a build was triggered not by a tag push event but the commit is tagged and when the Makefile doesn't use '--long' with 'git describe'.
/tekton/scripts/script-1-7v9vw: line 73: misha-test-8: command not found
We should use a different image tag for this build in order to not mix results with a build that was triggered by the tag push event and which will indeed use  as the tag for images built there.
Using misha-test-8-0-g8d18e3b812 for the tag.
misha-test-8-0-g8d18e3b812-fast
```
msugakov added a commit to stackrox/collector that referenced this pull request Jan 16, 2025
msugakov added a commit to stackrox/collector that referenced this pull request Jan 16, 2025
msugakov added a commit to stackrox/scanner that referenced this pull request Jan 16, 2025
msugakov added a commit to stackrox/stackrox that referenced this pull request Jan 16, 2025
@msugakov msugakov marked this pull request as ready for review January 16, 2025 19:55
@msugakov msugakov requested a review from a team as a code owner January 16, 2025 19:55
@msugakov msugakov requested a review from tommartensen January 16, 2025 19:55
msugakov added a commit to stackrox/stackrox that referenced this pull request Jan 16, 2025
msugakov added a commit to stackrox/stackrox that referenced this pull request Jan 16, 2025
@msugakov msugakov merged commit 7b2d22c into main Jan 17, 2025
1 check passed
@msugakov msugakov deleted the misha/ROX-27384-unify-determine-image-tag branch January 17, 2025 14:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants