Skip to content

feat ✨(ui): Integrate new test connection flow - #1

Closed
Sachin-chaurasiya wants to merge 1 commit into
pmbrull:test-connection-bckfrom
open-metadata:ingestion-ui-test-connection
Closed

Sachin-chaurasiya wants to merge 1 commit into
pmbrull:test-connection-bckfrom
open-metadata:ingestion-ui-test-connection

Conversation

@Sachin-chaurasiya

Copy link
Copy Markdown

Describe your changes :

I worked on the ..... because ...

Type of change :

  • Bug fix
  • Improvement
  • New feature
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation

Frontend Preview (Screenshots) :

For frontend related change, please link screenshots of your changes preview! Optional for backend related changes.

Checklist:

  • I have read the CONTRIBUTING document.
  • I have performed a self-review of my own.
  • I have tagged my reviewers below.
  • I have commented on my code, particularly in hard-to-understand areas.
  • My changes generate no new warnings.
  • I have added tests that prove my fix is effective or that my feature works.
  • All new and existing tests passed.

Reviewers

@github-actions

Copy link
Copy Markdown

The Python checkstyle failed.

Please run make py_format and py_format_check in the root of your repository and commit the changes to this PR.
You can also use pre-commit to automate the Python code formatting.

You can install the pre-commit hooks with make install_test precommit_install.

@github-actions

Copy link
Copy Markdown

Jest test Coverage

UI tests summary

Lines Statements Branches Functions
Coverage: 52%
53.99% (19734/36554) 30.95% (7730/24978) 34.22% (2405/7028)

pmbrull added a commit that referenced this pull request Nov 12, 2024
* Improve parallelization in SearchIndexApp

* Improve parallelization in SearchIndexApp

* add countdown latch

* typo

* Status issues - #1

* Improve search indexing

* cleanup the code

* schemas

* Status Updates Via WebSockets

* Add Updates

* Make Logs Debug

* show duration in table

* add searchIndexApp params to openmetadata-ops.sh reindex commandline

* Fix code style

* Add Parallel Entity Level Reader

* Make code more readable

* Send App Run Record instead of jobData

* Sned App Run Record WebSocket for Data Insights

* ui: use socket connection to get the real-time updates of application data

* Send WebSocket Final Update

* ui: remove failedRecords, totalRecords and successRecordsfrom entities record

* Invert Condition

---------

Co-authored-by: mohitdeuex <[email protected]>
Co-authored-by: Pere Miquel Brull <[email protected]>
Co-authored-by: karanh37 <[email protected]>
Co-authored-by: Sachin Chaurasiya <[email protected]>
Co-authored-by: Mohit Yadav <[email protected]>
pmbrull pushed a commit that referenced this pull request Apr 23, 2026
…adata#27625) (open-metadata#27627)

* fix(ingestion): release Engine resources on database switch (open-metadata#27625)

* fix(ingestion): release engine resources on database switch

Close fairies in _connection_map and clear _inspector_map before
engine.dispose() in CommonDbSourceService.set_inspector/close. Dispose
alone does not free Inspector.info_cache or release checked-out
ConnectionFairies, leaving the old engine GC-pinned across DB switches
and triggering _finalize_fairy RecursionError at interpreter shutdown.

Eagerly fetch multi-DB name queries (MultiDBSource._execute_database_query
and SnowflakeSource.get_database_names_raw) so the cursor closes before
the caller invokes set_inspector, which disposes the engine the cursor
was bound to.

Also rebind scoped_session to the new engine so it doesn't keep the
disposed one alive via sessionmaker.bind.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

* py format

* fix(ingestion): address PR review feedback from gitar-bot and Copilot

- Set self.engine = None after dispose in _release_engine (gitar-bot):
  prevents close() from leaving a dangling disposed-engine reference
  that would produce a confusing pool error on accidental later access.

- _FakeSource now has close() and is wrapped in a fixture that cleans
  up its checked-out connection (Copilot #1): avoids resource warnings
  and an interfering fairy across test teardown.

- Rewrite test_generator_survives_engine_dispose_mid_iteration as
  test_generator_survives_connection_close_mid_iteration (Copilot open-metadata#2):
  Engine.dispose() does not close checked-out connections, so the old
  test did not reproduce what _release_engine actually does. The real
  regression is the explicit conn.close() on the fairy in
  _connection_map before dispose. The new test closes the connection
  mid-iteration, which is what fetchall() needs to survive.

- Switch the query in _FakeSource.get_database_names_raw and the
  seeded INSERT assertions to the TEXT name column (Copilot open-metadata#3):
  _execute_database_query is typed Iterable[str]; testing on integer
  ids obscured the actual contract.

- Update test_disposes_pool to assert surrogate.engine is None after
  release (follows from the new self.engine = None behavior) and
  verify the original pool's checkedout() is 0.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

---------

Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>

* fix(ingestion): keep connection_obj in sync with engine across DB switches

self.connection_obj is set once in __init__ to the initial engine and
never updated. After set_inspector rebuilds self.engine, connection_obj
still points at the disposed original engine — pinning its dialect and
compiled_cache alive for the source's lifetime.

Rebind connection_obj when creating the new engine in set_inspector,
and clear it in _release_engine so close() leaves nothing dangling.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

---------

Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
pmbrull added a commit that referenced this pull request May 18, 2026
…e, validations)

Copilot review on the ContextMemory entity:
- #1 record primaryEntity/relatedEntities/root/parent/source*/machineRepresentation
  in version history; usageCount/lastUsedAt documented as untracked telemetry
- open-metadata#2 clear stale HAS/RELATED_TO/CONTAINS edges before re-adding in storeRelationships
- open-metadata#4 default creator as owner only on create; PUT without owners no longer
  silently replaces previously set owners
- open-metadata#5 schema documents that any status is allowed at creation; transitions
  enforced only on update
- open-metadata#6 setFullyQualifiedName via FullyQualifiedName.build with skip-if-set guard
- open-metadata#7 validate shared principal type is user/team/domain
- open-metadata#8 reject self-reference for parentMemory/rootMemory
- open-metadata#10 inline Entity.CONTEXT_MEMORY, drop redundant constant

Regenerate ContextMemory TS types for the schema doc change; add IT coverage
for the self-reference and invalid-shared-principal validations.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
pmbrull pushed a commit that referenced this pull request Oct 1, 2026
…nt, merge-queue coverage gate (no reports), timing and flake baselines on ci/playwright-timing (open-metadata#32833)

* ci(playwright): 0 retries on PR, 1 retry on merge_group

Today PR CI and the merge queue both run with retries=1. A spec that
flakes on the first attempt and passes on the retry is reported as
"flaky" on both — which means:

  * PR CI is green. Author ships without knowing their test has a
    race.
  * Merge queue is green *when it retries the same way*, red when the
    retry also loses the coin flip. The queue is the place authors
    discover the flake, and it ejects the PR to discover it.

That is the pattern behind every merge-queue ejection we have traced
this month. Split the policy so the two runs answer different questions:

  * pull_request(_target) → retries: 0. Any test that passes only on
    a retry is a hard failure. The signal lands in front of the
    author, at PR time, when they can still fix it. The change makes
    PR CI a stricter gate than the queue on purpose.

  * merge_group → retries: 1 (unchanged). Once code is reviewed and
    PR CI ratified it, a single CI-infrastructure hiccup (network
    blip, browser startup race, docker image pull) should not eject a
    PR. The queue is the wrong place to relitigate real failure vs.
    transient — PR CI is.

workflow_dispatch keeps the reusable default of 1 (nothing to protect
against on a manual run). Nightlies already pass their own explicit
`retries: 2` and are unaffected.

One implementation gotcha worth calling out in the comment: GH
Actions' `X && Y || Z` short-circuits when Y is falsy, so writing
`pull_request && 0 || 1` would silently resolve to 1 and defeat the
whole change. The ternary uses '0' / '1' strings — non-empty so
truthy in the expression, and coerced to numeric by the reusable's
`type: number` input.

Follow-on cost for the team: every currently-flaky test that used to
show up as "flaky" on PR CI now shows up as failed. That is the whole
point — flakes get fixed instead of accumulating — but expect a burst
of "this passed yesterday" reports as the existing backlog surfaces.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

* fix(playwright): pass retries as a real integer, not a coerced string

The previous version of this ternary returned the STRING `'0'` (or
`'1'`) to work around GH Actions' `X && Y || Z` short-circuit on
falsy `0`. Passing a string to a `workflow_call` input declared as
`type: number` silently prevented the reusable-call job from
scheduling on same-repo `pull_request` runs (which use the PR
branch's workflow). Symptoms on PR open-metadata#32833 run 34104637012: two jobs
total — playwright-summary + refresh-timing-baseline — with no
`playwright / *` reusable jobs at all, and playwright-summary hit
"Guard against missing gate decision" because
`needs.playwright.outputs.gate_result` was empty. The sibling
`pull_request_target` run on the same SHA succeeded because it uses
main's workflow (no retries expression yet on main).

Invert the predicate so `0` is always the ELSE branch of the OR,
never the middle:

  BEFORE: contains(PR_EVENTS, event) && '0' || '1'   # string
  AFTER:  !contains(PR_EVENTS, event) && 1 || 0      # integer

Semantics identical:
  - pull_request(_target): !true && 1 || 0 → 0     ✓
  - merge_group:            !false && 1 || 0 → 1   ✓
  - workflow_dispatch:      !false && 1 || 0 → 1   ✓
  - schedule / push:        !false && 1 || 0 → 1   ✓

Now the value is a real integer that `type: number` accepts, and the
short-circuit trap is avoided by construction (0 as the ELSE, not
the middle).

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

* fix(playwright): harden GlobalPageSize + Policies for the 0-retry PR gate

Two flakes that ejected specs on merge-queue runs of this branch — both
went "not flaky" only because the 1-retry buffer hid them. Dropping to
0 retries on PR (this PR's whole point) surfaces them as hard failures,
so they need proper hardening before that policy can safely ship.

1. GlobalPageSize.spec.ts:21 — "Page size should persist across
   different pages" flaked on chromium-24 of run 34220614528, both
   attempts. Two dropdown races:

   * `page-size-selection-dropdown` is an Antd Dropdown with
     trigger="hover". Under merge-queue load the mouseenter can miss
     the transition and the menu never renders. Adopt the toPass +
     hover-then-click-fallback pattern already used in
     playwright/utils/common.ts:1425-1431 for the same component.
   * `rows-per-page-dropdown` is a react-aria Select. The retry
     snapshot shows the trigger going [active] (click landed) but the
     popover closing before the option becomes clickable. Wrap the
     click in toPass so it retries until `rows-per-page-option-50` is
     actually visible.

   Also add test.slow() — three page loads + two dropdown hand-offs is
   too much for a 60 s budget under load.

2. Policies.spec.ts:377 — "Delete policy action from manage button
   options" hit `page.reload: Test timeout of 60000ms exceeded` on
   chromium-03 of PR run 34210918860. API create + full reload +
   paginated list scan + manage/delete confirmation is 6+ heavy ops;
   under load a single reload eats 20 s alone. Add test.slow() —
   no behavior change, just triples the budget to 180 s.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

* fix(playwright): eliminate the 9 retry-passes blocking the 0-retry gate

Full-suite dispatch on this branch (run 34226208453) at 1 retry passed
4472/4472 tests but 9 tests needed retry #1 to get there — exactly the
set that would fail if the branch shipped with retry=0 on PR today.
Address each at its cause so the shadow zero-retry gate goes from
"would fail: true" to "would fail: false":

Race-tolerant retry loops (real root causes)

* OntologyStudioIntegration :242 "data mode renders tagged assets"
  Asset-visibility raced ES indexing lag on `/glossaryTerms/ontology/
  data` — the API returned before the asset was in the cluster's
  assets array. Wrap the final assertion in toPass with a reload-and-
  refetch fallback (up to 30 s).

* utils/dataContracts.ts pollContractStatus 180 s → 300 s
  ingestion-02 hit "Wait for contract validation to reach terminal
  state" while stuck at "Running" at exactly 180 s. Under merge-queue
  load the contract executor is contending for the same DB/ES —
  300 s covers the observed p99.

* utils/customProperty.ts deleteCreatedProperty waitForResponse
  30 s → 60 s
  chromium-09 mlmodel/String tripped the 30 s PATCH wait. mlmodel is
  a heavier entity than the ones the helper was calibrated against.

Timeout headroom (test.slow, no behavior change)

The remaining 6 tests are all multi-step flows (5+ round-trips) that
brushed against the 60 s default under load. test.slow() triples to
180 s without changing the tests' semantics:

* AdvancedSearch :1447 "Column Tags Not in [tag1] excludes table1"
* TestLibrary :841 "should handle supported services field correctly"
* GlossaryAdvancedOperations :1354 "should show error when glossary
  name exceeds limit"
* GlossaryHierarchy :259 "should cancel move operation"
* TasksUIFlow :213 "Create and resolve description task for Pipeline"
* ServiceEntityVersionPage :170 (all 7 service tests, Messaging failed
  first — the beforeAll patches 4x per entity so all tests share the
  same load footprint)

Next: re-dispatch the full suite. If shadow zero-retry gate =
"would fail: false", flip the retry policy for real.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

* chore(playwright): auto-refresh impact-map.generated.json [skip ci]

* fix(playwright): raise Tier assertion timeout to survive cache-invalidation lag

Second validation dispatch on this branch (run 34324900183) passed 4472
tests but two still needed retry #1. One is spec-fixable, one is server
network noise:

* Pages/Entity.spec :: "Tier Add, Update and Remove" (chromium-23)
  assignTier() sets up the PATCH wait correctly and asserts 200 before
  the DOM check, but React Query's entity-detail cache invalidation
  lags under merge-queue load — the `Tier` chip re-renders from the
  refetched entity, not from the PATCH response. Playwright resolved
  the locator 18 times to the previous value across the 15 s default
  before timing out. Raise the final assertion timeout to 30 s so the
  refetch has room to land without changing what the test actually
  verifies.

Not addressed here:

* Pages/Lineage/DataAssetLineage :: "Column lineage for mlModel -> table"
  (chromium-20) failed at `apiRequestContext.post: socket hang up` on
  POST /api/v1/services/dashboardServices — a server-side network
  hiccup, not a test race. This is exactly the class of transient a
  0-retry PR gate is expected to occasionally surface (author re-pushes);
  merge_group's 1-retry buffer absorbs it silently. Adding a
  withNetworkRetry helper is a broader change worth its own PR.

Shadow zero-retry gate goes from "would fail: true (7 signatures)" →
"would fail: true (~1 infra flake)". Land at that fidelity — the retry
policy is the point of this PR, not zero-noise-forever.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

* fix(playwright): add network-error retry for backend socket hang-ups

Third validation dispatch on this branch (run 34344723663) passed
4472 tests with 2 retry-passes remaining. Both were
`apiRequestContext.{post,delete}: socket hang up` — the Dropwizard
backend closing the socket mid-request under peak parallel load, not
a spec-level race:

* Pages/ExplorePageRightPanel.spec "CRUD for pipeline"
  DELETE /api/v1/services/databaseServices/... (TableClass.delete)
* Pages/Lineage/DataAssetLineage "Column lineage for mlModel -> table"
  POST /api/v1/services/dashboardServices (createOrFetch under
  DashboardClass.setUp)

Add `withNetworkRetry(send)` to `apiResponse.ts` — replays a thunk on
thrown transport-layer errors (socket hang up, ECONNRESET, ECONNREFUSED,
"other side closed", "network socket disconnected"). Existing status-based
retry loops (`withNotFoundRetry`, `createOrFetch`'s 404/5xx loop) cannot
catch these because they inspect `response.status()` and the request never
got that far.

Wired up at two levels:

* `apiResponse.ts::createOrFetch` — wraps the create POST, the retry
  POST, and the conflict-recovery GET. Every support class that creates
  an entity routes through here (via `createOrFetch`), so DashboardClass /
  TopicClass / ChartClass / ... all pick up the retry without further
  changes.
* `TableClass.ts::delete` + `deleteTable` — wraps the two service/table
  deletes that hit the observed flake pattern. Other classes' teardown
  paths remain untouched; adopting `withNetworkRetry` in them is a
  no-op today and a safe follow-up if similar patterns surface.

A genuine backend outage still surfaces after `NETWORK_RETRY_ATTEMPTS`
(3) tries with `NETWORK_RETRY_BASE_DELAY_MS * attempt` linear backoff.
Non-network errors propagate immediately — retry does not swallow real
failures.

Shadow zero-retry gate should now go from "would fail: true (2)" to
"would fail: false".

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

* chore(playwright): auto-refresh impact-map.generated.json [skip ci]

* chore(playwright): auto-refresh impact-map.generated.json

* ci(playwright): measure first attempts; normalize run-attempt artifacts

- classify_playwright_outcome.py records each test's first-attempt status and
  reports firstAttemptPassed/Failed, retriedTests and skippedTests, plus
  coverageVerified, quarantinedTests and artifactIntegrityVerified from the new
  --coverage and --artifact-integrity-outcome inputs. Measurement only.
- normalize_playwright_artifacts.cjs strips main's -a<runAttempt> upload suffix
  as well as -retry, so it identifies the shard correctly.
- test_playwright_merge_group_validation.py pins the queue gate, the shard
  coverage check, the 0/1 retry split and the execution identity fields.

From open-metadata#33088 (harshach/debug-merge-queue), adapted to keep one merge-queue retry.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* ci(playwright): quarantine inventory, queue shard coverage and gate, artifact integrity

- plan-playwright (PRs): list @quarantine tests into quarantine-inventory.json
  next to the shard plans, so the coverage report counts what quarantine drops.
- playwright-ci (merge queue): each shard must have tested the merge-group
  commit and executed every planned test (--require-native-evidence). Retry
  passes are allowed while the queue keeps one retry.
- ci-status.json records headSha, runId and runAttempt.
- playwright-summary: validate/normalize artifacts (advisory), pass coverage and
  artifact integrity to the classifier, and gate merge groups on gate/plan/shard
  results and a non-empty unique shard matrix.
- impact-map.json: point at the moved e2e/Auth login specs (same fix as open-metadata#33095).

From open-metadata#33088 (harshach/debug-merge-queue), adapted to keep one merge-queue retry.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* ci(playwright): merge groups upload no reports; shards verify locally

- playwright-summary: every step except the inline gate is skipped on
  merge_group. A green queue run is proven by the shard coverage check and the
  gate, and costs no artifact storage.
- playwright-ci: blob, timing and summary-results uploads are skipped on
  merge_group unless the shard failed or was cancelled, so a broken queue run
  still leaves evidence.
- The queue keeps one retry, so the shard coverage step lists any test that
  passed only on retry in the job summary and as a warning: the data for
  dropping the retry, without an artifact.
- refresh-timing-baseline now runs from full workflow_dispatch runs on main;
  merge groups no longer upload the timing history it needs.
- merge_queue_metrics.py already recognises the inline gate step and reports
  these runs as shard-local verification without report uploads.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* ci(playwright): keep the timing baseline on ci/playwright-timing, refreshed daily

main only accepts changes through the merge queue, so every direct baseline
push was rejected (GH013) and the refresh silently skipped; a push to main would
also reset every in-flight queue entry.

- New data-only branch ci/playwright-timing (seeded from main's baseline).
- refresh-timing-baseline runs after successful full runs on main (new daily
  schedule, or workflow_dispatch) and pushes there with the workflow token.
  Drift cap, materiality threshold and the 3-attempt retry are unchanged.
- plan-playwright fetches it and pools it with downloaded full-suite histories;
  main's checked-in baseline stays the fallback and the place a PR seeds a new
  spec. A fetch failure falls back to today's behaviour.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(ci): report only real retry passes in the queue coverage step

A test that fails every attempt also has more than one result, so the old
filter listed real failures as "passed only on retry" and skewed the
first-attempt data. Select tests Playwright marks flaky instead, and pin it
with a test that runs the step against synthetic results.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* ci(playwright): one retry for the flake week, main-health alerts and a flake baseline

Folds in open-metadata#32900's flake baseline and main-health ledger.

- retries: 1 everywhere while first-attempt data is collected; the flip to zero
  PR retries is documented next to the value.
- main-health (after each full run on main, i.e. the daily schedule or a
  dispatch): classify the run, refresh flake-baseline.json on
  ci/playwright-timing (a test enters after 2 first-attempt failures in the last
  10 runs and ages out once main passes it), and post to Slack: failures to
  #ci-cleanup, flaky passes to #pw-health.
- PR summaries pass that baseline to the classifier (report only), so its
  ledger separates a retry pass the PR introduced from one main already has.
- refresh_flake_baseline.py stores to the data branch instead of an Actions
  cache (eviction, and PRs must not be able to write it). The Slack payload is
  built with jq; open-metadata#32900's version wrote slack.json twice.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* ci(playwright): main alerts go to #pw-health; merge-queue failures to #ci-cleanup

- main-health posts every failure and flaky pass on main to #pw-health.
- New merge-queue alert: when the queue gate fails, post the queued PRs, the
  tests that failed (from the results failed shards upload) or, without them,
  the failed jobs, to #ci-cleanup. Inline jq/gh only, since queue runs never
  check out code in the summary job.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(ci): scope the merge-queue alert to the current attempt; one SECURITY comment on Checkout

- The alert downloaded every attempt's results, so a re-run could report tests
  that failed only in an earlier attempt. Download playwright-results-json-*-a<attempt>*
  (covers the -retry upload), matching the attempt-scoped job list.
- Inserting the gate and alert had left two copies of Checkout's SECURITY
  comment above them and none above Checkout. Keep one, above Checkout.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

---------

Co-authored-by: Auto-revert Test <[email protected]>
Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

This branch had an error being deployed

1 failed deployment
test — 339fab35 Deployed Mar 24, 2023 by Sachin-chaurasiya
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant