Skip to content

fix(security): clear the remaining fixable CVEs in the ingestion images - #31338

Merged
harshsoni2024 merged 2 commits into
mainfrom
fix/black_airflow_setuptools_vuls
Aug 12, 2026
Merged

harshsoni2024 merged 2 commits into
mainfrom
fix/black_airflow_setuptools_vuls

Conversation

@harshsoni2024

@harshsoni2024 harshsoni2024 commented Aug 11, 2026 •

Copy link
Copy Markdown
Contributor

Describe your changes:

  • The 10 Aug scan of the release image reports 43 findings, of which only 5 have a fix
    available
    ; the other 38 are Debian packages with no upstream fix in bookworm (expat 14,
    perl 10, cups 5, libssh2 3, tar 2, p11-kit 1, util-linux 1, plus kerberos and couchbase
    with no PyPI fix). This PR clears all 5.

black — CVE-2026-31900 (Critical), CVE-2026-32274 (High), CVE-2024-21503 (Medium)

  • black is not installed in any release image; it is a dev extra only. The sole occurrence on
    disk is spacy/tests/package/requirements.txt, a test fixture inside the spaCy wheel that
    pins black==22.3.0 and that scanners parse as a dependency manifest. New
    ingestion/scripts/strip_spacy_test_fixture.sh removes it after the final pip install in
    every image that ships spaCy.

  • This strip previously shipped inside patch_pyspark_jars.sh and was reverted along with it
    in Revert "fix(ingestion): patch PySpark-bundled CVE jars #31074, because the jar-fetching half failed on sha mismatches. Nothing in this script
    fetches anything.

apache-airflow 3.2.2 → 3.3.0 — CVE-2026-48891 (Medium)

  • /ui/dependencies leaked Dag IDs the caller cannot read via dep.source / dep.target, a
    residual gap in the CVE-2026-28563 fix. The pin, both base image tags, the vendored
    constraints file and the integration-test image move together.

setuptools 80.10.2 → 84 — CVE-2026-59890 (Medium)

  • setuptools<81 guards two separate things. cx_Oracle's setup.py imports pkg_resources
    (removed in 81.0.0) and has no cp312 wheel, so a source build is mandatory — that half
    stays. The other half, sqlalchemy-redshift 0.8.14, no longer applies: 1.0.0 moved to
    importlib.metadata and setup.py has pinned ~=1.0.0 since chore: update sqlalchemy to 1.0.0 #27776.

Type of change:

  • Bug fix

High-level design:

  • Why the spaCy strip cannot fail a build. Every path exits 0 — including python
    missing and an unexpected traceback — because the fixture is inert data and not worth
    blocking a release over. Problems surface as WARNING on stderr naming the surviving path.
    It walks sys.path rather than resolving spaCy once via find_spec: a user-site install
    shadows a system-site one, and find_spec would strip only the shadowing copy while the
    scanner kept reading the other — passing the build with the finding intact.

  • Why the constraints file is not a straight re-download. It carries two hand-patches
    marked "keep on regeneration" — impyla and thrift at 0.24.0 for CVE-2026-66053 /
    CVE-2026-41608 / CVE-2026-48586 — and upstream constraints-3.3.0 still ships
    impyla==0.22.0 and thrift==0.16.0
    . Both are re-applied; the file diverges from
    upstream in exactly those two blocks and nothing else. A plain regeneration would have
    traded one airflow CVE for three thrift ones.

  • Why the redshift lines are deleted rather than bumped. They are a regression, not a
    decision. chore: update sqlalchemy to 1.0.0 #27776 removed them from all three install sites; Migrate Databricks from sqlalchemy-databricks to databricks-sqlalchemy #26896 — branched before it,
    merged after — rewrote the same line to drop sqlalchemy-databricks and carried the stale
    redshift entry back in. As a single-line replacement it merged without conflict. Ordering
    is why nobody noticed: in the .ci files the --no-deps line runs before .[all], so
    ~=1.0.0 overwrites it and the pin is inert upstream. It only bites in Collate, where the
    same line runs after.

  • Why setuptools is lifted rather than unpinned. cx_Oracle and mysqlclient need
    pkg_resources only at build time; once built, both import cleanly against 84. So the
    lift becomes a final layer after the last source build instead of replacing the pin. That
    layer must stay last — a later layer compiling a package that needs pkg_resources will
    fail there, and the error will not look like a setuptools problem. Noted in-file.

  • Rollout: no source or API changes; Dockerfiles, one build script, one pin, and the
    vendored constraints file only.

Tests:

Use cases covered

  • Images that ship spaCy no longer carry the black-pinning fixture
  • Airflow images run 3.3.0; ingestion resolves apache-airflow==3.3.0
  • Release images ship setuptools ≥83 and sqlalchemy-redshift 1.0.0

Unit tests

Not applicable — Dockerfile, build-script and pin changes only.

Backend integration tests

Not applicable — no backend API changes.

Ingestion integration tests

ingestion/tests/integration/airflow/ moves to apache/airflow:3.3.0-python3.10
(Dockerfile + conftest.py). Not run locally; needs CI.

Playwright (UI) tests

Not applicable — no UI changes.

Manual testing performed

Verified in containers, not via a full image build:

  1. spaCy strip, against real spaCy 3.7.5 — absent → skip rc=0; installed-but-broken
    (missing click) → still found and stripped; idempotent re-run; shadowed + writable →
    strips both copies; shadowed + unwritable → WARNING, rc=0; python missing →
    WARNING, rc=0; python exits non-zero → WARNING, rc=0. spaCy still imports afterwards and
    spacy.tests stays importable (677 other files untouched). Two real docker builds
    against the actual build context confirmed PRE: fixture present → POST: fixture GONE.
  2. Airflow API surface — imported all 43 airflow symbols this repo references against
    apache/airflow:3.2.2-python3.12 and 3.3.0-python3.12. Zero changed availability;
    the 6 unavailable ones are unavailable in both (pre-existing Airflow-2.x fallback
    branches). Deprecation-warning sets are identical — no new deprecations.
  3. Constraints — dry-run resolve gives apache-airflow → 3.3.0 over 128 packages, no
    conflicts; provider floors resolve alongside (http 6.0.4, opensearch 1.10.0,
    elasticsearch 6.7.0); hand-patches still bind (impyla → 0.24.0, thrift → 0.24.0).
  4. setuptools sequence — ran the exact new order: setuptools<81 → cx_Oracle
    --no-build-isolation → --no-deps dialects → redshift 1.0.0 → mysqlclient==2.1.1 →
    setuptools>=83. Result: setuptools 84.0.0, pkg_resources absent, and cx_Oracle,
    MySQLdb, sqlalchemy_redshift, sqlalchemy_ibmi all import OK.
  5. All six Dockerfiles pass docker buildx build --check ("no warnings found"); action.yml
    still parses with all 12 steps.

Not yet verified — needs CI: a real image build against the 593 constraint deltas
(16 major-version changes, incl. marshmallow 3→4; note numpy 2.4.6 → 1.26.4 resolves a
pre-existing conflict with this repo's numpy<2), and the integration-test bump, which
exercises a live scheduler and API server.

UI screen recording / screenshots:

Not applicable.

Checklist:

  • I have read the CONTRIBUTING document.
  • My PR title is Fixes <issue-number>: <short explanation>
  • My PR is linked to a GitHub issue via Fixes #<issue-number> above.
  • I have commented on my code, particularly in hard-to-understand areas.
  • For JSON Schema changes: not applicable.
  • For UI changes: not applicable.
  • I have added tests — not applicable; see manual testing above.

The 10 Aug scan of the release image reports 43 findings, only 5 of which have a
fix available; the other 38 are Debian packages with no upstream fix in bookworm.
This clears all 5.

black -- CVE-2026-31900 (Critical), CVE-2026-32274 (High), CVE-2024-21503 (Medium)

black is not installed in any release image; it is a dev extra only. The sole
occurrence on disk is spacy/tests/package/requirements.txt, a test fixture inside
the spaCy wheel that pins black==22.3.0 and that scanners parse as a dependency
manifest. Strip it after the final pip install in every image that ships spaCy.

This strip previously shipped inside patch_pyspark_jars.sh and was reverted along
with it in #31074, because the jar-fetching half failed on sha mismatches. Nothing
in this script fetches anything. It also cannot fail a build: every path exits 0,
including python missing and an unexpected traceback, since the fixture is inert
data and not worth blocking a release over. Walking sys.path rather than resolving
spaCy once via find_spec is deliberate -- a user-site install shadows a
system-site one, and find_spec would strip only the shadowing copy while the
scanner kept reading the other, passing the build with the finding intact.

apache-airflow 3.2.2 -> 3.3.0 -- CVE-2026-48891 (Medium)

/ui/dependencies leaked Dag IDs the caller cannot read through the dep.source and
dep.target fields, a residual gap in the CVE-2026-28563 fix. The pin, both base
image tags, the vendored constraints file and the integration-test image move
together.

The constraints file is not a straight re-download. It carries two hand-patches
marked "keep on regeneration" -- impyla and thrift at 0.24.0 for CVE-2026-66053 /
CVE-2026-41608 / CVE-2026-48586 -- and upstream constraints-3.3.0 still ships
impyla==0.22.0 and thrift==0.16.0. Both are re-applied, so the file diverges from
upstream in exactly those two blocks and nothing else. A plain regeneration would
have traded one airflow CVE for three thrift ones.

setuptools 80.10.2 -> 84 -- CVE-2026-59890 (Medium)

The setuptools<81 pin guards two separate things. cx_Oracle's setup.py imports
pkg_resources, which 81.0.0 removed, and it has no cp312 wheel, so a source build
is mandatory; that half of the pin stays. The other half, sqlalchemy-redshift
0.8.14, no longer applies: 1.0.0 moved to importlib.metadata and setup.py has
pinned ~=1.0.0 since #27776.

The 0.8.14 entries removed here are a regression rather than a decision. #27776
deleted them from all three install sites; #26896, branched before it and merged
after, then rewrote the same line to drop sqlalchemy-databricks and carried the
stale redshift entry back in. Being a single-line replacement, it merged without
conflict.

cx_Oracle and mysqlclient need pkg_resources only at build time -- once built,
both import cleanly against 84 -- so the lift becomes a final layer after the last
source build instead of replacing the pin.

Co-Authored-By: Claude Opus 5 <[email protected]>
Copilot AI lite review requested due to automatic review settings August 11, 2026 12:53
@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 Ingestion safe to test Add this label to run secure Github workflows on PRs labels Aug 11, 2026
Comment thread ingestion/Dockerfile.ci Resolved

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.

Pull request overview

This PR aims to eliminate the remaining fixable CVE findings reported in ingestion-related Docker images by updating the Airflow baseline, removing a stale vulnerable pin, lifting the setuptools build-time pin after source builds, and stripping a spaCy test fixture that security scanners misinterpret as an installed black dependency.

Changes:

  • Bump Apache Airflow references to 3.3.0 across ingestion pins and integration-test images.
  • Remove the stale sqlalchemy-redshift==0.8.14 preinstall and rely on the intended sqlalchemy-redshift~=1.0.0 dependency.
  • Add a post-install strip step to remove spaCy’s spacy/tests/**/requirements.txt fixture and add a final setuptools upgrade layer.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
ingestion/tests/integration/airflow/Dockerfile Bumps the Airflow base image and pinned Airflow version used in integration tests.
ingestion/tests/integration/airflow/conftest.py Updates the integration-test base image tag to Airflow 3.3.0.
ingestion/setup.py Updates the Airflow pinned version used by ingestion extras.
ingestion/scripts/strip_spacy_test_fixture.sh Adds a build-time script to remove spaCy’s scanner-triggering test fixture.
ingestion/operators/docker/Dockerfile.ci Removes the stale redshift pin and adds setuptools lift + spaCy fixture strip to the operator CI image.
ingestion/operators/docker/Dockerfile Adds setuptools lift + spaCy fixture strip to the operator image.
ingestion/Dockerfile.ci Bumps Airflow image/constraints, removes stale redshift pin, and adds setuptools lift + spaCy fixture strip.
ingestion/Dockerfile Bumps Airflow image/constraints URL and adds setuptools lift + spaCy fixture strip.
ingestion/airflow-constraints-3.3.0.txt Updates the vendored Airflow 3.3.0 constraints content (including the impyla/thrift hand-patches).
.github/actions/setup-openmetadata-test-environment/action.yml Aligns CI test environment setup by removing the stale redshift pin.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread ingestion/Dockerfile Resolved
Comment thread ingestion/Dockerfile.ci Resolved
Comment thread ingestion/operators/docker/Dockerfile Resolved
@harshsoni2024

Copy link
Copy Markdown
Contributor Author

Code Review ⚠️ Changes requested 0 resolved / 1 findings
Clears fixable CVEs in ingestion images by upgrading Apache Airflow to 3.3.0, updating setuptools, and removing the spaCy test fixture, but airlfow db migrate runs after pkg_resources is removed.

⚠️ Edge Case: airflow db migrate runs after pkg_resources is removed
📄 ingestion/Dockerfile.ci:183 📄 ingestion/Dockerfile.ci:193 📄 ingestion/Dockerfile:149 📄 ingestion/Dockerfile:161

In both airflow images the final RUN pip install --upgrade "setuptools>=83" (which per this PR removes pkg_resources) is followed by RUN airflow db migrate. The in-file comment only guards against a later pip layer that compiles a package needing pkg_resources, but airflow db migrate executes Airflow's runtime import chain — if any airflow module, provider or plugin still import pkg_resources, this build step (and, more importantly, the shipped container at runtime) will fail with ImportError. The PR notes this exact sequence was not exercised ("needs CI: a real image build"), so it is unverified. Recommend confirming a real build reaches airflow db migrate cleanly, or gating the setuptools lift on verifying the full airflow runtime imports without pkg_resources.

🤖 Prompt for agents

Code Review: Clears fixable CVEs in ingestion images by upgrading Apache Airflow to 3.3.0, updating setuptools, and removing the spaCy test fixture, but airlfow db migrate runs after pkg_resources is removed.

1. ⚠️ Edge Case: airflow db migrate runs after pkg_resources is removed
   Files: ingestion/Dockerfile.ci:183, ingestion/Dockerfile.ci:193, ingestion/Dockerfile:149, ingestion/Dockerfile:161

   In both airflow images the final `RUN pip install --upgrade "setuptools>=83"` (which per this PR removes `pkg_resources`) is followed by `RUN airflow db migrate`. The in-file comment only guards against a *later pip layer that compiles* a package needing `pkg_resources`, but `airflow db migrate` executes Airflow's runtime import chain — if any airflow module, provider or plugin still `import pkg_resources`, this build step (and, more importantly, the shipped container at runtime) will fail with ImportError. The PR notes this exact sequence was not exercised ("needs CI: a real image build"), so it is unverified. Recommend confirming a real build reaches `airflow db migrate` cleanly, or gating the setuptools lift on verifying the full airflow runtime imports without pkg_resources.

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 👍 / 👎 | Powered by Gitar — free for open source

@gitar-bot Good catch on the ordering — the comment only guarded against later pip layers, and
airflow db migrate does execute a real import chain. I've moved the lift; details on why it
turned out not to fire either way.

The airflow base image already ships without pkg_resources. Tested directly in
apache/airflow:3.3.0-python3.12:

baseline: import pkg_resources  -> ModuleNotFoundError   # before any change of ours
pip install --upgrade "setuptools>=83"  -> 84.0.0
airflow db migrate                      -> rc=0
  "FABDBManager tables have been created from the ORM"
  "Database migration done!"

So the state isn't new. Our RUN pip install ... "setuptools<81" is what adds pkg_resources
back, purely so cx_Oracle can build; the final lift restores the base image's own baseline.
airflow db migrate running without pkg_resources is the configuration upstream Airflow
ships and tests by default.

Supporting scans:

  • 431 dists in the airflow image (core + every bundled provider): zero module-level
    pkg_resources imports.
  • OM source (ingestion/src/**, openmetadata-airflow-apis/**): zero references to
    pkg_resources at all.
  • The ingestion dependency set (561 dists) has only great_expectations — excluded from both
    all and slim — and luigi, which is test-only and whose server.py is never loaded by
    import luigi.

Moved it anyway, since it was free. airflow db migrate is the last line in both airflow
Dockerfiles, so the lift now sits after it:

RUN airflow db migrate && rm -f /opt/airflow/airflow.db
RUN pip install --upgrade "setuptools>=83"

airflow db migrate therefore runs with pkg_resources present, identical to today, and the
lift only affects the shipped image's final state. Comment updated to say so:

This must remain the final layer in the file — after airflow db migrate as well as after
the last pip install. Anything that compiles a package needing pkg_resources, or that runs
an import chain still using it
, would fail once it is gone.

The two operators/docker Dockerfiles have no airflow db migrate; the only thing after their
lift is the spaCy strip, which uses just os/sys/importlib.

Residual, stated plainly: the migrate test ran on the bare base image, not on a fully-built
image carrying openmetadata-managed-apis, openmetadata-ingestion[all] and OM's registered
AirflowPlugin. The scans cover that surface statically, and the reordering makes it moot for
airflow db migrate specifically — but the shipped container still runs with setuptools 84 and
no pkg_resources, so container startup on a real build is the check that fully closes it.

Move the setuptools>=83 lift after `airflow db migrate` in both airflow images:
the lift removes pkg_resources and migrate runs Airflow's import chain. Migrate
is the last line in both files, so this costs nothing.

Fall back to python3 in strip_spacy_test_fixture.sh when no `python` shim exists;
without it the strip silently skips and the black findings survive a green build.
`python` stays first -- pip installs into whichever interpreter it resolves to.

Co-Authored-By: Claude Opus 5 <[email protected]>
Copilot AI review requested due to automatic review settings August 11, 2026 13:15

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.

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated no new comments.

Suppressed comments (3)

ingestion/Dockerfile:146

  • This comment says the spaCy strip “must run after the final pip install”, but this Dockerfile still runs additional steps afterwards (notably airflow db migrate and the final pip install --upgrade setuptools>=83). Since only spaCy reinstall would restore the fixture, consider clarifying the wording to avoid future confusion.
# Strip spaCy's bundled test fixture, which scanners misreport as an installed black.
# See ingestion/scripts/strip_spacy_test_fixture.sh for the rationale. Must run after the
# final pip install, or a later install restores the fixture.

ingestion/scripts/strip_spacy_test_fixture.sh:11

  • The new script uses an Apache-2.0 license header, but ingestion scripts in this repo use the Collate Community License header (e.g., ingestion/ingestion_dependency.sh). This mismatch can break license checks and is inconsistent with the rest of the ingestion codebase.
#!/usr/bin/env bash
#  Copyright 2021 Collate
#  Licensed under the Apache License, Version 2.0 (the "License");
#  you may not use this file except in compliance with the License.
#  You may obtain a copy of the License at

ingestion/Dockerfile.ci:180

  • This comment says the spaCy strip “must run after the final pip install”, but this Dockerfile continues with later steps (including the final pip install --upgrade setuptools>=83). Since only a spaCy reinstall would restore the fixture, consider clarifying the wording to avoid implying it must be the literal last pip command.
# Strip spaCy's bundled test fixture, which scanners misreport as an installed black.
# See ingestion/scripts/strip_spacy_test_fixture.sh for the rationale. Must run after the
# final pip install, or a later install restores the fixture.

@sonarqubecloud

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown
Contributor

✅ Playwright Results — workflow succeeded

Validated commit 5de44d0fb3c4bdb86fcabd2e28b0551ebdc01e56 in Playwright run 31495273425, attempt 1.

✅ 612 passed · ❌ 0 failed · 🟡 1 flaky · ⏭️ 0 skipped · 🧰 0 lifecycle flaky

Performance

Blocking targets: ✅ met · Optimization targets: 🟡 in progress

Shard-job maxima below are not the full workflow wall time; the linked run includes build, fixture, planning, and reporting.

🕒 Full workflow signal wall (to summary) 56m 44s

⏱️ Max setup 3m 10s · max shard execution 20m 14s · max shard-job elapsed before upload 24m 30s · reporting 5s

🌐 216.72 requests/attempt · 2.76 app boots/UI scenario · 16.56% common-shard skew

Optimization targets still in progress:

  • Common shard skew was 16.56% (convergence target: at most 15%).
  • Browser traffic was 216.72 requests per attempt (convergence target: fewer than 200).
  • Application boot ratio was 2.76 per UI scenario (1775 boots / 644 scenarios; convergence target: at most 1).
Shard Passed Failed Flaky Skipped Lifecycle failed Lifecycle flaky
🟡 Shard chromium-01 131 0 1 0 0 0
✅ Shard chromium-02 138 0 0 0 0 0
✅ Shard chromium-03 129 0 0 0 0 0
✅ Shard data-asset-rules-01 61 0 0 0 0 0
✅ Shard domain-isolation-01 14 0 0 0 0 0
✅ Shard global-state-01 34 0 0 0 0 0
✅ Shard ingestion-01 29 0 0 0 0 0
✅ Shard ingestion-02 35 0 0 0 0 0
✅ Shard reindex-01 2 0 0 0 0 0
✅ Shard search-01 10 0 0 0 0 0
✅ Shard search-rbac-01 29 0 0 0 0 0
🟡 1 flaky test(s) (passed on retry)
  • Pages/Entity.spec.ts › Announcement create, edit & delete (shard chromium-01, 1 retry)

📦 Download artifacts

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

uv pip install "setuptools<81"
uv pip install --no-build-isolation "cx_Oracle>=8.3.0,<9"
uv pip install --no-deps "sqlalchemy-redshift==0.8.14" "sqlalchemy-ibmi==0.9.3" "pydoris-custom==1.1.0"
uv pip install --no-deps "sqlalchemy-ibmi==0.9.3" "pydoris-custom==1.1.0"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

this was earlier removed as part of sqlalchemy 1.0.0 upgrade & databricks migration. later got introduced by merge changes. but should be ok to remove

@harshsoni2024
harshsoni2024 added this pull request to the merge queue Aug 12, 2026
Merged via the queue into main with commit 5d05924 Aug 12, 2026
116 of 118 checks passed
@harshsoni2024
harshsoni2024 deleted the fix/black_airflow_setuptools_vuls branch August 12, 2026 08:14
@gitar-bot

gitar-bot Bot commented Aug 12, 2026

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

Clears remaining CVEs in ingestion images by upgrading Airflow and setuptools, updating constraints, and stripping spaCy test fixtures, addressing the airflow db migrate runs after pkg_resources is removed finding. No issues found.

✅ 1 resolved
✅ Edge Case: airflow db migrate runs after pkg_resources is removed

📄 ingestion/Dockerfile.ci:183 📄 ingestion/Dockerfile.ci:193 📄 ingestion/Dockerfile:149 📄 ingestion/Dockerfile:161
In both airflow images the final RUN pip install --upgrade "setuptools>=83" (which per this PR removes pkg_resources) is followed by RUN airflow db migrate. The in-file comment only guards against a later pip layer that compiles a package needing pkg_resources, but airflow db migrate executes Airflow's runtime import chain — if any airflow module, provider or plugin still import pkg_resources, this build step (and, more importantly, the shipped container at runtime) will fail with ImportError. The PR notes this exact sequence was not exercised ("needs CI: a real image build"), so it is unverified. Recommend confirming a real build reaches airflow db migrate cleanly, or gating the setuptools lift on verifying the full airflow runtime imports without pkg_resources.

Options

Display: verbose → Showing more information.

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

Verbose
gitar display:compact         

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

harshsoni2024 added a commit that referenced this pull request Aug 12, 2026
…es (#31338)

* fix(security): clear the remaining fixable CVEs in the ingestion images

The 10 Aug scan of the release image reports 43 findings, only 5 of which have a
fix available; the other 38 are Debian packages with no upstream fix in bookworm.
This clears all 5.

black -- CVE-2026-31900 (Critical), CVE-2026-32274 (High), CVE-2024-21503 (Medium)

black is not installed in any release image; it is a dev extra only. The sole
occurrence on disk is spacy/tests/package/requirements.txt, a test fixture inside
the spaCy wheel that pins black==22.3.0 and that scanners parse as a dependency
manifest. Strip it after the final pip install in every image that ships spaCy.

This strip previously shipped inside patch_pyspark_jars.sh and was reverted along
with it in #31074, because the jar-fetching half failed on sha mismatches. Nothing
in this script fetches anything. It also cannot fail a build: every path exits 0,
including python missing and an unexpected traceback, since the fixture is inert
data and not worth blocking a release over. Walking sys.path rather than resolving
spaCy once via find_spec is deliberate -- a user-site install shadows a
system-site one, and find_spec would strip only the shadowing copy while the
scanner kept reading the other, passing the build with the finding intact.

apache-airflow 3.2.2 -> 3.3.0 -- CVE-2026-48891 (Medium)

/ui/dependencies leaked Dag IDs the caller cannot read through the dep.source and
dep.target fields, a residual gap in the CVE-2026-28563 fix. The pin, both base
image tags, the vendored constraints file and the integration-test image move
together.

The constraints file is not a straight re-download. It carries two hand-patches
marked "keep on regeneration" -- impyla and thrift at 0.24.0 for CVE-2026-66053 /
CVE-2026-41608 / CVE-2026-48586 -- and upstream constraints-3.3.0 still ships
impyla==0.22.0 and thrift==0.16.0. Both are re-applied, so the file diverges from
upstream in exactly those two blocks and nothing else. A plain regeneration would
have traded one airflow CVE for three thrift ones.

setuptools 80.10.2 -> 84 -- CVE-2026-59890 (Medium)

The setuptools<81 pin guards two separate things. cx_Oracle's setup.py imports
pkg_resources, which 81.0.0 removed, and it has no cp312 wheel, so a source build
is mandatory; that half of the pin stays. The other half, sqlalchemy-redshift
0.8.14, no longer applies: 1.0.0 moved to importlib.metadata and setup.py has
pinned ~=1.0.0 since #27776.

The 0.8.14 entries removed here are a regression rather than a decision. #27776
deleted them from all three install sites; #26896, branched before it and merged
after, then rewrote the same line to drop sqlalchemy-databricks and carried the
stale redshift entry back in. Being a single-line replacement, it merged without
conflict.

cx_Oracle and mysqlclient need pkg_resources only at build time -- once built,
both import cleanly against 84 -- so the lift becomes a final layer after the last
source build instead of replacing the pin.

Co-Authored-By: Claude Opus 5 <[email protected]>

* fix(security): address review on the ingestion CVE cleanup

Move the setuptools>=83 lift after `airflow db migrate` in both airflow images:
the lift removes pkg_resources and migrate runs Airflow's import chain. Migrate
is the last line in both files, so this costs nothing.

Fall back to python3 in strip_spacy_test_fixture.sh when no `python` shim exists;
without it the strip silently skips and the black findings survive a green build.
`python` stays first -- pip installs into whichever interpreter it resolves to.

Co-Authored-By: Claude Opus 5 <[email protected]>

---------

Co-authored-by: Claude Opus 5 <[email protected]>
k-anshul pushed a commit to k-anshul/OpenMetadata that referenced this pull request Aug 12, 2026
…es (open-metadata#31338)

* fix(security): clear the remaining fixable CVEs in the ingestion images

The 10 Aug scan of the release image reports 43 findings, only 5 of which have a
fix available; the other 38 are Debian packages with no upstream fix in bookworm.
This clears all 5.

black -- CVE-2026-31900 (Critical), CVE-2026-32274 (High), CVE-2024-21503 (Medium)

black is not installed in any release image; it is a dev extra only. The sole
occurrence on disk is spacy/tests/package/requirements.txt, a test fixture inside
the spaCy wheel that pins black==22.3.0 and that scanners parse as a dependency
manifest. Strip it after the final pip install in every image that ships spaCy.

This strip previously shipped inside patch_pyspark_jars.sh and was reverted along
with it in open-metadata#31074, because the jar-fetching half failed on sha mismatches. Nothing
in this script fetches anything. It also cannot fail a build: every path exits 0,
including python missing and an unexpected traceback, since the fixture is inert
data and not worth blocking a release over. Walking sys.path rather than resolving
spaCy once via find_spec is deliberate -- a user-site install shadows a
system-site one, and find_spec would strip only the shadowing copy while the
scanner kept reading the other, passing the build with the finding intact.

apache-airflow 3.2.2 -> 3.3.0 -- CVE-2026-48891 (Medium)

/ui/dependencies leaked Dag IDs the caller cannot read through the dep.source and
dep.target fields, a residual gap in the CVE-2026-28563 fix. The pin, both base
image tags, the vendored constraints file and the integration-test image move
together.

The constraints file is not a straight re-download. It carries two hand-patches
marked "keep on regeneration" -- impyla and thrift at 0.24.0 for CVE-2026-66053 /
CVE-2026-41608 / CVE-2026-48586 -- and upstream constraints-3.3.0 still ships
impyla==0.22.0 and thrift==0.16.0. Both are re-applied, so the file diverges from
upstream in exactly those two blocks and nothing else. A plain regeneration would
have traded one airflow CVE for three thrift ones.

setuptools 80.10.2 -> 84 -- CVE-2026-59890 (Medium)

The setuptools<81 pin guards two separate things. cx_Oracle's setup.py imports
pkg_resources, which 81.0.0 removed, and it has no cp312 wheel, so a source build
is mandatory; that half of the pin stays. The other half, sqlalchemy-redshift
0.8.14, no longer applies: 1.0.0 moved to importlib.metadata and setup.py has
pinned ~=1.0.0 since open-metadata#27776.

The 0.8.14 entries removed here are a regression rather than a decision. open-metadata#27776
deleted them from all three install sites; open-metadata#26896, branched before it and merged
after, then rewrote the same line to drop sqlalchemy-databricks and carried the
stale redshift entry back in. Being a single-line replacement, it merged without
conflict.

cx_Oracle and mysqlclient need pkg_resources only at build time -- once built,
both import cleanly against 84 -- so the lift becomes a final layer after the last
source build instead of replacing the pin.

Co-Authored-By: Claude Opus 5 <[email protected]>

* fix(security): address review on the ingestion CVE cleanup

Move the setuptools>=83 lift after `airflow db migrate` in both airflow images:
the lift removes pkg_resources and migrate runs Airflow's import chain. Migrate
is the last line in both files, so this costs nothing.

Fall back to python3 in strip_spacy_test_fixture.sh when no `python` shim exists;
without it the strip silently skips and the black findings survive a green build.
`python` stays first -- pip installs into whichever interpreter it resolves to.

Co-Authored-By: Claude Opus 5 <[email protected]>

---------

Co-authored-by: Claude Opus 5 <[email protected]>
pmbrull pushed a commit that referenced this pull request Aug 24, 2026
…pat 2.8.3 (CVE-2026-72522) (#31890)

* fix(security): pull expat 2.8.3-1~deb13u1 into the ingestion-base image

The image reports expat 2.8.2 for CVE-2026-72522 (DSA-6446-1: out-of-bounds
read and resultant infinite loop in libexpat's *_toUtf16 surrogate handling);
trixie-security has 2.8.3-1~deb13u1. expat is not in the python:3.12-slim-trixie
base at all -- it comes in transitively from the top-of-file apt install -- and
that layer is exactly why the image is stuck at 2.8.2: its cache key never
changes, so it keeps resolving against the Debian index that was current when it
was first built. Adding expat there would freeze the fix the same way. It goes
in the late root layer instead, below the COPY and pip layers, where the index
is re-read on every build -- the same reasoning that put util-linux there.

expat rides in the existing dpkg source-package query rather than a second RUN,
so one apt call covers both source packages and the next OS CVE is a one-line
edit. The package set stays computed from dpkg rather than hand-listed for the
reason already documented there: scanners report each binary of a source package
separately, so a hand-written list silently leaves one behind.

util-linux keeps its non-empty assert and expat deliberately does not get one.
util-linux is Essential, so an empty query there means dpkg-query misbehaved and
the build must stop; expat is transitive, so an empty query is a legitimate
image with nothing to patch and failing on it would break the build for no
reason. Asserting one of the two still covers the hazard the check exists for:
`apt-get install --only-upgrade` with no package arguments exits 0, so an
all-empty query would give a green build that shipped the vulnerable packages.

Verified in a real build layer on python:3.12-slim-trixie: libexpat1 2.7.1-2 ->
2.8.3-1~deb13u1 and all nine util-linux binaries -> 2.41.5-0+deb13u1, exit 0.
The expat-absent path was exercised on the bare base and also exits 0,
upgrading util-linux alone.

ingestion/Dockerfile gets no equivalent change because there is nothing to
upgrade to, not because it is clean: apache/airflow:3.3.0-python3.12 is
bookworm, Debian still marks bookworm and bookworm-security vulnerable, and the
image already carries 2.5.0-1+deb12u2 -- the newest build either suite offers.
It needs revisiting when Debian ships a bookworm fix.

* fix(security): bump apache-airflow 3.3.0 -> 3.3.1 for CVE-2026-67587 / CVE-2026-54183

CVE-2026-67587 (High) -- the Task SDK rebuilt a Serde `Callback` by re-running its
constructor, which imports the module named by the stored callback path. `SyncCallback`
is an Airflow class, so it passes the default `allowed_deserialization_classes`
allow-list and tightening that setting does not help. A Dag author controls a task
instance's `next_kwargs`, so they can get an arbitrary module imported inside the
scheduler process when the `awaiting_input` timeout sweep deserializes that value. No
non-default configuration is required.

CVE-2026-54183 (Medium) -- the secrets masker's recursion-depth limit did not descend
into values nested inside a list, tuple or set, so a Variable holding a deeply nested
sensitive value rendered unmasked in the Variables UI. Anyone who can see the Variable
in the UI can already read it through the Variables REST API, so this is a
shoulder-surfing defense rather than a disclosure boundary -- hence Medium.

Both are fixed in 3.3.1 and nothing in the 3.3.0 line is clean. The pin, both base
image tags, the vendored constraints file and the integration-test image move together,
as they did for 3.2.2 -> 3.3.0 in #31338.

The constraints file is a straight re-download this time. It carried two hand-patches
marked "keep on regeneration" -- impyla and thrift at 0.24.0 for CVE-2026-66053 /
CVE-2026-41608 / CVE-2026-48586, against upstream constraints-3.3.0 shipping
impyla==0.22.0 and thrift==0.16.0 -- and upstream constraints-3.3.1 now ships both at
0.24.0 natively. Diffing the vendored 3.3.0 file against upstream constraints-3.3.0
confirms those two blocks were the only divergence, and the new file is byte-identical
to upstream constraints-3.3.1 outside comments. The comments are kept, reworded to say
the pin is now upstream-native, so a future regeneration off a branch that regressed
either version still gets caught.

Two comments that name a constraint were checked rather than blind-renumbered:

- tests/integration/airflow/Dockerfile explains the constraints are deliberately not
  applied because they pin chardet against openmetadata-ingestion's chardet==4.0.0.
  Still true; the version moved 6.0.0.post1 -> 7.5.1, so the number is updated.
- Dockerfile.ci's universal-pathlib workaround cites Airflow's >=0.3.8 floor.
  apache-airflow-core 3.3.1 still declares `universal-pathlib>=0.3.8` and constraints
  still pin 0.3.10, so only the Airflow version in the prose changes.

Resolution verified with `uv pip compile --python-version 3.12 --extra airflow`:
apache-airflow==3.3.1 co-installs with every transitive floor pin in the airflow extra
(providers-http, -opensearch, -elasticsearch, tornado, Werkzeug, starlette,
python-multipart) with no conflict. sqlparse resolves to 0.5.4 there via
collate-sqllineage, unchanged by this PR -- the release images force 0.6.0 in
ingestion/operators/docker/Dockerfile, which does not consume this constraints file.

Folded in: drop the stale croniter<3 ceiling from the dagster extra

`uv pip install ingestion[all]` + `[test]` in the CI test environment fails to resolve
against apache-airflow 3.3.1:

    Because apache-airflow-core>=3.3.1 depends on croniter>=6.2.2 [...] and because
    openmetadata-ingestion[test]==2.0.0.0.dev0 depends on apache-airflow==3.3.1 and
    croniter<3, we can conclude that [...] requirements are unsatisfiable.

apache-airflow-core raised its croniter floor from >=2.0.2 to >=6.2.2 between 3.3.0 and
3.3.1, so the ceiling that used to co-exist with airflow now excludes it.

The ceiling is dead weight and predates this conflict -- it has been in the dagster
extra since #6416 and survived the #15679 dependency cleanup:

- dagster 1.13.18 (what `dagster_graphql>=1.8.0` resolves to) declares no croniter
  dependency at all; resolving dagster_graphql alone produces no croniter.
- Nothing under ingestion/ imports croniter. The only importer in the repo is
  openmetadata-airflow-apis, a separate distribution that does not declare it and picks
  it up transitively from airflow.
- That importer is already running croniter 6.2.x: constraints-3.3.0 pins croniter==6.2.2
  and the airflow images install under it, so 6.x compatibility for `croniter.is_valid` /
  `get_prev` is established by the shipped image, not assumed here. The call site is also
  behind an `is_airflow_3_or_higher()` guard and unreachable on Airflow 3.

Only the CI test environment resolved croniter 2.x, because it installs from the extras
without the constraints file. Removing the ceiling makes it match the images.

Verified with `uv pip compile --extra all --extra test` on both 3.10 and 3.12: resolves
to apache-airflow==3.3.1, croniter==6.2.4, dagster==1.13.18 with no conflict. This was
the only pin in the tree that collided with the airflow bump.

* fix(ingestion): migrate NumPy and Pydantic dependency stack

* fix(ingestion): separate Aadhaar recognizer change

* fix: filter invalid date recognizer results

---------

Co-authored-by: Pablo Takara <[email protected]>
Khairajani added a commit that referenced this pull request Aug 25, 2026
`TestAirflowOps.setUpClass` passed `include_examples=False` to `DagBag`. Airflow 3.3
dropped that keyword -- DAG discovery is bundle based there, so example DAGs are no
longer a constructor flag -- and Python raises `TypeError` for an unknown keyword.
The call is in class setup, so all three tests in the class error before running.

This is unrelated to the DagBag change in this branch: the test builds its own DagBag
and never calls `get_dagbag`. It broke when the Airflow pin moved from 3.2.2 to 3.3.0
in #31338, and has failed on every branch that reached this job since. Fixed here only
because the job has to be green for this branch to be validated; happy to split it out.

Detect the keyword instead of assuming it, matching the `sync_to_db` and `bag_dag`
compatibility checks already in this setup, so the test keeps working on Airflow 2.x
and on 3.x.

Not changed: the workflow's `paths` filter still only watches
`openmetadata-airflow-apis/**`, so a pin bump in `ingestion/setup.py` cannot trigger
the suite it affects -- which is why this went unnoticed. Widening it would run a
24 minute docker-stack job on a file that changed 26 times in the last 90 days
against this module's 5, so that tradeoff is left to maintainers.
ShaileshParmar11 pushed a commit to ShaileshParmar11/OpenMetadata that referenced this pull request Aug 26, 2026
…line deploy (open-metadata#32005)

* fix(airflow-apis): stop re-parsing the whole DAG folder on every deploy

`get_dagbag` built a DagBag over the entire DAG folder and called `collect_dags`,
so each deploy parsed every DAG in the deployment. That makes a single deploy cost
O(total DAGs) and a bulk deploy O(total DAGs^2).

On Airflow 2.x the folder was never actually walked: `read_dags_from_db=True` made
both `collect_dags` and `collect_dags_from_db` early return, and DAGs came from the
serialized-DAG table. The Airflow 3.x support gate dropped that kwarg, which turned
an O(1) DB read into an O(N) filesystem walk.

The deploy path does not need a populated bag. `refresh_session_dag` calls
`process_file` on the DAG file it has just written and then asks for that single
`dag_id`, and `process_file` bags the DAG itself. Build the bag with
`collect_dags=False` instead. The kwarg exists on DagBag in both Airflow 2.x and
3.x, so the version branching goes away with it.

The folder walk was also masking `process_file`: `collect_dags` stamps
`file_last_changed` for every file it walks, including the one just written, so the
following `process_file` hit its `only_if_updated` early return and returned no
dags. The DAG was bagged by the folder walk as a side effect rather than by the call
that intends to bag it. The pre-fix test run confirms this - `found_dags` did not
contain the deployed dag.

Drop the `dagbag size` log line, which would now always report 0. The adjacent
`processed dags` line carries the same signal and starts reporting the real dag.

The per-deploy `DagFileProcessorManager` fork in `scan_dags_job_background` is left
alone deliberately. On Airflow 3 `DAG.sync_to_db` delegates to `bulk_write_to_db`,
which writes DagModel and asset rows but does not call `SerializedDagModel.write_dag`,
so that scan is what serializes a newly deployed DAG. Removing or skipping it would
leave deployed pipelines unrunnable.

Tests: `tests/unit/ingestion_pipeline/test_get_dagbag.py` - the bag comes back empty
over a populated folder, `collect_dags` is never called, and `process_file` still
bags the deployed DAG and only that DAG. All three fail before this change.

* fix(airflow-apis): keep the pre-3.0 DagBag path unchanged

`collect_dags` was only added to `DagBag.__init__` in Airflow 2.5 (absent in 2.4.0,
present in 2.5.3), and the plugin declares `apache-airflow>=2.2.2`, so passing it
unconditionally raised `TypeError` on 2.2 through 2.4 and failed every deploy there.

Scope the change to Airflow >= 3.0, which is where the regression is. Below 3.0 the
bag is still built with `read_dags_from_db=True`, which early returns out of
`collect_dags`, so that path never walked the DAG folder and needs no change.

Gate the new tests on Airflow 3 for the same reason.

* fix(airflow-apis): unblock airflow-apis-tests on Airflow 3.3

`TestAirflowOps.setUpClass` passed `include_examples=False` to `DagBag`. Airflow 3.3
dropped that keyword -- DAG discovery is bundle based there, so example DAGs are no
longer a constructor flag -- and Python raises `TypeError` for an unknown keyword.
The call is in class setup, so all three tests in the class error before running.

This is unrelated to the DagBag change in this branch: the test builds its own DagBag
and never calls `get_dagbag`. It broke when the Airflow pin moved from 3.2.2 to 3.3.0
in open-metadata#31338, and has failed on every branch that reached this job since. Fixed here only
because the job has to be green for this branch to be validated; happy to split it out.

Detect the keyword instead of assuming it, matching the `sync_to_db` and `bag_dag`
compatibility checks already in this setup, so the test keeps working on Airflow 2.x
and on 3.x.

Not changed: the workflow's `paths` filter still only watches
`openmetadata-airflow-apis/**`, so a pin bump in `ingestion/setup.py` cannot trigger
the suite it affects -- which is why this went unnoticed. Widening it would run a
24 minute docker-stack job on a file that changed 26 times in the last 90 days
against this module's 5, so that tradeoff is left to maintainers.
pmbrull pushed a commit that referenced this pull request Aug 27, 2026
* fix(security): airflow 3.3.1 (CVE-2026-67587 / CVE-2026-54183) and expat 2.8.3 (CVE-2026-72522) (#31890)

* fix(security): pull expat 2.8.3-1~deb13u1 into the ingestion-base image

The image reports expat 2.8.2 for CVE-2026-72522 (DSA-6446-1: out-of-bounds
read and resultant infinite loop in libexpat's *_toUtf16 surrogate handling);
trixie-security has 2.8.3-1~deb13u1. expat is not in the python:3.12-slim-trixie
base at all -- it comes in transitively from the top-of-file apt install -- and
that layer is exactly why the image is stuck at 2.8.2: its cache key never
changes, so it keeps resolving against the Debian index that was current when it
was first built. Adding expat there would freeze the fix the same way. It goes
in the late root layer instead, below the COPY and pip layers, where the index
is re-read on every build -- the same reasoning that put util-linux there.

expat rides in the existing dpkg source-package query rather than a second RUN,
so one apt call covers both source packages and the next OS CVE is a one-line
edit. The package set stays computed from dpkg rather than hand-listed for the
reason already documented there: scanners report each binary of a source package
separately, so a hand-written list silently leaves one behind.

util-linux keeps its non-empty assert and expat deliberately does not get one.
util-linux is Essential, so an empty query there means dpkg-query misbehaved and
the build must stop; expat is transitive, so an empty query is a legitimate
image with nothing to patch and failing on it would break the build for no
reason. Asserting one of the two still covers the hazard the check exists for:
`apt-get install --only-upgrade` with no package arguments exits 0, so an
all-empty query would give a green build that shipped the vulnerable packages.

Verified in a real build layer on python:3.12-slim-trixie: libexpat1 2.7.1-2 ->
2.8.3-1~deb13u1 and all nine util-linux binaries -> 2.41.5-0+deb13u1, exit 0.
The expat-absent path was exercised on the bare base and also exits 0,
upgrading util-linux alone.

ingestion/Dockerfile gets no equivalent change because there is nothing to
upgrade to, not because it is clean: apache/airflow:3.3.0-python3.12 is
bookworm, Debian still marks bookworm and bookworm-security vulnerable, and the
image already carries 2.5.0-1+deb12u2 -- the newest build either suite offers.
It needs revisiting when Debian ships a bookworm fix.

* fix(security): bump apache-airflow 3.3.0 -> 3.3.1 for CVE-2026-67587 / CVE-2026-54183

CVE-2026-67587 (High) -- the Task SDK rebuilt a Serde `Callback` by re-running its
constructor, which imports the module named by the stored callback path. `SyncCallback`
is an Airflow class, so it passes the default `allowed_deserialization_classes`
allow-list and tightening that setting does not help. A Dag author controls a task
instance's `next_kwargs`, so they can get an arbitrary module imported inside the
scheduler process when the `awaiting_input` timeout sweep deserializes that value. No
non-default configuration is required.

CVE-2026-54183 (Medium) -- the secrets masker's recursion-depth limit did not descend
into values nested inside a list, tuple or set, so a Variable holding a deeply nested
sensitive value rendered unmasked in the Variables UI. Anyone who can see the Variable
in the UI can already read it through the Variables REST API, so this is a
shoulder-surfing defense rather than a disclosure boundary -- hence Medium.

Both are fixed in 3.3.1 and nothing in the 3.3.0 line is clean. The pin, both base
image tags, the vendored constraints file and the integration-test image move together,
as they did for 3.2.2 -> 3.3.0 in #31338.

The constraints file is a straight re-download this time. It carried two hand-patches
marked "keep on regeneration" -- impyla and thrift at 0.24.0 for CVE-2026-66053 /
CVE-2026-41608 / CVE-2026-48586, against upstream constraints-3.3.0 shipping
impyla==0.22.0 and thrift==0.16.0 -- and upstream constraints-3.3.1 now ships both at
0.24.0 natively. Diffing the vendored 3.3.0 file against upstream constraints-3.3.0
confirms those two blocks were the only divergence, and the new file is byte-identical
to upstream constraints-3.3.1 outside comments. The comments are kept, reworded to say
the pin is now upstream-native, so a future regeneration off a branch that regressed
either version still gets caught.

Two comments that name a constraint were checked rather than blind-renumbered:

- tests/integration/airflow/Dockerfile explains the constraints are deliberately not
  applied because they pin chardet against openmetadata-ingestion's chardet==4.0.0.
  Still true; the version moved 6.0.0.post1 -> 7.5.1, so the number is updated.
- Dockerfile.ci's universal-pathlib workaround cites Airflow's >=0.3.8 floor.
  apache-airflow-core 3.3.1 still declares `universal-pathlib>=0.3.8` and constraints
  still pin 0.3.10, so only the Airflow version in the prose changes.

Resolution verified with `uv pip compile --python-version 3.12 --extra airflow`:
apache-airflow==3.3.1 co-installs with every transitive floor pin in the airflow extra
(providers-http, -opensearch, -elasticsearch, tornado, Werkzeug, starlette,
python-multipart) with no conflict. sqlparse resolves to 0.5.4 there via
collate-sqllineage, unchanged by this PR -- the release images force 0.6.0 in
ingestion/operators/docker/Dockerfile, which does not consume this constraints file.

Folded in: drop the stale croniter<3 ceiling from the dagster extra

`uv pip install ingestion[all]` + `[test]` in the CI test environment fails to resolve
against apache-airflow 3.3.1:

    Because apache-airflow-core>=3.3.1 depends on croniter>=6.2.2 [...] and because
    openmetadata-ingestion[test]==2.0.0.0.dev0 depends on apache-airflow==3.3.1 and
    croniter<3, we can conclude that [...] requirements are unsatisfiable.

apache-airflow-core raised its croniter floor from >=2.0.2 to >=6.2.2 between 3.3.0 and
3.3.1, so the ceiling that used to co-exist with airflow now excludes it.

The ceiling is dead weight and predates this conflict -- it has been in the dagster
extra since #6416 and survived the #15679 dependency cleanup:

- dagster 1.13.18 (what `dagster_graphql>=1.8.0` resolves to) declares no croniter
  dependency at all; resolving dagster_graphql alone produces no croniter.
- Nothing under ingestion/ imports croniter. The only importer in the repo is
  openmetadata-airflow-apis, a separate distribution that does not declare it and picks
  it up transitively from airflow.
- That importer is already running croniter 6.2.x: constraints-3.3.0 pins croniter==6.2.2
  and the airflow images install under it, so 6.x compatibility for `croniter.is_valid` /
  `get_prev` is established by the shipped image, not assumed here. The call site is also
  behind an `is_airflow_3_or_higher()` guard and unreachable on Airflow 3.

Only the CI test environment resolved croniter 2.x, because it installs from the extras
without the constraints file. Removing the ceiling makes it match the images.

Verified with `uv pip compile --extra all --extra test` on both 3.10 and 3.12: resolves
to apache-airflow==3.3.1, croniter==6.2.4, dagster==1.13.18 with no conflict. This was
the only pin in the tree that collided with the airflow bump.

* fix(ingestion): migrate NumPy and Pydantic dependency stack

* fix(ingestion): separate Aadhaar recognizer change

* fix: filter invalid date recognizer results

---------

Co-authored-by: Pablo Takara <[email protected]>

* fix(pii): recognize separated Aadhaar numbers (#31900)

* fix(ingestion): pin asammdf to the 8.2-8.7 window so arm64 builds get a wheel (#31950)

* fix(ingestion): pin asammdf to the 8.2-8.7 window so arm64 builds get a wheel

asammdf 8.0.x and 8.1.x publish no linux-aarch64 wheel, so on arm64 pip falls
back to the 8.1.2 sdist, which builds with scikit-build-core + CMake and does
not vendor ext/libdeflate:

    CMake Error at CMakeLists.txt:20 (add_subdirectory):
      add_subdirectory given source "ext/libdeflate" which is not an existing
      directory.

Every arm64 image build that installs ./ingestion[all] from source fails at
that step. 7.4.5 built from source fine because its sdist was plain
setuptools.build_meta, which is why this only surfaced after the pin moved to
~=8.1.0.

8.2.0 is the first release with manylinux_2_17_aarch64 abi3 wheels. The upper
bound stops at 8.8.0, which promoted chardet from an optional extra to a hard
chardet>=7.0.0 dependency and so conflicts with the chardet==4.0.0 pin in
base_requirements. Reverting to 7.4.5 is not an option: numpy>=2 is now
required and 7.4.5 is numpy-1 only.

* chore: trigger CI

* fix(ingestion): drop the dead load_measured_data kwarg from the MF4 reader

MDF takes **kwargs typed as Unpack[MdfKwargs], and load_measured_data is not one of
its keys, so basedpyright reports four reportCallIssue errors once the pin resolves
to 8.7.2:

    mf4.py:85:33 - error: No parameter named "load_measured_data" (reportCallIssue)

The kwarg has been inert for years -- it dates from the 2.x/3.x memory options and is
silently dropped by **kwargs, verified against 8.7.2 where MDF opens and returns the
same header._common_properties with and without it. Removing it is behaviour
preserving and clears the static-checks lane.

---------

Co-authored-by: IceS2 <[email protected]>

* Fixes #31742: strip trailing slash from Looker hostPort before the SDK concatenates onto it (#31761)

* Fixes #31742: strip the trailing slash from Looker hostPort before the SDK concatenates onto it

hostPort is a pydantic AnyUrl, which renders a URL with no path as
"https://host/". looker_sdk builds the login URL by string concatenation
(auth_session: f"{base_url}/api/{version}/login"), so that slash reached Looker
as //api/4.0/login. Login is the gate for CheckAccess, so Test Connection failed
before any other step ran, and Looker's 404 was diagnosed as rejected
credentials - even though the same credentials worked via curl.

Only login/logout are affected; every other endpoint goes through urljoin, which
normalises itself. metadata.py already wraps clean_uri around all five of its
concatenation sites - connection.py was the one place that did not.

The existing test helper built a MagicMock whose hostPort was a plain str, so it
never saw the trailing slash pydantic adds. It now builds a real
LookerConnection, which is what made the bug visible.

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

* chore: empty commit to re-trigger CI

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

---------

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

* fix(pii): break weighted-score ties by confidence in the NER scanner (#31961)

* fix(pii): break weighted-score ties by confidence in the NER scanner

get_highest_score_label ranks candidates by "score * appearances * 0.8" and picks
the winner with max(). On an exact tie max() returns whichever key was recorded
first, so the classification depended on the order the sample rows happened to be
scanned in rather than on the evidence.

A column of dashed US SSNs hits that tie. The customised registry's
us_driving_license patterns include ^\d{3}-\d{2}-\d{4}$ at 0.3, which matches every
row, while US_SSN only matches a subset (a sequential-digit sample is rejected and
another reads as US_ITIN):

    US_DRIVER_LICENSE  0.3 * 5 * 0.8 = 1.200
    US_SSN             0.5 * 3 * 0.8 = 1.200

The first row produces only US_DRIVER_LICENSE, so it is recorded first and a weak
0.3 guess outranks a 0.5 match, tagging national IDs as driving licences.

Adding the raw confidence as the secondary key makes the stronger match win and
removes the dependency on insertion order. Where both the weighted total and the
confidence are equal the outcome is unchanged, so the existing expectations hold.

* fix(pii): demote the SSN-shaped driving-licence pattern

The tie-break only engages when the weighted totals land on the same number. The
SSN-shaped licence pattern matches every dashed 3-2-4 value unconditionally while
US_SSN matches only the subset passing Presidio's validator, so the licence
appearance count is always >= the SSN one. Solving 0.3n > 0.5k puts the crossover at
60%: any column where fewer than 60% of the sampled values validate was labelled a
driving licence, which is ordinary for masked, placeholder or synthetic SSNs.

    ["000-12-3456", "666-45-6789", "111-00-2222", "333-44-0000", "543-21-0987"]
    US_DRIVER_LICENSE  0.3 * 5 * 0.8 = 1.200   <- wins outright, no tie
    US_SSN             0.5 * 1 * 0.8 = 0.400

Deleting the pattern is not the answer: Mississippi prints its nine-digit licence
numbers in Social Security positions, so the shape is a real licence format and
dropping it loses that detection entirely (a column of such values then matches
nothing). Scoring it very weak instead keeps the licence reading available when
nothing else claims the column, while a validated SSN match outranks it.

Measured against build_analyzer_engine() with presidio 2.2.358, before -> after:

    dashed SSN, 3 of 5 validate      US_SSN            -> US_SSN
    masked SSN, 1 of 5 validate      US_DRIVER_LICENSE -> US_SSN
    licence shape, none validate     US_DRIVER_LICENSE -> US_DRIVER_LICENSE
    ordinary licences (A1234567)     US_DRIVER_LICENSE -> US_DRIVER_LICENSE

* test(pii): keep the tie-break comment accurate after the score demotion

The 0.3 x 5 illustration is now synthetic rather than something the SSN-shaped
licence pattern still produces, so describe the general shape of the tie instead of
attributing it to that pair.

* fix(ingestion): keep Airflow Elasticsearch transport compatible

---------

Co-authored-by: Himanshu Khairajani <[email protected]>
Co-authored-by: Mayur Singal <[email protected]>
Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
Khairajani added a commit that referenced this pull request Sep 1, 2026
…#32005) + scale the deploy-pipelines deadline (#31976) (#32101)

* fix(airflow-apis): stop re-parsing the whole DAG folder on every pipeline deploy (#32005)

* fix(airflow-apis): stop re-parsing the whole DAG folder on every deploy

`get_dagbag` built a DagBag over the entire DAG folder and called `collect_dags`,
so each deploy parsed every DAG in the deployment. That makes a single deploy cost
O(total DAGs) and a bulk deploy O(total DAGs^2).

On Airflow 2.x the folder was never actually walked: `read_dags_from_db=True` made
both `collect_dags` and `collect_dags_from_db` early return, and DAGs came from the
serialized-DAG table. The Airflow 3.x support gate dropped that kwarg, which turned
an O(1) DB read into an O(N) filesystem walk.

The deploy path does not need a populated bag. `refresh_session_dag` calls
`process_file` on the DAG file it has just written and then asks for that single
`dag_id`, and `process_file` bags the DAG itself. Build the bag with
`collect_dags=False` instead. The kwarg exists on DagBag in both Airflow 2.x and
3.x, so the version branching goes away with it.

The folder walk was also masking `process_file`: `collect_dags` stamps
`file_last_changed` for every file it walks, including the one just written, so the
following `process_file` hit its `only_if_updated` early return and returned no
dags. The DAG was bagged by the folder walk as a side effect rather than by the call
that intends to bag it. The pre-fix test run confirms this - `found_dags` did not
contain the deployed dag.

Drop the `dagbag size` log line, which would now always report 0. The adjacent
`processed dags` line carries the same signal and starts reporting the real dag.

The per-deploy `DagFileProcessorManager` fork in `scan_dags_job_background` is left
alone deliberately. On Airflow 3 `DAG.sync_to_db` delegates to `bulk_write_to_db`,
which writes DagModel and asset rows but does not call `SerializedDagModel.write_dag`,
so that scan is what serializes a newly deployed DAG. Removing or skipping it would
leave deployed pipelines unrunnable.

Tests: `tests/unit/ingestion_pipeline/test_get_dagbag.py` - the bag comes back empty
over a populated folder, `collect_dags` is never called, and `process_file` still
bags the deployed DAG and only that DAG. All three fail before this change.

* fix(airflow-apis): keep the pre-3.0 DagBag path unchanged

`collect_dags` was only added to `DagBag.__init__` in Airflow 2.5 (absent in 2.4.0,
present in 2.5.3), and the plugin declares `apache-airflow>=2.2.2`, so passing it
unconditionally raised `TypeError` on 2.2 through 2.4 and failed every deploy there.

Scope the change to Airflow >= 3.0, which is where the regression is. Below 3.0 the
bag is still built with `read_dags_from_db=True`, which early returns out of
`collect_dags`, so that path never walked the DAG folder and needs no change.

Gate the new tests on Airflow 3 for the same reason.

* fix(airflow-apis): unblock airflow-apis-tests on Airflow 3.3

`TestAirflowOps.setUpClass` passed `include_examples=False` to `DagBag`. Airflow 3.3
dropped that keyword -- DAG discovery is bundle based there, so example DAGs are no
longer a constructor flag -- and Python raises `TypeError` for an unknown keyword.
The call is in class setup, so all three tests in the class error before running.

This is unrelated to the DagBag change in this branch: the test builds its own DagBag
and never calls `get_dagbag`. It broke when the Airflow pin moved from 3.2.2 to 3.3.0
in #31338, and has failed on every branch that reached this job since. Fixed here only
because the job has to be green for this branch to be validated; happy to split it out.

Detect the keyword instead of assuming it, matching the `sync_to_db` and `bag_dag`
compatibility checks already in this setup, so the test keeps working on Airflow 2.x
and on 3.x.

Not changed: the workflow's `paths` filter still only watches
`openmetadata-airflow-apis/**`, so a pin bump in `ingestion/setup.py` cannot trigger
the suite it affects -- which is why this went unnoticed. Widening it would run a
24 minute docker-stack job on a file that changed 26 times in the last 90 days
against this module's 5, so that tradeoff is left to maintainers.

* fix(ops): scale the deploy-pipelines chunk deadline with the chunk size (#31976)

* fix(ops): scale the deploy-pipelines chunk deadline with the chunk size

deploy-pipelines POSTs chunks of pipeline IDs to the bulk deploy endpoint,
which registers each pipeline sequentially, but bounded the request with a
fixed 2 minute deadline. At the default chunk size of 20 that budgets 6
seconds per pipeline, which a freshly restarted pipeline service does not
meet, so the client abandoned requests whose work was still progressing.

A client deadline does not cancel the server, so the abandoned chunk kept
deploying while the command marked all 20 pipelines FAILED and exited 1. A
Kubernetes restartPolicy of OnFailure then replayed the whole run on top of
work still in flight, adding load to an operation that was already
succeeding. On a catalog of 92 pipelines this reported failure while 90 were
deployed.

Budget the deadline per pipeline and multiply by the chunk size, so it no
longer silently becomes too short as a catalog grows, and expose the chunk
size and the per-pipeline budget as options. The command previously accepted
none, so neither value was reachable from a deployment configuration.

Extract the deadline calculation and the failure check as static functions so
the scaling and the exit code are unit testable without a database.

Reporting is left unchanged: an abandoned chunk is still recorded as failed.
The persisted deployed flag cannot correct it, because the deploy path only
ever sets it to true and never resets it, so it records whether a pipeline was
ever deployed rather than what this run did. Reading it to clear a timeout
would turn a genuine failure into a silent success on any redeploy. A per-run
answer needs the deploy response itself, which is a separate change.

* fix(ops): reject a non-positive deploy-pipelines chunk size

Exposing --chunk-size made a value that was previously hardcoded to 20
reachable from outside, and chunkList advances its loop with i += chunkSize.
A chunk size of 0 never advances, appending empty chunks until the heap is
exhausted, and a negative size makes subList throw, which the surrounding
handler turns into every pipeline being reported as FAILED.

Validate both options before the deploy runs and report each offending value,
rather than clamping, so a mistyped flag is not silently replaced by a
different deadline. Guard chunkList as well, so a non-positive size fails
loudly instead of spinning if another caller ever skips validation.

A non-positive --seconds-per-pipeline was already safe, since the deadline
floors at the previous fixed 2 minutes, but it is rejected too rather than
silently falling back to the deadline this option exists to move away from.

Drops the deployChunkTimeout(0, 30) assertion, which implied a chunk size of
0 was supported when it now fails validation.

* test(ops): cover picocli binding for the deploy-pipelines options

Parsing the command with picocli asserts the new options bind to the values
passed on the command line and that the declared defaults still match the
20 and 30 the description documents. Neither was covered: the existing tests
call the helpers directly, so a mistyped option name or a default drifting
from its description would not have failed anything.

Reads the defaults from the command spec rather than the parse result, since
matchedOptionValue only reports options actually present on the command line.

Needs no database, so it stays a unit test.

* style: drop unused static imports flagged by spotless on 2.0

`TestCaseResolutionStatusResource` imports `CommonUtil.listOrEmpty` and
`CommonUtil.nullOrEmpty` but no longer uses either, so `mvn spotless:check` fails and
the `java-checkstyle` job is red for every PR targeting this branch -- #32095 and
#32093 fail identically. The usages went away in #32017 while the imports stayed.

Import-only change, produced by `mvn spotless:apply`; no logic touched. Needed here
only so this backport can be validated.

`main` needs no equivalent fix: both symbols are imported and used five times each in
that file there. On `1.13` the imports do not exist. This is 2.0-only.
pmbrull pushed a commit that referenced this pull request Sep 2, 2026
#32005) + scale the deploy-pipelines deadline (#31976) (#32100)

* fix(airflow-apis): stop re-parsing the whole DAG folder on every pipeline deploy (#32005)

* fix(airflow-apis): stop re-parsing the whole DAG folder on every deploy

`get_dagbag` built a DagBag over the entire DAG folder and called `collect_dags`,
so each deploy parsed every DAG in the deployment. That makes a single deploy cost
O(total DAGs) and a bulk deploy O(total DAGs^2).

On Airflow 2.x the folder was never actually walked: `read_dags_from_db=True` made
both `collect_dags` and `collect_dags_from_db` early return, and DAGs came from the
serialized-DAG table. The Airflow 3.x support gate dropped that kwarg, which turned
an O(1) DB read into an O(N) filesystem walk.

The deploy path does not need a populated bag. `refresh_session_dag` calls
`process_file` on the DAG file it has just written and then asks for that single
`dag_id`, and `process_file` bags the DAG itself. Build the bag with
`collect_dags=False` instead. The kwarg exists on DagBag in both Airflow 2.x and
3.x, so the version branching goes away with it.

The folder walk was also masking `process_file`: `collect_dags` stamps
`file_last_changed` for every file it walks, including the one just written, so the
following `process_file` hit its `only_if_updated` early return and returned no
dags. The DAG was bagged by the folder walk as a side effect rather than by the call
that intends to bag it. The pre-fix test run confirms this - `found_dags` did not
contain the deployed dag.

Drop the `dagbag size` log line, which would now always report 0. The adjacent
`processed dags` line carries the same signal and starts reporting the real dag.

The per-deploy `DagFileProcessorManager` fork in `scan_dags_job_background` is left
alone deliberately. On Airflow 3 `DAG.sync_to_db` delegates to `bulk_write_to_db`,
which writes DagModel and asset rows but does not call `SerializedDagModel.write_dag`,
so that scan is what serializes a newly deployed DAG. Removing or skipping it would
leave deployed pipelines unrunnable.

Tests: `tests/unit/ingestion_pipeline/test_get_dagbag.py` - the bag comes back empty
over a populated folder, `collect_dags` is never called, and `process_file` still
bags the deployed DAG and only that DAG. All three fail before this change.

* fix(airflow-apis): keep the pre-3.0 DagBag path unchanged

`collect_dags` was only added to `DagBag.__init__` in Airflow 2.5 (absent in 2.4.0,
present in 2.5.3), and the plugin declares `apache-airflow>=2.2.2`, so passing it
unconditionally raised `TypeError` on 2.2 through 2.4 and failed every deploy there.

Scope the change to Airflow >= 3.0, which is where the regression is. Below 3.0 the
bag is still built with `read_dags_from_db=True`, which early returns out of
`collect_dags`, so that path never walked the DAG folder and needs no change.

Gate the new tests on Airflow 3 for the same reason.

* fix(airflow-apis): unblock airflow-apis-tests on Airflow 3.3

`TestAirflowOps.setUpClass` passed `include_examples=False` to `DagBag`. Airflow 3.3
dropped that keyword -- DAG discovery is bundle based there, so example DAGs are no
longer a constructor flag -- and Python raises `TypeError` for an unknown keyword.
The call is in class setup, so all three tests in the class error before running.

This is unrelated to the DagBag change in this branch: the test builds its own DagBag
and never calls `get_dagbag`. It broke when the Airflow pin moved from 3.2.2 to 3.3.0
in #31338, and has failed on every branch that reached this job since. Fixed here only
because the job has to be green for this branch to be validated; happy to split it out.

Detect the keyword instead of assuming it, matching the `sync_to_db` and `bag_dag`
compatibility checks already in this setup, so the test keeps working on Airflow 2.x
and on 3.x.

Not changed: the workflow's `paths` filter still only watches
`openmetadata-airflow-apis/**`, so a pin bump in `ingestion/setup.py` cannot trigger
the suite it affects -- which is why this went unnoticed. Widening it would run a
24 minute docker-stack job on a file that changed 26 times in the last 90 days
against this module's 5, so that tradeoff is left to maintainers.

* fix(ops): scale the deploy-pipelines chunk deadline with the chunk size (#31976)

* fix(ops): scale the deploy-pipelines chunk deadline with the chunk size

deploy-pipelines POSTs chunks of pipeline IDs to the bulk deploy endpoint,
which registers each pipeline sequentially, but bounded the request with a
fixed 2 minute deadline. At the default chunk size of 20 that budgets 6
seconds per pipeline, which a freshly restarted pipeline service does not
meet, so the client abandoned requests whose work was still progressing.

A client deadline does not cancel the server, so the abandoned chunk kept
deploying while the command marked all 20 pipelines FAILED and exited 1. A
Kubernetes restartPolicy of OnFailure then replayed the whole run on top of
work still in flight, adding load to an operation that was already
succeeding. On a catalog of 92 pipelines this reported failure while 90 were
deployed.

Budget the deadline per pipeline and multiply by the chunk size, so it no
longer silently becomes too short as a catalog grows, and expose the chunk
size and the per-pipeline budget as options. The command previously accepted
none, so neither value was reachable from a deployment configuration.

Extract the deadline calculation and the failure check as static functions so
the scaling and the exit code are unit testable without a database.

Reporting is left unchanged: an abandoned chunk is still recorded as failed.
The persisted deployed flag cannot correct it, because the deploy path only
ever sets it to true and never resets it, so it records whether a pipeline was
ever deployed rather than what this run did. Reading it to clear a timeout
would turn a genuine failure into a silent success on any redeploy. A per-run
answer needs the deploy response itself, which is a separate change.

* fix(ops): reject a non-positive deploy-pipelines chunk size

Exposing --chunk-size made a value that was previously hardcoded to 20
reachable from outside, and chunkList advances its loop with i += chunkSize.
A chunk size of 0 never advances, appending empty chunks until the heap is
exhausted, and a negative size makes subList throw, which the surrounding
handler turns into every pipeline being reported as FAILED.

Validate both options before the deploy runs and report each offending value,
rather than clamping, so a mistyped flag is not silently replaced by a
different deadline. Guard chunkList as well, so a non-positive size fails
loudly instead of spinning if another caller ever skips validation.

A non-positive --seconds-per-pipeline was already safe, since the deadline
floors at the previous fixed 2 minutes, but it is rejected too rather than
silently falling back to the deadline this option exists to move away from.

Drops the deployChunkTimeout(0, 30) assertion, which implied a chunk size of
0 was supported when it now fails validation.

* test(ops): cover picocli binding for the deploy-pipelines options

Parsing the command with picocli asserts the new options bind to the values
passed on the command line and that the declared defaults still match the
20 and 30 the description documents. Neither was covered: the existing tests
call the helpers directly, so a mistyped option name or a default drifting
from its description would not have failed anything.

Reads the defaults from the command spec rather than the parse result, since
matchedOptionValue only reports options actually present on the command line.

Needs no database, so it stays a unit test.

* chore: re-trigger CI after linking issue #32114

* chore: re-trigger CI

This branch was previously deployed

1 inactive deployment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Ingestion 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.

4 participants