Skip to content

fix(ingestion): resolve uv.lock Dependabot alerts (brotlicffi, virtualenv, black, pytest, tornado) - #36641

Merged
Khairajani merged 14 commits into
mainfrom
fix/ingestion-dependabot-oct29
Nov 4, 2026
Merged

Khairajani merged 14 commits into
mainfrom
fix/ingestion-dependabot-oct29

Conversation

@Khairajani

@Khairajani Khairajani commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Describe your changes:

Resolves the ingestion uv.lock Dependabot alerts that have a usable fix.

Not fixable while requires-python >= 3.10: filelock (#796–#809) and dnspython (#799) have no patched release for 3.10, and the tornado alerts stay open for the 3.10 entry.

Type of change:

  • Bug fix

Checklist:

  • Unit tests: make unit_ingestion passes on Python 3.10 with pytest 9.0.3 (14636 passed).

🤖 Generated with Claude Code

Fixes GHSA-9v8h-qqgm-4m35 (brotlicffi, Dependabot #794) and
GHSA-cx6f-vjhg-g3cc (virtualenv, Dependabot #795) in ingestion/uv.lock.
…lock

black only reached the lock through datamodel-code-generator. Fixing
GHSA-3936-cmfr-pm3m and GHSA-cg8m-r9f2-5wm2 needs black >= 26.3.1, whose
pathspec >= 1.0 floor forces runtime dbt-core 1.11 -> 1.12. Codegen now
formats with ruff (generated models are AST-identical) and black is excluded.
… context

Fixes GHSA-6w46-j5rx-g56g (pytest, Dependabot #791).

The service source bases declared the topology context at class level, so
every source of a type in one process shared it. pytest 8.2+ builds unittest
TestCase instances lazily, which exposed the leak as cross-file test failures.
The context is now a per-instance cached_property on TopologyRunnerMixin.
Tests that chained context between methods set their own, and subTest labels
are plain strings so xdist can serialize pytest 9's subtest reports.
Fixes GHSA-pcg2-g6cj-q92c, GHSA-r4j5-9xpp-3985 and GHSA-pw9p-v7r6-gx4p
where it can: tornado 6.6 needs Python 3.11 and there is no 6.5.x backport,
so the Python 3.10 fork stays on 6.5.10.
@Khairajani
Khairajani requested a review from a team as a code owner October 30, 2026 05:29
@Khairajani
Khairajani requested a review from ulixius9 October 30, 2026 05:29
@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

Copy link
Copy Markdown
Contributor

Hi there 👋 Thanks for your contribution!

The OpenMetadata team will review the PR shortly! Once it has been labeled as safe to test, the CI workflows
will start executing and we'll be able to make sure everything is working as expected.

Let us know if you need any help!

@Khairajani Khairajani added the safe to test Add this label to run secure Github workflows on PRs label Oct 30, 2026
@Khairajani Khairajani closed this Oct 30, 2026
@Khairajani Khairajani reopened this Oct 30, 2026
Khairajani and others added 2 commits October 30, 2026 12:27
The class-level queue on TopologyRunnerMixin and the *_source_state sets on
every service base were shared by all sources of a type in one process, so a
second source or run inherited the FQNs the first one saw and mark-deleted
could never find those entities stale. They are now PerSourceState
descriptors, created per instance with vars(instance).setdefault because
worker threads can touch them first.

Also uninstall black after codegen in the CI Dockerfiles, since pip still
pulls it in with datamodel-code-generator.
@Khairajani
Khairajani enabled auto-merge November 2, 2026 10:24

@harshsoni2024 harshsoni2024 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.

lgtm

@Khairajani
Khairajani added this pull request to the merge queue Nov 2, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 2, 2026
@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

🚦 Removed from the merge queue — failed_checks (2026-11-02T19:20:53Z)

Blocked the queue: py-tests-status

  • Prune dead merge-queue refs — cancel-stale-runs
  • py-tests-postgres — py-tests-status, python / Verify Expected Jobs, python / Integration Tests (shard-3), python / Integration Tests (shard-3), python / Integration Tests (shard-3)
  • py-tests — python / Integration Tests (shard-3), python / Integration Tests (shard-3), python / Integration Tests (shard-3)

@Khairajani
Khairajani added this pull request to the merge queue Nov 3, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 3, 2026
@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

🚦 Removed from the merge queue — failed_checks (2026-11-03T16:11:50Z)

Blocked the queue: py-tests-status, playwright-summary

Failed Playwright tests:

  • Pages/Lineage/DataAssetLineage.spec.ts › Column lineage for table -> dashboard
  • Pages/Lineage/DataAssetLineage.spec.ts › Column lineage for table -> table

MemoryLimitExceeded is raised only after the function returns, so the memory
scenario ran all its sleeps (about 2.5s) under the 3s timeout and timed out on
a slow runner. Shorten the per-chunk sleep; the peak is still sampled during
the parse_time sleep.
@gitar-bot

gitar-bot Bot commented Nov 4, 2026

Copy link
Copy Markdown
Code Review ✅ Approved 1 closed / 1 findings

🔴 High risk · Moving ingestion contexts and seen-entity sets to per-source state changes mark-deleted scope; incorrect state could mark live catalog entities deleted.

Resolves ingestion uv.lock Dependabot alerts by bumping brotlicffi, virtualenv, pytest, tornado, and pyasn1, and removing black with codegen moved to ruff. Per-source state now uses per-instance descriptors to stop shared topology context leaking between sources. Resolved the finding that the per-source state rule lacked a decision record. No open issues found.

✅ 1 closed
✅ Quality: Per-source state rule from PR description has no decision record

📄 ingestion/src/metadata/ingestion/api/topology_runner.py:71-85 📄 ingestion/src/metadata/ingestion/source/database/database_service.py:217-220 📄 ingestion/src/metadata/ingestion/source/dashboard/dashboard_service.py:229-231
This commit adds a rule that every future service source base has to follow, and the only place it is written down is the PR description. Since the repo squash-merges, that text won't reach git log. The rule is: "Topology sources must never keep mutable run state (the queue, *_source_state seen-entity sets) as class attributes. Declare it with PerSourceState(factory) so each source instance gets its own. Don't use cached_property, because worker threads can touch the state first and cached_property takes no lock on Python 3.12+." This comes from the description: "These are now PerSourceState descriptors, created per instance on first access with vars(instance).setdefault, because worker threads can touch them first and cached_property takes no lock on Python 3.12+."

No file in docs/decisions/ covers topology context or source state. Without a record, the next connector base can bring back a class-level set() and quietly break mark-deleted when two sources or two runs share a process. Please add a record under docs/decisions/ stating this rule, and cite it as ADR:<date>-<slug> from the PerSourceState docstring.

Verification

Rules No rules evaluated

Functional validation Not enabled

Set up

Auto-approval Not enabled

Set up

For more verification details, comment gitar display:verbose.

Options

Display: compact → Showing compact verification results.

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

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source

@sonarqubecloud

sonarqubecloud Bot commented Nov 4, 2026

Copy link
Copy Markdown

@Khairajani
Khairajani merged commit 7d2afa2 into main Nov 4, 2026
66 of 67 checks passed
@Khairajani
Khairajani deleted the fix/ingestion-dependabot-oct29 branch November 4, 2026 07:10
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants