Skip to content

Commit 439bbf9

Browse files
author
KubeSaw
committed
Revert "improvements"
This reverts commit 481e279.
1 parent 481e279 commit 439bbf9

File tree

6 files changed

+211
-6
lines changed

6 files changed

+211
-6
lines changed
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
name: publish-operators-for-ui-e2e-tests
2+
on:
3+
issue_comment:
4+
types: [created]
5+
# temporary, just to test the workflow
6+
pull_request:
7+
types: [opened, synchronize, reopened, ready_for_review]
8+
9+
env:
10+
GOPATH: /tmp/go
11+
12+
jobs:
13+
binary:
14+
name: Build & push operator bundles for UI e2e tests
15+
16+
runs-on: ubuntu-24.04
17+
if: ${{ github.event.comment == '' || contains(github.event.comment.body, '/retest') || contains(github.event.comment.body, '/test all') || contains(github.event.comment.body, '/test e2e') }}
18+
steps:
19+
# Checkout from PR event - in that case the comment field is empty
20+
- name: Checkout code from PR event
21+
uses: actions/checkout@v4
22+
if: ${{ github.event.comment == '' }}
23+
with:
24+
ref: ${{github.event.pull_request.head.ref}}
25+
repository: ${{github.event.pull_request.head.repo.full_name}}
26+
fetch-depth: 0
27+
28+
# If the workflow was triggered based on comment, then we need to get the information about the PR
29+
# Is executed only for comment events - in that case the pull_request field is empty
30+
- name: Send Github API Request to get PR data
31+
id: request
32+
uses: octokit/request-action@v2.4.0
33+
if: ${{ github.event.pull_request == '' }}
34+
with:
35+
route: ${{ github.event.issue.pull_request.url }}
36+
env:
37+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
38+
39+
# Checkout the code based on the data retrieved from the previous step
40+
# Is executed only for comment events - in that case the pull_request field is empty
41+
- name: Checkout code from PR
42+
uses: actions/checkout@v4
43+
if: ${{ github.event.pull_request == '' }}
44+
with:
45+
repository: ${{ fromJson(steps.request.outputs.data).head.repo.full_name }}
46+
ref: ${{ fromJson(steps.request.outputs.data).head.ref }}
47+
fetch-depth: 0
48+
49+
- name: Install Go
50+
uses: actions/setup-go@v5
51+
with:
52+
go-version-file: go.mod
53+
54+
- name: Cache dependencies
55+
uses: actions/cache@v4
56+
with:
57+
path: ~/go/pkg/mod
58+
key: ${{ runner.os }}-go-${{ hashFiles ('**/go.sum') }}
59+
restore-keys: |
60+
${{ runner.os }}-go-
61+
62+
- uses: actions/setup-python@v5
63+
with:
64+
python-version: '3.x'
65+
66+
- name: Prepare tools
67+
uses: codeready-toolchain/toolchain-cicd/prepare-tools-action@master
68+
69+
# Execute composite action using values from PR event
70+
# Is executed only for PR events - in that case the comment field is empty
71+
- name: Publish current operator bundles for host & member based on PR event
72+
uses: rsoaresd/toolchain-cicd/publish-operators-for-ui-e2e-tests@add_actions_to_ui_e2e_tests
73+
if: ${{ github.event.comment == '' }}
74+
with:
75+
quay-token: ${{ secrets.TEST_QUAY_TOKEN }}
76+
quay-namespace: codeready-toolchain-test
77+
sha: ${{ github.event.pull_request.head.sha }}
78+
pr-number: ${{ github.event.pull_request.number }}
79+
author: ${{ github.event.pull_request.head.user.login }}
80+
gh-head-ref: ${{ github.event.pull_request.head.ref }}
81+
82+
# Execute composite action using values from PR event
83+
# Is executed only for comment events - in that case the pull_request field is empty
84+
- name: Publish current operator bundles for host & member based on comment event
85+
uses: rsoaresd/toolchain-cicd/publish-operators-for-ui-e2e-tests@add_actions_to_ui_e2e_tests
86+
if: ${{ github.event.pull_request == '' }}
87+
with:
88+
quay-token: ${{ secrets.TEST_QUAY_TOKEN }}
89+
quay-namespace: codeready-toolchain-test
90+
sha: ${{ fromJson(steps.request.outputs.data).head.sha }}
91+
pr-number: ${{ fromJson(steps.request.outputs.data).number }}
92+
author: ${{ fromJson(steps.request.outputs.data).head.user.login }}
93+
gh-head-ref: ${{ fromJson(steps.request.outputs.data).head.ref }}
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
name: publish-sandbox-ui-for-ui-e2e-tests
2+
on:
3+
issue_comment:
4+
types: [created]
5+
# temporary, just to test the workflow
6+
pull_request:
7+
types: [opened, synchronize, reopened, ready_for_review]
8+
9+
env:
10+
GOPATH: /tmp/go
11+
12+
jobs:
13+
binary:
14+
name: Build & push Developer Sandbox UI image for UI e2e tests
15+
16+
runs-on: ubuntu-24.04
17+
if: ${{ github.event.comment == '' || contains(github.event.comment.body, '/retest') || contains(github.event.comment.body, '/test all') || contains(github.event.comment.body, '/test e2e') }}
18+
steps:
19+
# Checkout from PR event - in that case the comment field is empty
20+
- name: Checkout code from PR event
21+
uses: actions/checkout@v4
22+
if: ${{ github.event.comment == '' }}
23+
with:
24+
ref: ${{github.event.pull_request.head.ref}}
25+
repository: ${{github.event.pull_request.head.repo.full_name}}
26+
fetch-depth: 0
27+
28+
# If the workflow was triggered based on comment, then we need to get the information about the PR
29+
# Is executed only for comment events - in that case the pull_request field is empty
30+
- name: Send Github API Request to get PR data
31+
id: request
32+
uses: octokit/request-action@v2.4.0
33+
if: ${{ github.event.pull_request == '' }}
34+
with:
35+
route: ${{ github.event.issue.pull_request.url }}
36+
env:
37+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
38+
39+
# Checkout the code based on the data retrieved from the previous step
40+
# Is executed only for comment events - in that case the pull_request field is empty
41+
- name: Checkout code from PR
42+
uses: actions/checkout@v4
43+
if: ${{ github.event.pull_request == '' }}
44+
with:
45+
repository: ${{ fromJson(steps.request.outputs.data).head.repo.full_name }}
46+
ref: ${{ fromJson(steps.request.outputs.data).head.ref }}
47+
fetch-depth: 0
48+
49+
- name: Install Go
50+
uses: actions/setup-go@v5
51+
with:
52+
go-version-file: go.mod
53+
54+
- name: Cache dependencies
55+
uses: actions/cache@v4
56+
with:
57+
path: ~/go/pkg/mod
58+
key: ${{ runner.os }}-go-${{ hashFiles ('**/go.sum') }}
59+
restore-keys: |
60+
${{ runner.os }}-go-
61+
62+
- uses: actions/setup-python@v5
63+
with:
64+
python-version: '3.x'
65+
66+
- name: Prepare tools
67+
uses: codeready-toolchain/toolchain-cicd/prepare-tools-action@master
68+
69+
# Execute composite action using values from PR event
70+
# Is executed only for PR events - in that case the comment field is empty
71+
- name: Publish current Developer Sandbox UI image
72+
uses: rsoaresd/toolchain-cicd/publish-sandbox-ui-for-ui-e2e-tests@add_actions_to_ui_e2e_tests
73+
if: ${{ github.event.comment == '' }}
74+
with:
75+
quay-token: ${{ secrets.TEST_QUAY_TOKEN }}
76+
quay-namespace: codeready-toolchain-test
77+
sha: ${{ github.event.pull_request.head.sha }}
78+
pr-number: ${{ github.event.pull_request.number }}
79+
author: ${{ github.event.pull_request.head.user.login }}
80+
gh-head-ref: ${{ github.event.pull_request.head.ref }}
81+
82+
# Execute composite action using values from PR event
83+
# Is executed only for comment events - in that case the pull_request field is empty
84+
- name: Publish current Developer Sandbox UI image
85+
uses: rsoaresd/toolchain-cicd/publish-sandbox-ui-for-ui-e2e-tests@add_actions_to_ui_e2e_tests
86+
if: ${{ github.event.pull_request == '' }}
87+
with:
88+
quay-token: ${{ secrets.TEST_QUAY_TOKEN }}
89+
quay-namespace: codeready-toolchain-test
90+
sha: ${{ fromJson(steps.request.outputs.data).head.sha }}
91+
pr-number: ${{ fromJson(steps.request.outputs.data).number }}
92+
author: ${{ fromJson(steps.request.outputs.data).head.user.login }}
93+
gh-head-ref: ${{ fromJson(steps.request.outputs.data).head.ref }}

make/sandbox-ui.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,11 +176,11 @@ e2e-run-sandbox-ui:
176176

177177
.PHONY: test-ui-e2e
178178
test-ui-e2e:
179-
$(MAKE) prepare-and-deploy-e2e deploy-sandbox-ui e2e-run-sandbox-ui DEPLOY_LATEST=true ENVIRONMENT=${UI_ENVIRONMENT}
179+
$(MAKE) prepare-and-deploy-e2e deploy-sandbox-ui e2e-run-sandbox-ui ENVIRONMENT=${UI_ENVIRONMENT}
180180

181181
.PHONY: test-ui-e2e-local
182182
test-ui-e2e-local:
183-
$(MAKE) prepare-and-deploy-e2e deploy-sandbox-ui e2e-run-sandbox-ui RHDH_PLUGINS_DIR=${PWD}/../rhdh-plugins DEPLOY_LATEST=true ENVIRONMENT=${UI_ENVIRONMENT}
183+
$(MAKE) prepare-and-deploy-e2e deploy-sandbox-ui e2e-run-sandbox-ui RHDH_PLUGINS_DIR=${PWD}/../rhdh-plugins ENVIRONMENT=${UI_ENVIRONMENT}
184184

185185

186186
UNIT_TEST_IMAGE_NAME=sandbox-ui-e2e-tests

scripts/ci/manage-host-operator.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,16 +110,22 @@ if [[ -n "${CI}${REG_REPO_PATH}${HOST_REPO_PATH}" ]] && [[ $(echo ${REPO_NAME} |
110110
if [[ ${PUBLISH_OPERATOR} == "true" ]]; then
111111
push_image
112112
OPERATOR_IMAGE_LOC=${IMAGE_LOC}
113-
make -C ${REPOSITORY_PATH} publish-current-bundle INDEX_IMAGE_TAG=${BUNDLE_AND_INDEX_TAG} BUNDLE_TAG=${BUNDLE_AND_INDEX_TAG} QUAY_NAMESPACE=${QUAY_NAMESPACE} OTHER_REPO_PATH=${REG_REPO_PATH} OTHER_REPO_IMAGE_LOC=${REG_SERV_IMAGE_LOC} IMAGE=${OPERATOR_IMAGE_LOC}
113+
make -C ${REPOSITORY_PATH} publish-current-bundle INDEX_IMAGE_NAME=${REPO_NAME_FOR_IMAGE}-index INDEX_IMAGE_TAG=${BUNDLE_AND_INDEX_TAG} BUNDLE_TAG=${BUNDLE_AND_INDEX_TAG} QUAY_NAMESPACE=${QUAY_NAMESPACE} OTHER_REPO_PATH=${REG_REPO_PATH} OTHER_REPO_IMAGE_LOC=${REG_SERV_IMAGE_LOC} IMAGE=${OPERATOR_IMAGE_LOC}
114114
fi
115115
else
116116
INDEX_IMAGE_LOC="quay.io/codeready-toolchain/host-operator-index:latest"
117+
if [[ "${ENVIRONMENT}" == "ui-e2e-tests" ]]; then
118+
INDEX_IMAGE_LOC="quay.io/codeready-toolchain/host-operator-ui-e2e-tests-index:latest"
119+
fi
117120
fi
118121

119122
if [[ ${INSTALL_OPERATOR} == "true" ]]; then
120123
OPERATOR_RESOURCE_NAME=host-operator
121124
OPERATOR_NAME=toolchain-host-operator
122125
INDEX_IMAGE_NAME=host-operator-index
126+
if [[ "${ENVIRONMENT}" == "ui-e2e-tests" ]]; then
127+
INDEX_IMAGE_NAME=host-operator-ui-e2e-tests-index
128+
fi
123129
NAMESPACE=${HOST_NS}
124130
EXPECT_CRD=toolchainconfigs.toolchain.dev.openshift.com
125131
install_operator

scripts/ci/manage-member-operator.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,17 +98,23 @@ if [[ -n "${CI}${MEMBER_REPO_PATH}" ]] && [[ $(echo ${REPO_NAME} | sed 's/"//g')
9898
push_image
9999

100100
OPERATOR_IMAGE_LOC=${IMAGE_LOC}
101-
make -C ${REPOSITORY_PATH} publish-current-bundle INDEX_IMAGE_TAG=${BUNDLE_AND_INDEX_TAG} BUNDLE_TAG=${BUNDLE_AND_INDEX_TAG} QUAY_NAMESPACE=${QUAY_NAMESPACE} IMAGE=${OPERATOR_IMAGE_LOC}
101+
make -C ${REPOSITORY_PATH} publish-current-bundle INDEX_IMAGE_NAME=${REPO_NAME_FOR_IMAGE}-index INDEX_IMAGE_TAG=${BUNDLE_AND_INDEX_TAG} BUNDLE_TAG=${BUNDLE_AND_INDEX_TAG} QUAY_NAMESPACE=${QUAY_NAMESPACE} IMAGE=${OPERATOR_IMAGE_LOC}
102102
fi
103103
else
104104
INDEX_IMAGE_LOC="quay.io/codeready-toolchain/member-operator-index:latest"
105+
if [[ "${ENVIRONMENT}" == "ui-e2e-tests" ]]; then
106+
INDEX_IMAGE_LOC="quay.io/codeready-toolchain/member-operator-ui-e2e-tests-index:latest"
107+
fi
105108
fi
106109

107110

108111
if [[ ${INSTALL_OPERATOR} == "true" ]]; then
109112
OPERATOR_RESOURCE_NAME=member-operator
110113
OPERATOR_NAME=toolchain-member-operator
111114
INDEX_IMAGE_NAME=member-operator-index
115+
if [[ "${ENVIRONMENT}" == "ui-e2e-tests" ]]; then
116+
INDEX_IMAGE_NAME=member-operator-ui-e2e-tests-index
117+
fi
112118
NAMESPACE=${MEMBER_NS}
113119
EXPECT_CRD=memberoperatorconfigs.toolchain.dev.openshift.com
114120
install_operator

scripts/ci/manage-operator.sh

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,18 @@ set_tags() {
4646

4747
push_image() {
4848
GIT_COMMIT_ID=$(git --git-dir=${REPOSITORY_PATH}/.git --work-tree=${REPOSITORY_PATH} rev-parse --short HEAD)
49-
IMAGE_LOC=quay.io/codeready-toolchain/${REPOSITORY_NAME}:${GIT_COMMIT_ID}
49+
50+
REPO_NAME_FOR_IMAGE=${REPOSITORY_NAME}
51+
# Use different repository name for ui-e2e-tests environment
52+
if [[ "${ENVIRONMENT}" == "ui-e2e-tests" ]]; then
53+
REPO_NAME_FOR_IMAGE="${REPOSITORY_NAME}-ui-e2e-tests"
54+
fi
55+
56+
IMAGE_LOC=quay.io/codeready-toolchain/${REPO_NAME_FOR_IMAGE}:${GIT_COMMIT_ID}
5057
if is_provided_or_paired; then
5158
IMAGE_BUILDER=${IMAGE_BUILDER:-"podman"}
5259
make -C ${REPOSITORY_PATH} ${IMAGE_BUILDER}-push QUAY_NAMESPACE=${QUAY_NAMESPACE} IMAGE_TAG=${TAGS}
53-
IMAGE_LOC=quay.io/${QUAY_NAMESPACE}/${REPOSITORY_NAME}:${TAGS}
60+
IMAGE_LOC=quay.io/${QUAY_NAMESPACE}/${REPO_NAME_FOR_IMAGE}:${TAGS}
5461
fi
5562
}
5663

0 commit comments

Comments
 (0)