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

Add GHA workflow to push operator images for PRs #972

Merged
merged 1 commit into from Jun 8, 2021

Conversation

pmacik
Copy link
Contributor

@pmacik pmacik commented Jun 7, 2021

Motivation

Currently, the acceptance tests with OpenShift (on OpenShift CI) runs only in "local" mode which means it starts a local process of SBO instead of installing the operator into the OpenShift cluster. To make the environment closer to production one, our acceptance tests should run against clusters where the operator is installed using a catalog source or applying an installation yaml file.

ISSUE: https://issues.redhat.com/browse/APPSVC-794

Changes

This PR refactors GitHub worflows so that it build operator, bundle and index images from the PR (a.k.a. "PR images"), pushes it safely to quay.io/redhat-developer/servicebinding-operator repository with the following naming format:

  • pr-<PR_NUMBER>-<8_CHAR_COMMIT_ID> = operator image
  • pr-<PR_NUMBER>-<8_CHAR_COMMIT_ID>-bundle = bundle image
  • pr-<PR_NUMBER>-<8_CHAR_COMMIT_ID>-image = index image

The GH actions for acceptance tests with Kubernetes waits for the above images to be pushed and then use them to run the acceptance test with.

The OpenShift CI jobs for running the acceptance tests are updated to use those images.

All the jobs are correlated through the name of the images based on PR number and the commit ID.

This PR also adds additional workflow that is triggerd when the PR is closed to delete the PR images related to the PR that generated them to make sure the remote repository is not flooded with past PR images.

Testing

I've tested the workflows in the fork repository via couple of PRs such as https://github.com/pmacik/service-binding-operator/pull/115/checks

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jun 7, 2021

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@openshift-ci openshift-ci bot requested review from baijum and sbose78 June 7, 2021 15:51
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jun 7, 2021

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
To complete the pull request process, please ask for approval from pmacik after the PR has been reviewed.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Copy link
Contributor

@pedjak pedjak left a comment

Choose a reason for hiding this comment

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

look really good, a few remarks, feel free to decide on your own what would you like to take or not

.github/actions/setup-cli/action.yaml Show resolved Hide resolved
.github/actions/setup-cli/action.yaml Show resolved Hide resolved
.github/actions/setup-podman/registries.conf Outdated Show resolved Hide resolved
.github/workflows/pr-checks-build-images.yaml Outdated Show resolved Hide resolved
.github/workflows/pr-checks-clean-images.yaml Show resolved Hide resolved
.github/workflows/pr-checks-push-images.yaml Outdated Show resolved Hide resolved
.github/workflows/pr-checks-push-images.yaml Outdated Show resolved Hide resolved
.github/workflows/pr-checks.yaml Outdated Show resolved Hide resolved
.github/workflows/pr-checks.yaml Outdated Show resolved Hide resolved
hack/prepare-operatorhub-pr.sh Show resolved Hide resolved
@pmacik pmacik force-pushed the master branch 6 times, most recently from 8b04f0e to 4ba7ad0 Compare June 7, 2021 23:20
@codecov
Copy link

codecov bot commented Jun 7, 2021

Codecov Report

Merging #972 (4efe1c9) into master (126e3e2) will not change coverage.
The diff coverage is n/a.

❗ Current head 4efe1c9 differs from pull request most recent head 660dee2. Consider uploading reports for the commit 660dee2 to get more accurate results
Impacted file tree graph

@@           Coverage Diff           @@
##           master     #972   +/-   ##
=======================================
  Coverage   54.27%   54.27%           
=======================================
  Files          23       23           
  Lines        1227     1227           
=======================================
  Hits          666      666           
  Misses        473      473           
  Partials       88       88           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 126e3e2...660dee2. Read the comment docs.

@pmacik pmacik force-pushed the master branch 3 times, most recently from 0bc7e5b to 2b5824f Compare June 8, 2021 06:09
Signed-off-by: Pavel Macík <pavel.macik@gmail.com>
@pmacik pmacik marked this pull request as ready for review June 8, 2021 10:04
@pmacik pmacik changed the title [WIP] Add GHA workflow to push operator images for PRs Add GHA workflow to push operator images for PRs Jun 8, 2021
@pmacik pmacik merged commit 44745d1 into redhat-developer:master Jun 8, 2021
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.

None yet

2 participants