Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions publish-operators-for-ui-e2e-tests/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: 'Publish Current Toolchain Operators (Host & Member) for UI e2e Tests'
description: 'An action that publishes the current version of Toolchain Operators as single releases for UI e2e Tests'
inputs:
quay-token:
description: Quay token
required: true
quay-namespace:
description: Quay namespace
required: false
default: codeready-toolchain
sha:
description: PR head sha
default: ${{ github.event.pull_request.head.sha }}
required: false
pr-number:
description: Number of the PR
default: ${{ github.event.pull_request.number }}
required: false
author:
description: Author of the PR
default: ${{ github.event.pull_request.head.user.login }}
required: false
gh-head-ref:
description: Branch name the PR was opened from
default: ${{ github.event.pull_request.head.ref }}
required: false
runs:
using: "composite"
steps:
- name: Login to quay
shell: bash
run: |
set -e
export XDG_RUNTIME_DIR=/run/user/${UID}
mkdir -p ${XDG_RUNTIME_DIR}/containers || true
echo "{
\"auths\": {
\"quay.io\": {
\"auth\": \"${{ inputs.quay-token }}\"
}
}
}"> ${XDG_RUNTIME_DIR}/containers/auth.json

podman login --get-login quay.io

- name: Publish current bundle for UI e2e Tests
shell: bash
run: |
PROVIDED_REF=${{ inputs.gh-head-ref }}
if [[ -n ${PROVIDED_REF} ]]; then
GH_HEAD_REF_PARAM="GITHUB_HEAD_REF=${PROVIDED_REF}"
fi
make publish-current-bundles-for-e2e QUAY_NAMESPACE=${{ inputs.quay-namespace }} IMAGE_BUILDER=podman PULL_PULL_SHA=${{ inputs.sha }} PULL_NUMBER=${{ inputs.pr-number }} AUTHOR=${{ inputs.author }} ${GH_HEAD_REF_PARAM} ENVIRONMENT=ui-e2e-tests
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

why do we need this special GHA composite? and why do we need to provide the ENVIRONMENT as part of "building & publishing" the bundles? There was probably some change that I missed

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Since we will have two jobs (one for running our current e2e tests and another to run the ui e2e tests), we need to deploy the operators twice. So, I created a different GHA composite for us to be able to publish a image just for the ui e2e tests. I passed the environment to be able to choose the image name, I was working on this proposed solution: https://github.com/codeready-toolchain/toolchain-e2e/pull/1180/files#diff-569b46caefde16d54d39745e2b26b2e9c19570d97da1e8f4471a587610e5961dR118

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

ok, this PR is what I was missing codeready-toolchain/toolchain-e2e#1180
TBH, passing environment variable as part of building process is a bit weird. The built images should be environment agnostic, the environment is defined as part of the deployment.

Anyway, I wouldn't create a copy of the already existing composite that differs only in one parameter - let's update the existing and add any parameter we need and that will be set only in the case when it's needed (UI tests)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

but wait a sec, why do we actually need to build the bundle & index images for UI tests? there is no pairing with any of the related repos - we can always use the latest index image for UI tests, right?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I mean at least in the first phase when the tests will be executed separately, or am I missing some small detail?

Copy link
Copy Markdown
Contributor Author

@rsoaresd rsoaresd Jul 30, 2025

Choose a reason for hiding this comment

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

"Confusing" just in terms for us to keep in mind that the ui e2e tests job will deploy the latest operators and not doing pairing

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Maybe I am complicating this first phase, sorry!

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Don't be sorry about that, it's most likely just me who is slow with understanding the final idea 😅 That's why I'm asking these questions 🙂

So what you are saying is that you wanted to enable pairing with reg-service, host-operator, and member-operator PRs from toolchain-e2e for UI tests, right? in other words:

  1. there is host-operator PR
  2. there is e2e-test PR
  3. we need to pair these two PRs so it uses
    • host-operator from the PR
    • toolchain-e2e from the PR
    • UI from master

At the same time:

  1. there is RHDH-plugins PR
  2. there is e2e-test PR
  3. we need to pair these two PRs so it uses
    • operators from master
    • toolchain-e2e from the PR
    • UI from the RHDH-plugins PR

Now I understand your point that we cannot simply rely on the latest version of the operators, because it would break the first case.

But for now, we won't run e2e tests in the RHDH-plugins repo, correct? It will be executed only in toolchain-e2e repo. It looks very similar to what we have for ksctl.
This means that we can rely on the already built operator bundles & images from the already existing GHA workflow https://github.com/codeready-toolchain/toolchain-e2e/blob/master/.github/workflows/publish-operators-for-e2e-tests.yml
in other words, use the same index image in the CatalogSources as we use in the current openshift-ci job for k8s API tests.

Does it cover the case?

Copy link
Copy Markdown
Contributor Author

@rsoaresd rsoaresd Jul 30, 2025

Choose a reason for hiding this comment

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

But for now, we won't run e2e tests in the RHDH-plugins repo, correct?

Correct! For now, we will only run on toolchain-e2e repo.

This means that we can rely on the already built operator bundles & images from the already existing GHA workflow https://github.com/codeready-toolchain/toolchain-e2e/blob/master/.github/workflows/publish-operators-for-e2e-tests.yml

Unfortunately, no, because we need to configure the ToolchainConfig: https://github.com/codeready-toolchain/toolchain-e2e/blob/master/deploy/host-operator/ui-e2e-tests/toolchainconfig.yaml, so we would need to publish the image for ui e2e tests anyway

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Let me rephrase everything, sorry. I struggle to explain myself.

So, since we need to configure the ToolchainConfig: https://github.com/codeready-toolchain/toolchain-e2e/blob/master/deploy/host-operator/ui-e2e-tests/toolchainconfig.yaml, because of the SSO, we would need to publish the operators for ui e2e tests environment.

That's why I added a new GHA workflow, for us to publish a dedicated ui e2e tests images for host and member operators. I agree that we can reuse the current one instead of duplicating, i will address that.

So, in this first phase, we will enable the UI E2E testing only on toolchain-e2e repo, making available the pairing with host-operator, member-operator, registration-service, and RHDH plugin repo. So, if:

there is host-operator PR and toolchain-e2e PR, we need to pair these two PRs so it uses:

  • host-operator from the PR
  • toolchain-e2e from the PR
  • UI from master

there is RHDH-plugins PR and there is toolchain-e2e PR, we need to pair these two PRs so it uses:

  • operators from master
  • toolchain-e2e from the PR
  • UI from the RHDH-plugins PR

53 changes: 53 additions & 0 deletions publish-sandbox-ui-for-ui-e2e-tests/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: 'Publish Current Developer Sandbox UI'
description: 'An action that publishes the current version of Developer Sandbox UI'
Comment on lines +1 to +2
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

in which repos will we run this action? In all where we run e2e tests or only in e2e and UI repo?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

For now, just in toolchain-e2e. When we move the UI code to our own repo, we will run it there too.

Regarding host-operator, member-operator, and registration-service, we need to decide if we want to run them. In my opinion, i think it makes sense to run them there too. But first we need to check how stable the ui e2e tests will be on toolchain-e2e and ui repo.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

ok, the reason why I asked was if we need another composite/GHA or if it can be part of the already existing build & push process.
For the simplicity, since it's gonna be executed in e2e repo only for now, you don't need to create a composite but a workflow in toolchain-e2e repo directly. It can be moved to the composite later when we decide where to run it.

Copy link
Copy Markdown
Contributor Author

@rsoaresd rsoaresd Jul 30, 2025

Choose a reason for hiding this comment

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

Deal, I will do on toolchain-e2e pr side to add the workflow directly: https://github.com/codeready-toolchain/toolchain-e2e/pull/1181/files

inputs:
quay-token:
description: Quay token
required: true
quay-namespace:
description: Quay namespace
required: false
default: codeready-toolchain
sha:
description: PR head sha
default: ${{ github.event.pull_request.head.sha }}
required: false
pr-number:
description: Number of the PR
default: ${{ github.event.pull_request.number }}
required: false
author:
description: Author of the PR
default: ${{ github.event.pull_request.head.user.login }}
required: false
gh-head-ref:
description: Branch name the PR was opened from
default: ${{ github.event.pull_request.head.ref }}
required: false
runs:
using: "composite"
steps:
- name: Login to quay
shell: bash
run: |
set -e
export XDG_RUNTIME_DIR=/run/user/${UID}
mkdir -p ${XDG_RUNTIME_DIR}/containers || true
echo "{
\"auths\": {
\"quay.io\": {
\"auth\": \"${{ inputs.quay-token }}\"
}
}
}"> ${XDG_RUNTIME_DIR}/containers/auth.json

podman login --get-login quay.io

- name: Publish current Developer Sandbox UI
shell: bash
run: |
PROVIDED_REF=${{ inputs.gh-head-ref }}
if [[ -n ${PROVIDED_REF} ]]; then
GH_HEAD_REF_PARAM="GITHUB_HEAD_REF=${PROVIDED_REF}"
fi
make push-sandbox-plugin QUAY_NAMESPACE=${{ inputs.quay-namespace }} IMAGE_BUILDER=podman PULL_PULL_SHA=${{ inputs.sha }} PULL_NUMBER=${{ inputs.pr-number }} AUTHOR=${{ inputs.author }} GITHUB_BRANCH="${PROVIDED_REF}" ${GH_HEAD_REF_PARAM}