Skip to content

fix(ci): backport CI flakiness fixes to stable-8.1 - #13515

Closed
mmattel wants to merge 12 commits into
stable-8.1from
backport/stable-8.1-ci-flakiness-fixes
Closed

mmattel wants to merge 12 commits into
stable-8.1from
backport/stable-8.1-ci-flakiness-fixes

Conversation

@mmattel

@mmattel mmattel commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

Summary

Consolidated backport of 9 CI flakiness fix PRs from master to stable-8.1.

Cherry-picked commits:

Conflict resolutions specific to stable-8.1

  • HttpRequestHelper.php: removed $retryOn5xxForK8s && guard (parameter doesn't exist in this branch)
  • SettingsHelper.php: used 3-argument getValuesList() call (no $headers param in this branch)
  • bun.lock: removed via git rm (file doesn't exist in stable branches)
  • expected-failures-localAPI-on-OCIS-storage.md: removed entries fixed by bleve compiler fix
  • run-e2e.py / run-github.py: took incoming vault storage, federation, collaboration, tika blocks
  • .trivyignore: took incoming (adds CVE-2026-116587 and CVE-2026-112366 entries)

Test plan

  • CI passes on this branch against stable-8.1 test suite

🤖 Generated with Claude Code

@kw-security

kw-security commented Nov 18, 2026 •

Copy link
Copy Markdown

✅ Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
✅ Open Source Security 0 0 0 0 0 issues
✅ Licenses 0 0 0 0 0 issues
✅ Code Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@mmattel
mmattel enabled auto-merge (squash) November 18, 2026 09:27
@mmattel

mmattel commented Nov 18, 2026

Copy link
Copy Markdown
Contributor Author

build-and-test failure — trivy-action version on stable-8.1

The build-and-test job fails immediately at setup with:

error: The action aquasecurity/setup-trivy@e6c2c5e... is not allowed in owncloud/ocis

Root cause

stable-8.1 is the only branch still on aquasecurity/trivy-action v0.35.0 (@57a97c7e...). That version internally calls aquasecurity/setup-trivy as a dependency, which is not on the org's GitHub Actions allowlist.

Every other active branch already uses v0.36.0 (@ed142fd0...), which does not have that dependency and passes the allowlist check:

Branch trivy-action SHA Version
master ed142fd0... v0.36.0 ✅
stable-8.0 ed142fd0... v0.36.0 ✅
stable-8.1 57a97c7e... v0.35.0 ❌
stable-8.2 ed142fd0... v0.36.0 ✅
stable-9.0 ed142fd0... v0.36.0 ✅

This is a pre-existing issue on the stable-8.1 base branch — it is not caused by the cherry-picks in this PR.

Options to fix

Option A — Separate PR on stable-8.1 (recommended)
Open a small standalone PR against stable-8.1 that bumps .github/workflows/acceptance-tests.yml line 115 from:

uses: aquasecurity/trivy-action@57a97c7e7821a5776cebc9bb87c984fa69cba8f1 # v0.35.0

to:

uses: aquasecurity/trivy-action@ed142fd0673e97e23eac54620cfb913e5ce36c25 # v0.36.0

Once that merges, re-trigger CI on this PR. The fix is tracked independently and doesn't conflate it with the flakiness backport.

Option B — Add the fix as an extra commit on this PR
Add the same one-line SHA bump as an additional commit here. CI passes immediately and everything lands in one merge. Slightly muddies the commit history of this backport PR.

Option C — Ask an org admin to extend the allowlist
Add aquasecurity/setup-trivy@e6c2c5e321ed9123bda567646e2f96565e34abe1 to the org's GitHub Actions allowed-actions list. This unblocks any future v0.35.x usage but requires admin access and is addressing a symptom rather than the outdated SHA.

@mmattel

mmattel commented Nov 18, 2026

Copy link
Copy Markdown
Contributor Author

Note: #13519 (fix(ci): disable async uploads in litmus runner to prevent 425 Too Early) should also be cherry-picked onto this branch once it merges on master. It was discovered via the litmus failure on the stable-9.0 backport (#13517) and affects all stable branches equally.

@mmattel

mmattel commented Nov 18, 2026

Copy link
Copy Markdown
Contributor Author

Triggering CI re-run after #13520 merged.

* fix(tests): retry activity listing step when response is empty

The When step that lists activities for a resource queried the Graph API
in a single shot. Activities are written asynchronously via NATS, so the
event had sometimes not been processed yet when the query arrived. This
caused a spurious minItems assertion failure in apiActivities scenarios.

The step now retries up to ten times with a 500 ms interval whenever the
API returns HTTP 200 with an empty value array, matching the existing
retry pattern used by the share-listing step.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

Signed-off-by: Martin Mattel <github@diemattels.at>

* fix(tests): avoid JsonException for non-200 responses in activity retry loop

The retry loop called getJsonDecodedResponseBodyContent() unconditionally
before checking the status code. When the activities API returns a non-200
response (e.g. 403 with a non-JSON body), the decode threw a JsonException
causing the When step to fail before the Then status-code assertion could run.

PHP's && short-circuits, so moving the decode into the right-hand side of
the isEmpty condition means it is only called when status is 200.

Fixes shareActivities.feature:1901 (sharee tries to check activities of a
shared folder using file-id).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

Signed-off-by: Martin Mattel <github@diemattels.at>

* fix(tests): address review — add [INFO] prefix, remove changelog

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

Signed-off-by: Martin Mattel <github@diemattels.at>

---------

Signed-off-by: Martin Mattel <github@diemattels.at>
…se (#13482)

Signed-off-by: Martin Mattel <github@diemattels.at>
…3483)

* fix(tests): retry 5xx responses in Given steps after oCIS restart

After a Background step reconfigures oCIS the server restarts. The
readiness probe passes before the storage layer is fully initialised,
so the first Given step request (e.g. MKCOL) may receive 502 Bad
Gateway and fail spuriously.

The existing 5xx retry in HttpRequestHelper::sendRequest was guarded
behind OcisConfigHelper::isK8s() and therefore did not apply in
Docker/ociswrapper CI environments. Extend it to cover any Given step
that receives a 5xx (except 507 Insufficient Storage) regardless of
deployment type.

Fixes the flaky apiAsyncUpload/delayPostprocessing.feature failure
observed in the natsJwt-events-stores-file suite.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

Signed-off-by: Martin Mattel <github@diemattels.at>

* fix(tests): fix phpcs style in HttpRequestHelper multi-line if

The closing parenthesis of the multi-line if condition must be on its
own line per the project's phpcs ruleset.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

Signed-off-by: Martin Mattel <github@diemattels.at>

* fix(tests): address review — scope retry, merge blocks, reset sendExceptionHappened

- Remove changelog: tests-only change does not need a release entry
- Merge the separate isGivenStep 5xx block into the existing retryOn5xxForK8s
  block by widening the condition to isK8s() || isGivenStep. This avoids
  double-retrying on K8s and respects the retryOn5xxForK8s opt-out used by
  callers with their own retry loops (e.g. searchWithRetry)
- Limit Given-step retry (non-K8s) to 502/503/504 only. Retrying all 5xx
  would mask real 500s and a POST/PUT that slipped through on 500 would
  produce a 409 on retry that is not retried, failing with the wrong error
- Reset $sendExceptionHappened = false when looping on 5xx so a subsequent
  409 (e.g. user-just-created race after a restart) can still be retried

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

Signed-off-by: Martin Mattel <github@diemattels.at>

* fix(tests): split long lines to stay within 120-char limit

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

Signed-off-by: Martin Mattel <github@diemattels.at>

---------

Signed-off-by: Martin Mattel <github@diemattels.at>
…omponent (#13486)

* fix(ci): ignore CVE-2026-118664 in Trivy scan (false positive)

decode-uri-component in vendor/github.com/libregraph/lico/identifier/bun.lock
is flagged as 0.5.0 (vulnerable), but that version comes from the bun.lock
"overrides" floor constraint, not the actual resolved package. The packages
section of the same lockfile resolves decode-uri-component to 0.5.1, which
is the fixed version. Trivy misreads the override requirement as the installed
version — this is a false positive.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

Signed-off-by: Martin Mattel <github@diemattels.at>

* fix(ci): skip vendored bun.lock in Trivy scan for CVE-2026-118664

lico v0.69.0 vendors decode-uri-component@0.5.0 (CVE-2026-118664, HIGH) in
identifier/bun.lock. This lockfile is never installed or built by ocis — it
is only carried along with lico's Go package. Trivy correctly detects the
vulnerable version; the finding is accepted because the code is not reachable.

Scope the ignore to the file path in .trivy.yaml (vendor/**/bun.lock) rather
than a bare CVE ID in .trivyignore, which would also suppress the CVE if it
appeared in web/pnpm-lock.yaml.

Also reverts the hand-edit from #13380 that bumped decode-uri-component to
0.5.1 in vendor: go mod vendor reverts it to 0.5.0 anyway (as seen in #13479),
so the hand-edit was misleading. Proper fix is bumping the dep in lico upstream.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

Signed-off-by: Martin Mattel <github@diemattels.at>

---------

Signed-off-by: Martin Mattel <github@diemattels.at>
…ic (#13493)

Signed-off-by: Martin Mattel <github@diemattels.at>
…r output (#13503)

Go's net/http server logs "TLS handshake error from <addr>: ..." to stderr
whenever a client connects to an HTTPS port but abandons the handshake before
it completes. In acceptance test runs this fires routinely (health-check
probes, Playwright browser init, curl readiness polls) and can produce
hundreds of harmless lines that push real errors far down the CI log.

Five Python test-runner scripts (run-github.py, run-litmus.py, run-cs3api.py,
run-wopi.py) now attach a daemon thread to each long-lived ocis/ociswrapper
subprocess that reads stderr line-by-line, drops any line containing
"TLS handshake error", and forwards everything else unchanged.

The two Bash scripts (ldap-smoke/run.sh, ldap-smoke-distributed/run.sh) use
a process substitution (2> >(grep -v "TLS handshake error" >&2)) for the
same effect without requiring a temporary log file.

The equivalent fix for run-e2e.py is tracked in PR #13498.

Signed-off-by: Martin Mattel <github@diemattels.at>
#13504)

Signed-off-by: Martin Mattel <github@diemattels.at>
…13509)

picomatch 4.0.5 / 4.0.7 land in web/pnpm-lock.yaml as transitive
build-time deps of vite (vite → tinyglobby → fdir → picomatch).
They are never compiled into or shipped with the browser bundle.

CVE-2026-112366 is a DoS triggered by crafted repeated extglob
patterns. Picomatch is only fed patterns from our own trusted vite
config, so the vulnerable code path is unreachable without a prior
full compromise of the repository. No fixed 4.x release exists yet.

Add to .trivyignore until upstream ships a patched version and the
vite dependency chain (fdir / tinyglobby) adopts it.

Signed-off-by: Martin Mattel <github@diemattels.at>
The cherry-pick of #13498 added usages of vault_storage_needed but
missed the variable definition (and the keycloak_needed update that
includes it). Add both, matching master.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

Signed-off-by: Martin Mattel <github@diemattels.at>
@deyankiteworks
deyankiteworks force-pushed the backport/stable-8.1-ci-flakiness-fixes branch from 6445a5f to d0d44ee Compare November 18, 2026 11:24
Signed-off-by: Martin Mattel <github@diemattels.at>
…okup

stable-8.1's config.go uses "storage-users" and "storage-shares" (with
hyphens), while the coreServices list cherry-picked from master used the
compacted forms ("storageusers", "storageshares"). GetServiceDebugPort()
returned 0 for the compacted names, causing waitServiceReady to timeout
on port 0 for every test suite.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

Signed-off-by: Martin Mattel <github@diemattels.at>
@LukasHirt

Copy link
Copy Markdown
Contributor

stable-8.1 is no longer maintained.

@LukasHirt LukasHirt closed this Nov 18, 2026
auto-merge was automatically disabled November 18, 2026 19:15

Pull request was closed

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