Skip to content

Commit 14d9564

Browse files
authored
CLOUD-882: Add e2e-tests release_versions image availability check (#2289)
* CLOUD-882: Add e2e-tests release_versions image availability check * Update e2e-tests/release_versions in e2eignore * Fix e2eignore pattern
1 parent 265db79 commit 14d9564

3 files changed

Lines changed: 46 additions & 3 deletions

File tree

.e2eignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ README.md
77
LICENSE
88
operator.png
99
kubernetes.svg
10-
release_versions
10+
e2e-tests/release_versions
1111
.github/**
1212
.e2eignore

.github/workflows/reviewdog.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,3 +105,43 @@ jobs:
105105
run: |
106106
make generate manifests VERSION=main
107107
git diff --exit-code
108+
109+
e2e-release-versions-images:
110+
name: e2e-tests release_versions image availability
111+
runs-on: ubuntu-latest
112+
steps:
113+
- uses: actions/checkout@v6
114+
with:
115+
fetch-depth: 0
116+
- name: Check if e2e-tests/release_versions changed
117+
id: changed
118+
run: |
119+
git fetch origin ${{ github.base_ref }}
120+
if git diff --name-only origin/${{ github.base_ref }}...HEAD -- e2e-tests/release_versions | grep -q .; then
121+
echo "changed=true" >> "$GITHUB_OUTPUT"
122+
else
123+
echo "changed=false" >> "$GITHUB_OUTPUT"
124+
fi
125+
- name: Verify release_versions images exist (docker manifest inspect)
126+
if: steps.changed.outputs.changed == 'true'
127+
run: |
128+
set -e
129+
# All IMAGE_*=value lines, exclude operator image (percona/percona-server-mongodb-operator)
130+
images=$(grep -E '^IMAGE_[^=]+=' e2e-tests/release_versions | cut -d= -f2 | grep -v '^$' | grep -v 'percona/percona-server-mongodb-operator' | sort -u)
131+
if [ -z "$images" ]; then
132+
echo "No non-operator images found in e2e-tests/release_versions"
133+
exit 0
134+
fi
135+
failed=""
136+
for img in $images; do
137+
echo "Checking image $img"
138+
if ! docker manifest inspect "$img"; then
139+
echo "::error::Image not found or inaccessible: $img"
140+
failed="${failed} ${img}"
141+
fi
142+
done
143+
if [ -n "$failed" ]; then
144+
echo "::error::The following images failed docker manifest inspect:$failed"
145+
exit 1
146+
fi
147+
echo "All images are available."

Jenkinsfile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -394,13 +394,16 @@ void checkE2EIgnoreFiles() {
394394
echo "Excluded files: $excludedFiles"
395395
echo "Changed files: $changedFiles"
396396

397-
def excludedFilesRegex = excludedFiles.collect{it.replace("**", ".*").replace("*", "[^/]*")}
397+
// Use placeholder so the * in ".*" (from **) is not replaced by [^/]*
398+
def excludedFilesRegex = excludedFiles.collect{
399+
it.replace("**", ".__STARSTAR__").replace("*", "[^/]*").replace(".__STARSTAR__", ".*")
400+
}
398401
needToRunTests = !changedFiles.every{changed -> excludedFilesRegex.any{regex -> changed ==~ regex}}
399402

400403
if (needToRunTests) {
401404
echo "Some changed files are outside of the e2eignore list. Proceeding with execution."
402405
} else {
403-
if (currentBuild.previousBuild?.result != 'SUCCESS') {
406+
if (currentBuild.previousBuild?.result != 'SUCCESS' && currentBuild.number != 1) {
404407
echo "All changed files are e2eignore files, and previous build was unsuccessful. Propagating previous state."
405408
currentBuild.result = currentBuild.previousBuild?.result
406409
error "Skipping execution as non-significant changes detected and previous build was unsuccessful."

0 commit comments

Comments
 (0)