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

gitops-pull-request: check only changed images #890

Merged
merged 2 commits into from
Mar 20, 2024

Conversation

chmeliik
Copy link
Contributor

The pipeline will only check images that changed in the pull request

@chmeliik
Copy link
Contributor Author

task/gather-deploy-images:

When the TARGET_BRANCH param is specified, the task will return only the
images that differ between the current revision and the target branch.

Note that the origin/$TARGET_BRANCH reference must already exist in the
cloned repo. The task doesn't have the ability to fetch from private
repos, instead it depends on the clone task to fetch everything
that's necessary.

---

pipelines/gitops-pull-request-rhtap:

* add a target-branch param and pass it to gather-deploy-images
* pass fetchTags: "true" to the clone task (required for
  gather-deploy-images to be able to check the target branch)

Signed-off-by: Adam Cmiel <[email protected]>
task/gather-deploy-images:

When there are no images to check, return an empty string for
IMAGES_TO_VERIFY.

---

pipelines/gitops-pull-request-rhtap:

Run the EC task only if gather-deploy-images gathers some images.
Otherwise, the last step of the task (assert) would fail.

Signed-off-by: Adam Cmiel <[email protected]>
Copy link

sonarcloud bot commented Mar 20, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@chmeliik
Copy link
Contributor Author

re-testing, don't merge yet

@chmeliik
Copy link
Contributor Author

Yup, still works 🎉 https://github.com/acmiel-rhtap/rhtap-foo-gitops/pull/1

First the EC check was skipped with no image changes, then it ran as expected (and failed, but for unrelated reasons)

@mmorhun mmorhun merged commit 6b2b4e4 into konflux-ci:main Mar 20, 2024
5 of 6 checks passed
@chmeliik chmeliik deleted the gather-only-changed-images branch March 21, 2024 08:16
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.

3 participants