Skip to content

test(e2e): strip ETag If-None-Match at the network layer - #30371

Merged
chirag-madlani merged 3 commits into
mainfrom
fix/etag-strip-conditional-reads-network-layer
Jul 23, 2026
Merged

chirag-madlani merged 3 commits into
mainfrom
fix/etag-strip-conditional-reads-network-layer

Conversation

@ShaileshParmar11

@ShaileshParmar11 ShaileshParmar11 commented Jul 23, 2026 •

Copy link
Copy Markdown
Contributor

Why

#30239 / #30292 added a localStorage opt-out so E2E sessions skip client-side conditional (If-None-Match) reads. That only works when the running UI bundle contains the interceptor guard.

In the upgrade AUT (1.11.13 ➡ main) it doesn't help. Trace evidence from a failing run (TestSuiteMultiPipeline):

  • The flag is written correctly — storageState has OM_DISABLE_ETAG_CONDITIONAL_READS: "true" under the app origin.
  • Yet the served bundle (index-DWyuxoxX.js) still sends If-None-Match; the response comes back Content-Length: 0 (304) and the UI renders a stale body.
  • The conditional request is client-JS-set (the response is no-store, so the browser would never revalidate; 1.11.13's UI has no interceptor at all).

So the guard is not taking effect in the deployed bundle, and a UI-side opt-out can't be relied on there.

Change

Strip If-None-Match on /api/v1/** at the Playwright network layer:

await page.route('**/api/v1/**', (route) => {
  const headers = route.request().headers();
  delete headers['if-none-match'];
  return route.continue({ headers });
});

This sits below the app, so it works regardless of which bundle runs or whether its guard fires — the server always receives an unconditional GET and returns the current body, and the interceptor's 200-branch overwrites its own cache with fresh data.

Installed once per page (WeakSet-guarded) from redirectToHomePage. Every ETag-affected failing spec routes through it (2–13× each), and createNewPage calls it too. Kept alongside the existing localStorage opt-out as defense in depth.

Validation

  • CustomMetric + FollowingWidget (12 entity types) pass with the strip installed — auth and reads work fine through route.continue.
  • Checkstyle clean (eslint exit 0, prettier clean).

Honest limitation: the underlying failure is a same-session refetch race that only manifests under AUT load — it does not reproduce locally (local reloads clear the interceptor's in-memory cache). So I can prove the strip is installed and non-breaking, but the end-to-end proof for the stale-read case is the next AUT run. The mechanism itself is HTTP-guaranteed: no If-None-Match → fresh 200.

Scope

Test-only; unblocks AUT. The underlying product defect — the ETag being derived from version/updatedAt only, so it ignores requested fields and child state — remains open and tracked separately.

🤖 Generated with Claude Code

Greptile Summary

This PR disables conditional ETag reads in Playwright API traffic. The main changes are:

  • Adds a shared route handler that removes If-None-Match from /api/v1/** requests.
  • Installs the handler during home-page navigation and page creation.
  • Extends the handler to role fixtures, glossary tests, and Search RBAC tests.
  • Retains the local-storage opt-out as an additional safeguard.

Confidence Score: 5/5

No additional blocking issue qualifies for this follow-up review.

  • The latest changes broaden where the network handler is installed.
  • No separate production failure remains after excluding issues already covered by the existing review feedback.

Important Files Changed

Filename Overview
openmetadata-ui/src/main/resources/ui/playwright/utils/common.ts Adds the shared ETag header-removal route and installs it before home-page navigation.
openmetadata-ui/src/main/resources/ui/playwright/e2e/fixtures/pages.ts Centralizes role-page creation and installs the ETag route before fixture use.
openmetadata-ui/src/main/resources/ui/playwright/support/fixtures/userPages.ts Installs the ETag route on each role-specific fixture page.
openmetadata-ui/src/main/resources/ui/playwright/e2e/Flow/SearchRBAC.spec.ts Uses a shared helper to install the ETag route on newly created RBAC test pages.

Reviews (3): Last reviewed commit: "test(e2e): strip If-None-Match on specs ..." | Re-trigger Greptile

Context used (3)

  • Context used - openmetadata-ui-core-components/CLAUDE.md (source)
  • Context used - CLAUDE.md (source)
  • Context used - AGENTS.md (source)

The localStorage opt-out from #30239/#30292 only works when the running UI
bundle contains the interceptor guard. In the upgrade AUT (1.11.13 -> main) the
served bundle does not evaluate the guard, so the client still sends
If-None-Match, the server answers 304, and the UI renders a stale body — the
flaky-assertion source persists.

Strip the If-None-Match header on /api/v1/** at the Playwright network layer
instead. This sits below the app, so it works regardless of which bundle runs
or whether its guard fires: the server always receives an unconditional GET and
returns the current body. Installed once per page (WeakSet-guarded) from
redirectToHomePage, which every affected spec routes through (createNewPage
calls it too).

Kept alongside the existing localStorage opt-out as defense in depth.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@ShaileshParmar11
ShaileshParmar11 requested a review from a team as a code owner July 23, 2026 05:59
Copilot AI review requested due to automatic review settings July 23, 2026 05:59

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions

Copy link
Copy Markdown
Contributor

❌ PR checklist incomplete

This PR cannot be merged until the following are addressed on its linked issue:

  • No GitHub issue is linked. Link an issue in the Development section of the PR (or add Fixes #12345 to the description). For a same-org cross-repo issue, add Fixes open-metadata/<repo>#123 to the description.

The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically.

Maintainers can bypass this check by adding the skip-pr-checks label.

@github-actions github-actions Bot added safe to test Add this label to run secure Github workflows on PRs UI UI specific issues labels Jul 23, 2026
redirectToHomePage covers specs that call it, but ~79 specs get their page from
the fixtures/pages and support/fixtures/userPages fixtures without going through
it. Install stripEtagConditionalReads on those role pages too, so fixture-based
specs get fresh entity reads regardless of the deployed bundle.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 23, 2026 06:22

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions

github-actions Bot commented Jul 23, 2026 •

Copy link
Copy Markdown
Contributor

🔴 Playwright Results — 9 test failure(s), 3 pipeline/setup failure(s)

✅ 4508 passed · ❌ 9 failed · 🟡 32 flaky · ⏭️ 98 skipped

Pipeline and setup failures

  • Shard 2 did not upload a usable Playwright results artifact.
  • Shard 2 failed during setupEnvironment setup.
  • Shard 2 test execution finished with status skipped without a reported test failure.
Shard Passed Failed Flaky Skipped
🟡 Shard 1 434 0 6 16
⛔ Shard 2 — — — —
🟡 Shard 3 822 0 9 8
🔴 Shard 4 808 8 4 18
🔴 Shard 5 824 1 5 8
🟡 Shard 6 831 0 2 46
🟡 Shard 7 789 0 6 2

Genuine Failures (failed on all attempts)

❌ Features/OntologyExplorerRdf.spec.ts › Turtle (.ttl) option appears in the export menu when RDF is enabled (shard 4)
Error: �[2mexpect(�[22m�[31mlocator�[39m�[2m).�[22mtoBeVisible�[2m(�[22m�[2m)�[22m failed

Locator: getByText('Turtle (.ttl)', { exact: true })
Expected: visible
Timeout: 15000ms
Error: element(s) not found

Call log:
�[2m  - Expect "toBeVisible" with timeout 15000ms�[22m
�[2m  - waiting for getByText('Turtle (.ttl)', { exact: true })�[22m

❌ Features/OntologyExplorerRdf.spec.ts › RDF/XML (.rdf) option appears in the export menu when RDF is enabled (shard 4)
Error: �[2mexpect(�[22m�[31mlocator�[39m�[2m).�[22mtoBeVisible�[2m(�[22m�[2m)�[22m failed

Locator: getByText('RDF/XML (.rdf)', { exact: true })
Expected: visible
Timeout: 15000ms
Error: element(s) not found

Call log:
�[2m  - Expect "toBeVisible" with timeout 15000ms�[22m
�[2m  - waiting for getByText('RDF/XML (.rdf)', { exact: true })�[22m

❌ Features/OntologyExplorerRdf.spec.ts › Turtle export triggers a .ttl file download (shard 4)
�[31mTest timeout of 60000ms exceeded.�[39m
❌ Features/OntologyExplorerRdf.spec.ts › RDF/XML export triggers a .rdf file download (shard 4)
�[31mTest timeout of 60000ms exceeded.�[39m
❌ Features/OntologyExplorerRdf.spec.ts › term Relations Graph requests /rdf/glossary/graph scoped to the selected term (glossaryTermId) when RDF is enabled (shard 4)
�[31mTest timeout of 60000ms exceeded.�[39m
❌ Features/OntologyExplorerRdf.spec.ts › glossary Relations Graph calls /rdf/glossary/graph when RDF is enabled and renders nodes from the response (shard 4)
Error: GET /rdf/glossary/graph must be called on the glossary Relations Graph when RDF is enabled

�[2mexpect(�[22m�[31mreceived�[39m�[2m).�[22mtoBe�[2m(�[22m�[32mexpected�[39m�[2m) // Object.is equality�[22m

Expected: �[32mtrue�[39m
Received: �[31mfalse�[39m
❌ Features/ServiceAgentsPauseResume.spec.ts › should pause an enabled agent and offer resume afterwards (shard 4)
Error: �[2mexpect(�[22m�[31mlocator�[39m�[2m).�[22mtoBeVisible�[2m(�[22m�[2m)�[22m failed

Locator: getByTestId('resume-button')
Expected: visible
Timeout: 15000ms
Error: element(s) not found

Call log:
�[2m  - Expect "toBeVisible" with timeout 15000ms�[22m
�[2m  - waiting for getByTestId('resume-button')�[22m

❌ Features/ServiceAgentsPauseResume.spec.ts › should resume a paused agent and offer pause afterwards (shard 4)
Error: �[2mexpect(�[22m�[31mlocator�[39m�[2m).�[22mtoBeVisible�[2m(�[22m�[2m)�[22m failed

Locator: getByTestId('resume-button')
Expected: visible
Timeout: 15000ms
Error: element(s) not found

Call log:
�[2m  - Expect "toBeVisible" with timeout 15000ms�[22m
�[2m  - waiting for getByTestId('resume-button')�[22m

❌ Flow/PersonaFlow.spec.ts › Set default persona for team should work properly (shard 5)
Error: �[2mexpect(�[22m�[31mlocator�[39m�[2m).�[22mtoContainText�[2m(�[22m�[32mexpected�[39m�[2m)�[22m failed

Locator: getByTestId('default-persona-chip')
Expected substring: �[32m"No default persona"�[39m
Received string:    �[31m"persona 675b4001"�[39m
Timeout: 15000ms

Call log:
�[2m  - Expect "toContainText" with timeout 15000ms�[22m
�[2m  - waiting for getByTestId('default-persona-chip')�[22m
�[2m    19 × locator resolved to <div data-testid="default-persona-chip" class="user-profile-card-body default-persona-text ml-8 d-flex items-center gap-2">…</div>�[22m
�[2m       - unexpected value "persona 675b4001"�[22m

🟡 32 flaky test(s) (passed on retry)
  • Features/Pagination.spec.ts › should test pagination on Observability Alerts page (shard 1, 1 retry)
  • Features/TagsSuggestion.spec.ts › should add and accept requested tags for a table asset (shard 1, 1 retry)
  • Flow/TestConnectionModal.spec.ts › modal opens with gate card and capability checks sections (shard 1, 1 retry)
  • Pages/Lineage/LineageRightPanel.spec.ts › Verify custom properties tab IS visible for supported type: chart (shard 1, 1 retry)
  • Pages/SearchSettings.spec.ts › Latest preview config wins when a superseded request resolves late (shard 1, 1 retry)
  • Flow/SearchRBAC.spec.ts › the browse tree only shows the asset-type categories a user can access (shard 1, 1 retry)
  • Features/BulkEditOperationBadges.spec.ts › Glossary bulk edit search filters rows and clear restores them (shard 3, 1 retry)
  • Features/ContextCenterArchive.spec.ts › full document lifecycle: folder expand icon, upload, delete, restore, and permanent delete (shard 3, 1 retry)
  • Features/ContextCenterArticles.spec.ts › Article listing search filters, clears, and shows empty state (shard 3, 1 retry)
  • Features/ContextCenterArticles.spec.ts › Article edit persistence and unsaved title behavior are correct (shard 3, 2 retries)
  • Features/ContextCenterArticles.spec.ts › Text formatting (shard 3, 1 retry)
  • Features/ContextCenterMemories.spec.ts › clearing search restores the unfiltered list (shard 3, 1 retry)
  • Features/ContextCenterMemories.spec.ts › data consumer sees a read-only modal for shared memories they do not own (shard 3, 1 retry)
  • Features/DataQuality/BundleSuiteBulkOperations.spec.ts › Create new Bundle Suite with bulk selected test cases (shard 3, 1 retry)
  • Features/DataQuality/ProfilerIngestionForm.spec.ts › switching DYNAMIC → STATIC does not leak smartSampling or thresholds (shard 3, 1 retry)
  • Features/MetricBulkImportExportEdit.spec.ts › MetricListPage unchecking header checkbox clears the selection bar (shard 4, 1 retry)
  • Features/OntologyExplorerRdf.spec.ts › renders without crashing when /rdf/glossary/graph returns duplicate nodes and dangling edges (shard 4, 1 retry)
  • Features/Permission.spec.ts › Permissions (shard 4, 1 retry)
  • Features/SearchSeparation/SearchSeparationSuite.ts › live indexing produces searchable separation for all four facets (shard 4, 1 retry)
  • Flow/CustomizeWidgets.spec.ts › My Tasks Widget (shard 5, 1 retry)
  • Flow/PersonaFlow.spec.ts › Set and remove default persona should work properly (shard 5, 1 retry)
  • Pages/CustomProperties.spec.ts › Should clear search and show all properties for metric in right panel (shard 5, 1 retry)
  • Pages/CustomProperties.spec.ts › Should search custom properties for apiEndpoint in right panel (shard 5, 1 retry)
  • Pages/DataContractsSemanticRules.spec.ts › Validate Description Rule Is_Not_Set (shard 5, 1 retry)
  • Pages/DomainAdvanced.spec.ts › Remove multiple assets from domain at once (shard 6, 1 retry)
  • Pages/Entity.spec.ts › Tier Add, Update and Remove (shard 6, 1 retry)
  • Pages/Glossary.spec.ts › Approve and reject glossary term from Glossary Listing (shard 7, 1 retry)
  • Pages/Glossary.spec.ts › Drag and Drop Glossary Term (shard 7, 1 retry)
  • Pages/Lineage/LineageFilters.spec.ts › Verify Impact Analysis service filter selection (shard 7, 1 retry)
  • Pages/Lineage/LineageRightPanel.spec.ts › Verify custom properties tab is NOT visible for pipelineService in platform lineage (shard 7, 1 retry)
  • ... and 2 more

📦 Download artifacts

How to debug locally
# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip    # view trace

The network-layer ETag strip was reached via redirectToHomePage and the
role fixtures. These specs bypass both — the 3 Glossary status-filter specs
use the built-in `page` fixture (navigating in their own beforeEach) and
SearchRBAC creates raw `browser.newPage()` contexts. Install
stripEtagConditionalReads directly at those page-acquisition points so every
failing spec is reachable by the fix regardless of how it obtains its page.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 23, 2026 06:51

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@chirag-madlani
chirag-madlani merged commit 8b4d2c9 into main Jul 23, 2026
52 of 57 checks passed
@chirag-madlani
chirag-madlani deleted the fix/etag-strip-conditional-reads-network-layer branch July 23, 2026 09:15
@gitar-bot

gitar-bot Bot commented Jul 23, 2026

Copy link
Copy Markdown
Code Review ✅ Approved

Strips If-None-Match headers on API requests at the Playwright network layer to prevent stale reads in E2E tests. No issues found.

Options

Display: compact → Showing less information.

Comment with these commands to change the behavior for this request:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

This branch was previously deployed

1 inactive deployment
test — 727a0571 Deployed Jul 23, 2026 by ShaileshParmar11 via playwright-ci-postgresql (3, 7) #57949
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

safe to test Add this label to run secure Github workflows on PRs UI UI specific issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants