Skip to content

fix(ci): backport CI flakiness fixes to stable-8.2 - #13516

Merged
mmattel merged 12 commits into
stable-8.2from
backport/stable-8.2-ci-flakiness-fixes
Nov 18, 2026
Merged

mmattel merged 12 commits into
stable-8.2from
backport/stable-8.2-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.2.

Cherry-picked commits:

Conflict resolutions specific to stable-8.2

  • HttpRequestHelper.php: removed $retryOn5xxForK8s && guard (parameter doesn't exist in this branch)
  • bun.lock: removed via git rm (file doesn't exist in stable branches)
  • ocis.go / errors.go: took incoming (adds core services readyz check and IsErrRange() function)
  • expected-failures-localAPI-on-OCIS-storage.md: removed entries fixed by bleve compiler fix
  • .trivyignore: took incoming (fixes line endings, adds picomatch CVE-2026-112366 entry)

Test plan

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

🤖 Generated with Claude Code

* 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>
@mmattel
mmattel requested a review from a team as a code owner November 18, 2026 09:25
@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
deyankiteworks
deyankiteworks previously approved these changes Nov 18, 2026
The cherry-pick of #13493 added a call to waitServiceReady() in
waitAllServices() but the function definition was not present in this
branch (it was introduced on master alongside the call site). Add the
definition to restore compilation.

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

Signed-off-by: Martin Mattel <github@diemattels.at>
@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.

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>
2403905
2403905 previously approved these changes Nov 18, 2026
…okup

stable-8.2'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>
@mmattel
mmattel merged commit 2b8203b into stable-8.2 Nov 18, 2026
75 checks passed
@mmattel
mmattel deleted the backport/stable-8.2-ci-flakiness-fixes branch November 18, 2026 14:52
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.

5 participants