Skip to content

fix(security): move ingestion images to Python 3.12, drop build tooling, upgrade datamodel-code-gen. - #30911

Merged
harshsoni2024 merged 11 commits into
mainfrom
fix/bump_ingestion_doc_image_python_3_12_slim
Aug 6, 2026
Merged

harshsoni2024 merged 11 commits into
mainfrom
fix/bump_ingestion_doc_image_python_3_12_slim

Conversation

@harshsoni2024

@harshsoni2024 harshsoni2024 commented Aug 4, 2026 •

Copy link
Copy Markdown
Contributor

Describe your changes:

Follow-up to #30751. That PR patched PySpark's vulnerable jars in place; this one
addresses the frozen base layer underneath them and the build toolchain.

python:3.10-slim-bookworm is EOL and no longer rebuilt, so its Debian layer and bundled
Python tooling are frozen. All four ingestion Dockerfiles move to
python:3.12-slim-bookworm / apache/airflow:3.2.2-python3.12.

Key changes

  • Base bump to Python 3.12 across ingestion/Dockerfile{,.ci} and
    ingestion/operators/docker/Dockerfile{,.ci}. 3.12's ensurepip ships pip only — no
    setuptools, no wheel — which drops the vendored wheel-0.45.1 behind CVE-2026-24049.

  • datamodel-code-generator 0.25.6 → 0.64.0 — clears 8 HIGH (CVE-2026-54621, -54653,
    -54654, -54690, -54691, -55389, -55391, -55415). This was a real API migration, not a
    version bump; see below.

  • Bug fix: ingestion/Dockerfile pinned the Airflow Python 3.10 constraints file
    while building on a python3.12 base → now constraints-3.12.txt.

  • Regenerated airflow-constraints-3.2.2.txt from upstream's 3.12 variant. Both files
    come from the same 2026-05-26 generation run, so this is the matching sibling: it drops
    the py<3.11 backports (backports.strenum, exceptiongroup, tomli) and refreshes
    numpy/scipy/scikit-learn. The vendored file is byte-identical to upstream — verifiable
    with a single diff.

  • pip pinned to >=26.2,<27 on both sides of the USER switch. The pre-existing
    pip install --upgrade pip ran after that switch, so it only reached ~/.local and
    left the base image's copy on disk for scanners (CVE-2025-8869, CVE-2026-3219,
    CVE-2026-6357, CVE-2026-8643 — all fixed by 26.1.2). Python 3.12 alone is not enough:
    its bundled pip is 25.0.1. The <27 ceiling keeps a major bump out while letting 26.x
    patch releases in, since every pip CVE so far has been fixed within a minor line.

Type of change:

  • Bug fix
  • Improvement

High-level design:

The datamodel-code-generator migration. datamodel_code_generator.model.pydantic
held the Pydantic v1 models and was removed upstream in 0.60+, so the IMPORT_SECRET_STR
patch that swaps pydantic.SecretStr for our CustomSecretStr moves to
model.pydantic_v2. Same mechanism — a module global resolved at call time by
type_map_factory — and we already generate with --output-model-type pydantic_v2.BaseModel, so the patched map is the one actually consulted. Verified: 125
generated files carry CustomSecretStr, identical to 0.25.6, with no raw
pydantic.SecretStr leaking through. All four post-processing steps hit the same anchors
as before — the (?U) unicode-flag rewrite, the Union import injection into app.py,
the 6 stripped (?!::) lookaheads, and the AwareDatetime → datetime substitution in
basic.py — and EntityName('a::b') still constructs, so the FQN encode/decode contract
in transform_entity_names is intact.

The bump also fixes 10 modules that fail to import today under pydantic 2.11: RootModel
does not support model_config['extra'] (eventBasedEntityTrigger,
periodicBatchEntityTrigger, resolveTask, createWorkflowDefinition), plus a
name-shadowing bug that left lifeCycle bound to None in 6 entity/ai modules. 0.64.0 drops
extra from RootModels and disambiguates via import aliases; the full tree now imports
1048/1048, up from 1038/1048. The builders.py change follows from $ref'd schema
defaults now being honored.

Why the airflow images need /usr/local/bin/python -m pip rather than plain pip:
three independent reasons, all verified in the base image —

  1. as root, pip resolves to airflow's /root/bin/pip wrapper, which exit 1s (so a
    plain pip line fails the build, it doesn't silently no-op);
  2. that wrapper execs ${HOME}/.local/bin/pip even for non-root, so it can never reach
    the interpreter-level install;
  3. bare python as root resolves to /home/airflow/.local/bin/python, so python -m pip
    also targets ~/.local.

Only /usr/local/bin/python (→ /usr/python/bin/python3) reaches the copy scanners
report. The slim images are ordinary python:3.12-slim-bookworm with no wrapper, so plain
pip is correct there.

Alternative rejected — lifting setuptools<81. setuptools ≥83 fixes CVE-2026-59890,
but ≥81 deprecates and ≥83 removes pkg_resources, and sqlalchemy_redshift/__init__.py:1
imports it unguarded at module top level, with sqlalchemy-redshift==0.8.14 (2023) being
the final release. Worth noting the CVE is an sdist MANIFEST.in exclusion bypass via
Unicode normalization collision on macOS APFS/HFS+ — no reachable path in a Linux
runtime image that never builds sdists. Left as a documented residual.

Rollout / compatibility. cx_Oracle 8.3.0 and mysqlclient==2.1.1 have no cp312 wheel
but both build cleanly from sdist on 3.12 (the toolchain and pkg-config are already
installed) — verified in a container. Bumping mysqlclient to 2.2.x for a prebuilt wheel
is a sensible follow-up but is not required here.

Note on how ECR/Inspector reports these

Inspector reads Requires-Dist out of installed dist-info/METADATA without evaluating
environment markers
, so a ; extra == 'dev' declaration is reported as a dependency of
an installed package even when nothing installs it. That is why the
datamodel-code-generator findings are fixed by bumping the declared pin rather than
by removing the package: an earlier revision of this PR ran pip uninstall in the two CI
images, which cleared nothing, and has been dropped.

Tests:

Use cases covered

  • All four ingestion images build on Python 3.12.
  • The airflow image installs openmetadata-managed-apis under the matching 3.12
    constraints file.
  • Codegen produces an identical CustomSecretStr surface on 0.64.0.

Unit tests

  • Not applicable — Dockerfile, constraints and codegen-script changes. Generated output
    is verified by full-tree import and diff against 0.25.6 output (below) rather than by new
    tests.

Backend integration tests

  • Not applicable (no backend API changes).

Ingestion integration tests

  • Not applicable (no connector changes).

Playwright (UI) tests

  • Not applicable (no UI changes).

Manual testing performed

  1. docker buildx build --check clean on all four Dockerfiles.
  2. Verified pip install --upgrade pip as root in apache/airflow:3.2.2-python3.12 exits
    1, and that /usr/local/bin/python -m pip install "pip>=26.2,<27" exits 0 and lands
    in /usr/python/lib/python3.12/site-packages.
  3. Installed openmetadata-airflow-apis under the regenerated constraints file in the 3.12
    airflow base — succeeds, setuptools stays at the pinned 80.10.2, and pkg_resources
    still imports.
  4. Confirmed cx_Oracle 8.3.0 and mysqlclient==2.1.1 build from sdist on
    python:3.12-slim-bookworm.
  5. Regenerated the full model tree on 0.64.0: 125 files carry CustomSecretStr (identical
    to 0.25.6), no raw pydantic.SecretStr leaks, and 1048/1048 modules import.
  6. Built the release chain from scratch with no cached layers and inspected the result:
    pip is 26.2 and the only copy on disk; /usr/local/lib/python3.12/site-packages carries
    no setuptools or wheel (the only wheel left is setuptools/_vendor/wheel-0.46.3, past
    the 0.45.1 that carried CVE-2026-24049); openjdk-17-jre-headless resolves to the fixed
    17.0.20+8-1~deb12u1.

python:3.10-slim-bookworm is EOL and no longer rebuilt, so its Debian layer
and bundled Python tooling are frozen. Move all four ingestion images to
python:3.12-slim-bookworm / apache/airflow:3.2.2-python3.12.

- ingestion/Dockerfile pinned the Airflow *Python 3.10* constraints file
  while building on a python3.12 base; point it at constraints-3.12.txt.

- Regenerate the vendored airflow-constraints-3.2.2.txt from upstream's 3.12
  variant. Both come from the same 2026-05-26 generation run, so this is the
  matching sibling: it drops the py<3.11 backports (backports.strenum,
  exceptiongroup, tomli) and refreshes numpy/scipy/scikit-learn. Verified
  openmetadata-airflow-apis still installs under it and that the new
  setuptools==82.0.1 pin stays inert against the deliberate setuptools<81.

- Upgrade the interpreter-level pip to a pinned 26.2 before dropping
  privileges. The existing `pip install --upgrade pip` runs after the USER
  switch, so it only reached ~/.local and left the base image's copy on disk
  for scanners (CVE-2025-8869, CVE-2026-3219, CVE-2026-6357, CVE-2026-8643,
  fixed in 26.1.2). Python 3.12 alone is not enough - its bundled pip is
  25.0.1. The airflow images need the explicit /usr/local/bin/python: as
  root, `pip` hits airflow's wrapper and exits 1, and bare `python` resolves
  to /home/airflow/.local/bin/python, so both would miss the very copy this
  line exists to fix.

- Uninstall datamodel-code-generator and the black it depends on after the
  codegen step in the two CI images. Neither is imported at runtime; they
  exist only to run datamodel_generation.py, and account for eight HIGH
  findings. Bumping the pin is not an option - both codegen scripts
  monkeypatch datamodel_code_generator.model.pydantic.types.IMPORT_SECRET_STR
  (the CustomSecretStr swap), which no longer exists in 0.26+. The uninstall
  runs after the final pip install so no extra can pull them back in.

Python 3.12 also ships ensurepip without setuptools/wheel, removing the
vendored wheel-0.45.1 behind CVE-2026-24049.

Co-Authored-By: Claude Opus 5 <[email protected]>
Copilot AI review requested due to automatic review settings August 4, 2026 04:50
@harshsoni2024
harshsoni2024 requested a review from a team as a code owner August 4, 2026 04:50
@github-actions

github-actions Bot commented Aug 4, 2026

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 4, 2026
Comment thread ingestion/airflow-constraints-3.2.2.txt 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 updates OpenMetadata’s ingestion Docker images to Python 3.12–based upstream images and tightens what build tooling ends up shipped in runtime layers, primarily to reduce the container CVE surface (pip/tooling + stale base layers) while keeping Airflow 3.2.2 compatibility.

Changes:

  • Bump ingestion image bases to Python 3.12 (python:3.12-slim-bookworm / apache/airflow:3.2.2-python3.12) and fix the Airflow constraints URL to the constraints-3.12.txt variant.
  • Refresh interpreter-level pip before dropping privileges, and remove codegen-only tooling (datamodel-code-generator, black) from CI images.
  • Regenerate/update ingestion/airflow-constraints-3.2.2.txt to the Python 3.12 sibling set.

Reviewed changes

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

Show a summary per file
File Description
ingestion/operators/docker/Dockerfile.ci Base bump to Python 3.12, pre-user pip pinning, and CI-only uninstall of codegen tooling.
ingestion/operators/docker/Dockerfile Base bump to Python 3.12 and pre-user pip pinning.
ingestion/Dockerfile.ci Airflow base bump to Python 3.12, interpreter-level pip pin, and CI-only uninstall of codegen tooling.
ingestion/Dockerfile Airflow base bump to Python 3.12, interpreter-level pip pin, and fix managed-apis Airflow constraints URL to 3.12.
ingestion/airflow-constraints-3.2.2.txt Updated constraints content/header for the Python 3.12-generated set.
Suppressed comments (2)

ingestion/Dockerfile:101

  • This adds a root-level pin to pip==26.2, but later the image still runs pip install --upgrade pip "setuptools<81" as the airflow user, which will pull an unpinned pip version and makes the build non-reproducible (and could reintroduce pip CVEs in the user site-packages). Pin pip there as well to match the intent of this change.
# The explicit interpreter path is required, not stylistic: as root, `pip` resolves to
# airflow's /root/bin/pip wrapper, which exits 1 (and for non-root execs ~/.local/bin/pip),
# and bare `python` resolves to /home/airflow/.local/bin/python. Both would miss the very
# copy this line exists to fix.
RUN /usr/local/bin/python -m pip install --no-cache-dir --upgrade "pip==26.2"

ingestion/Dockerfile.ci:107

  • This pins interpreter-level pip to 26.2, but the Dockerfile later runs pip install --upgrade pip "setuptools<81" as the airflow user. That pulls an unpinned pip version and undermines reproducibility (and can reintroduce pip CVEs via the user site-packages). Pin pip there as well.
# The explicit interpreter path is required, not stylistic: as root, `pip` resolves to
# airflow's /root/bin/pip wrapper, which exits 1 (and for non-root execs ~/.local/bin/pip),
# and bare `python` resolves to /home/airflow/.local/bin/python. Both would miss the very
# copy this line exists to fix.
RUN /usr/local/bin/python -m pip install --no-cache-dir --upgrade "pip==26.2"

Comment thread ingestion/Dockerfile Resolved
Comment thread ingestion/Dockerfile.ci Resolved
Comment thread ingestion/operators/docker/Dockerfile Resolved
@github-actions

github-actions Bot commented Aug 4, 2026 •

Copy link
Copy Markdown
Contributor

✅ Playwright Results — workflow succeeded

Validated commit 396b9684cadcd3e508ec5d7bb07ca74421a5ab7e in Playwright run 31084018250, attempt 1.

✅ 610 passed · ❌ 0 failed · 🟡 0 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) 52m 29s

⏱️ Max setup 3m 23s · max shard execution 18m 35s · max shard-job elapsed before upload 21m 46s · reporting 5s

🌐 209.33 requests/attempt · 2.75 app boots/UI scenario · 12.56% common-shard skew

Optimization targets still in progress:

  • Browser traffic was 209.33 requests per attempt (convergence target: fewer than 200).
  • Application boot ratio was 2.75 per UI scenario (1762 boots / 640 scenarios; convergence target: at most 1).
Shard Passed Failed Flaky Skipped Lifecycle failed Lifecycle flaky
✅ Shard chromium-01 137 0 0 0 0 0
✅ Shard chromium-02 126 0 0 0 0 0
✅ Shard chromium-03 136 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 32 0 0 0 0 0
✅ Shard ingestion-02 29 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

📦 Download artifacts

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

…mages

Drop the datamodel-code-generator/black uninstall from the two CI images. It
cleared no scanner findings: ECR/Inspector reads Requires-Dist out of
dist-info/METADATA without evaluating environment markers, so the
`; extra == 'dev'` declaration in openmetadata_ingestion's metadata is reported
whether or not the package is installed -- and the prod Dockerfiles never
installed it to begin with. The black findings it also targeted came from
spaCy's tests/package/requirements.txt fixture, already deleted by
patch_pyspark_jars.sh. Removing the pin from the declared dev extra is tracked
separately.

Pin the post-USER pip install to 26.2 in all four Dockerfiles, not just the two
that were flagged. An unpinned `--upgrade pip` makes the image a moving target;
with both pins matching, the user-scope install is already satisfied and writes
nothing to ~/.local, leaving a single pip on disk.

Complete the CVE comment in the two airflow Dockerfiles ("-- 26.1.2" ->
"-- fixed in 26.1.2") to match the phrasing already used in operators/docker,
and reword the comment above the root-stage pin so it no longer quotes the old
command text.
Copilot AI review requested due to automatic review settings August 4, 2026 10:42
@harshsoni2024 harshsoni2024 added the skip-pr-checks Bypass PR metadata validation check label Aug 4, 2026

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 5 out of 5 changed files in this pull request and generated no new comments.

@harshsoni2024

harshsoni2024 commented Aug 4, 2026 •

Copy link
Copy Markdown
Contributor Author

Code Review 👍 Approved with suggestions 1 resolved / 2 findings
Migrates all four ingestion Dockerfiles to Python 3.12-slim-bookworm, dropping vulnerable setuptools/wheel tooling and aligning pip to 26.2. Consider resolving the setuptools version conflict in the regenerated constraints and restoring the removal step for CVE-carrying codegen tools in CI images.

💡 Security: CVE-carrying codegen tools no longer removed from .ci images
📄 ingestion/Dockerfile.ci:135-138 📄 ingestion/Dockerfile.ci:182-185 📄 ingestion/operators/docker/Dockerfile.ci:141-143 📄 ingestion/operators/docker/Dockerfile.ci:157-160

This commit deletes the RUN pip uninstall -y datamodel-code-generator black step from both .ci Dockerfiles, so datamodel-code-generator==0.25.6 and black now remain installed in the built images even though they are only used to run the codegen step and nothing imports them at runtime. This directly reverses the CVE-reduction goal of the PR, and the PR description still carries the rationale for removing (not bumping) these packages, making the description stale relative to the code. If these images are published, confirm the reintroduced CVEs are acceptable; otherwise restore the uninstall step (placed after the final pip install so nothing pulls it back in).

✅ 1 resolved
✅ Edge Case: Regenerated constraints pin setuptools==82.0.1, conflicting with <81 invariant

📄 ingestion/airflow-constraints-3.2.2.txt:622 📄 ingestion/Dockerfile.ci:117-119 📄 ingestion/Dockerfile.ci:125 📄 ingestion/Dockerfile.ci:129
The regenerated airflow-constraints-3.2.2.txt newly pins setuptools==82.0.1 (and wheel==0.47.0). This constraint file is passed to pip install ... --constraint /home/airflow/airflow-constraints-3.2.2.txt in ingestion/Dockerfile.ci (fab provider install and the openmetadata-airflow-apis install), yet the same image earlier pins setuptools<81 because setuptools>=81 drops pkg_resources, which sqlalchemy-redshift imports unguarded (per this PR's own rationale). Today the resolver leaves setuptools at 80.10.2 (verified in the PR), so it is a latent inconsistency rather than an active break — but if a future dependency bump makes setuptools part of the resolved set for one of these constrained installs, the constraint would silently upgrade it to 82.0.1 and break pkg_resources/sqlalchemy-redshift. Consider adding setuptools<81 to the constraints file (or removing the setuptools pin from it) so the two mechanisms cannot diverge.

🤖 Prompt for agents

Code Review: Migrates all four ingestion Dockerfiles to Python 3.12-slim-bookworm, dropping vulnerable setuptools/wheel tooling and aligning pip to 26.2. Consider resolving the setuptools version conflict in the regenerated constraints and restoring the removal step for CVE-carrying codegen tools in CI images.

1. 💡 Security: CVE-carrying codegen tools no longer removed from .ci images
   Files: ingestion/Dockerfile.ci:135-138, ingestion/Dockerfile.ci:182-185, ingestion/operators/docker/Dockerfile.ci:141-143, ingestion/operators/docker/Dockerfile.ci:157-160

   This commit deletes the `RUN pip uninstall -y datamodel-code-generator black` step from both `.ci` Dockerfiles, so `datamodel-code-generator==0.25.6` and `black` now remain installed in the built images even though they are only used to run the codegen step and nothing imports them at runtime. This directly reverses the CVE-reduction goal of the PR, and the PR description still carries the rationale for removing (not bumping) these packages, making the description stale relative to the code. If these images are published, confirm the reintroduced CVEs are acceptable; otherwise restore the uninstall step (placed after the final pip install so nothing pulls it back in).

Options
Display: compact → Showing less information.

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

Compact

gitar display:verbose         

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

@gitar-bot , Thanks for the review
The uninstall cleared zero findings, which is why it went.

Inspector doesn't report these from installed packages — it reads Requires-Dist out of dist-info/METADATA without evaluating environment markers. Requires-Dist: datamodel-code-generator ==0.25.6 ; extra == 'dev' (line 591 of the published openmetadata_ingestion wheel) is counted whether or not anything installs it. The control case is apache-airflow: slim is built as filter_requirements({"airflow", …}) so it cannot be installed in that image at any commit, yet CVE-2026-48891 is still reported against it. No pip uninstall reaches a declaration.

On the published images specifically: only the .ci Dockerfiles install datamodel-code-generator. The prod operators/docker/Dockerfile installs the prebuilt wheel and never had it — verified at both the previous release commit and PR HEAD — so nothing is reintroduced there.

black is a separate story: dcg declares black>=19.10b0, so the installed version resolves to 26.5.1, past the fixes for all three CVEs (24.3.0 and 26.3.1). Those findings came from spaCy's tests/package/requirements.txt pinning black==22.3.0, which patch_pyspark_jars.sh deletes — and they're already absent from the latest scan, with installed black untouched.

Copilot AI review requested due to automatic review settings August 4, 2026 10:59

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

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

Suppressed comments (1)

ingestion/Dockerfile:3

  • The Airflow integration-test fixtures still hardcode the Python 3.10 Airflow base image (e.g., ingestion/tests/integration/airflow/Dockerfile and AIRFLOW_BASE_IMAGE in conftest.py). With the production/CI ingestion images moving to python3.12, the integration tests will no longer validate the same base/runtime, which risks regressions going undetected.
FROM apache/airflow:3.2.2-python3.12

@harshsoni2024

Copy link
Copy Markdown
Contributor Author

Code Review 👍 Approved with suggestions 1 resolved / 2 findings
Migrates all four ingestion Dockerfiles to Python 3.12-slim-bookworm, dropping vulnerable setuptools/wheel tooling and aligning pip to 26.2. Consider resolving the setuptools version conflict in the regenerated constraints and restoring the removal step for CVE-carrying codegen tools in CI images.

💡 Security: CVE-carrying codegen tools no longer removed from .ci images
📄 ingestion/Dockerfile.ci:135-138 📄 ingestion/Dockerfile.ci:182-185 📄 ingestion/operators/docker/Dockerfile.ci:141-143 📄 ingestion/operators/docker/Dockerfile.ci:157-160

This commit deletes the RUN pip uninstall -y datamodel-code-generator black step from both .ci Dockerfiles, so datamodel-code-generator==0.25.6 and black now remain installed in the built images even though they are only used to run the codegen step and nothing imports them at runtime. This directly reverses the CVE-reduction goal of the PR, and the PR description still carries the rationale for removing (not bumping) these packages, making the description stale relative to the code. If these images are published, confirm the reintroduced CVEs are acceptable; otherwise restore the uninstall step (placed after the final pip install so nothing pulls it back in).

✅ 1 resolved
✅ Edge Case: Regenerated constraints pin setuptools==82.0.1, conflicting with <81 invariant

📄 ingestion/airflow-constraints-3.2.2.txt:622 📄 ingestion/Dockerfile.ci:117-119 📄 ingestion/Dockerfile.ci:125 📄 ingestion/Dockerfile.ci:129
The regenerated airflow-constraints-3.2.2.txt newly pins setuptools==82.0.1 (and wheel==0.47.0). This constraint file is passed to pip install ... --constraint /home/airflow/airflow-constraints-3.2.2.txt in ingestion/Dockerfile.ci (fab provider install and the openmetadata-airflow-apis install), yet the same image earlier pins setuptools<81 because setuptools>=81 drops pkg_resources, which sqlalchemy-redshift imports unguarded (per this PR's own rationale). Today the resolver leaves setuptools at 80.10.2 (verified in the PR), so it is a latent inconsistency rather than an active break — but if a future dependency bump makes setuptools part of the resolved set for one of these constrained installs, the constraint would silently upgrade it to 82.0.1 and break pkg_resources/sqlalchemy-redshift. Consider adding setuptools<81 to the constraints file (or removing the setuptools pin from it) so the two mechanisms cannot diverge.

🤖 Prompt for agents

Code Review: Migrates all four ingestion Dockerfiles to Python 3.12-slim-bookworm, dropping vulnerable setuptools/wheel tooling and aligning pip to 26.2. Consider resolving the setuptools version conflict in the regenerated constraints and restoring the removal step for CVE-carrying codegen tools in CI images.

1. 💡 Security: CVE-carrying codegen tools no longer removed from .ci images
   Files: ingestion/Dockerfile.ci:135-138, ingestion/Dockerfile.ci:182-185, ingestion/operators/docker/Dockerfile.ci:141-143, ingestion/operators/docker/Dockerfile.ci:157-160

   This commit deletes the `RUN pip uninstall -y datamodel-code-generator black` step from both `.ci` Dockerfiles, so `datamodel-code-generator==0.25.6` and `black` now remain installed in the built images even though they are only used to run the codegen step and nothing imports them at runtime. This directly reverses the CVE-reduction goal of the PR, and the PR description still carries the rationale for removing (not bumping) these packages, making the description stale relative to the code. If these images are published, confirm the reintroduced CVEs are acceptable; otherwise restore the uninstall step (placed after the final pip install so nothing pulls it back in).

Options
Display: compact → Showing less information.

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

Compact

gitar display:verbose         

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

@gitar-bot , addressed the comment here: #30911 (comment)

Comment thread ingestion/operators/docker/Dockerfile Resolved
…exactly

Pin becomes "pip>=26.2,<27" on both the root-stage and post-USER installs in all
four ingestion Dockerfiles. The floor still clears CVE-2025-8869, CVE-2026-3219,
CVE-2026-6357 and CVE-2026-8643 (fixed in 26.1.2); the ceiling keeps a major bump
out of the image. Every pip CVE so far has been fixed within a minor line, so an
exact pin would need a follow-up PR each time one lands.
Copilot AI review requested due to automatic review settings August 5, 2026 06:30
@harshsoni2024 harshsoni2024 changed the title fix(security): move ingestion images to Python 3.12, drop build tooling fix(security): move ingestion images to Python 3.12, drop build tooling, upgrade datamodel-code-gen. Aug 5, 2026
ulixius9
ulixius9 previously approved these changes Aug 6, 2026
@harshsoni2024
harshsoni2024 added this pull request to the merge queue Aug 6, 2026
@harshsoni2024
harshsoni2024 removed this pull request from the merge queue due to a manual request Aug 6, 2026
@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

🚦 Removed from the merge queue — manual (2026-08-06T07:48:41Z)

Blocked the queue: py-tests-status

  • py-tests — py-tests-status, python / Verify Expected Jobs, python / Unit Tests & Static Checks (3.10)

…generator 0.64.0

New call sites merged from main violate the stricter generated models: DataModel.columns
is required so get_column_info's None is invalid (and would fail pydantic at runtime),
Column.name is ColumnName, and Task.description is Markdown | None.

Verified against basedpyright 1.39.3: the two superset errors reproduce at the exact CI
positions before the change and are gone after. The airflow one is unverifiable locally
(apache-airflow not installed).

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

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 14 out of 15 changed files in this pull request and generated no new comments.

Suppressed comments (1)

ingestion/tests/integration/data_quality/test_data_quality.py:58

  • Typo in variable name test_difinitions_glob ("difinitions") makes the test harder to read and grep. Since this hunk was already touched, consider renaming it to test_definitions_glob and updating the loop variable accordingly.
    test_definition_path = cwd.parents[3] / "openmetadata-service/src/main/resources/json/data/tests"
    test_difinitions_glob = test_definition_path.glob("*.json")

    test_definitions_names: list[str] = []
    for test_definition_file in test_difinitions_glob:

@sonarqubecloud

sonarqubecloud Bot commented Aug 6, 2026

Copy link
Copy Markdown

@gitar-bot

gitar-bot Bot commented Aug 6, 2026

Copy link
Copy Markdown
Code Review 👍 Approved with suggestions 1 resolved / 2 findings

Bumps the ingestion Dockerfiles to Python 3.12 and pins pip to 26.2 to resolve base layer vulnerabilities. Consider whether to re-add the cleanup step for CVE-carrying codegen tools in the CI images.

💡 Security: CVE-carrying codegen tools no longer removed from .ci images

📄 ingestion/Dockerfile.ci:135-138 📄 ingestion/Dockerfile.ci:182-185 📄 ingestion/operators/docker/Dockerfile.ci:141-143 📄 ingestion/operators/docker/Dockerfile.ci:157-160

This commit deletes the RUN pip uninstall -y datamodel-code-generator black step from both .ci Dockerfiles, so datamodel-code-generator==0.25.6 and black now remain installed in the built images even though they are only used to run the codegen step and nothing imports them at runtime. This directly reverses the CVE-reduction goal of the PR, and the PR description still carries the rationale for removing (not bumping) these packages, making the description stale relative to the code. If these images are published, confirm the reintroduced CVEs are acceptable; otherwise restore the uninstall step (placed after the final pip install so nothing pulls it back in).

✅ 1 resolved
✅ Edge Case: Regenerated constraints pin setuptools==82.0.1, conflicting with <81 invariant

📄 ingestion/airflow-constraints-3.2.2.txt:622 📄 ingestion/Dockerfile.ci:117-119 📄 ingestion/Dockerfile.ci:125 📄 ingestion/Dockerfile.ci:129
The regenerated airflow-constraints-3.2.2.txt newly pins setuptools==82.0.1 (and wheel==0.47.0). This constraint file is passed to pip install ... --constraint /home/airflow/airflow-constraints-3.2.2.txt in ingestion/Dockerfile.ci (fab provider install and the openmetadata-airflow-apis install), yet the same image earlier pins setuptools<81 because setuptools>=81 drops pkg_resources, which sqlalchemy-redshift imports unguarded (per this PR's own rationale). Today the resolver leaves setuptools at 80.10.2 (verified in the PR), so it is a latent inconsistency rather than an active break — but if a future dependency bump makes setuptools part of the resolved set for one of these constrained installs, the constraint would silently upgrade it to 82.0.1 and break pkg_resources/sqlalchemy-redshift. Consider adding setuptools<81 to the constraints file (or removing the setuptools pin from it) so the two mechanisms cannot diverge.

🤖 Prompt for agents
Code Review: Bumps the ingestion Dockerfiles to Python 3.12 and pins pip to 26.2 to resolve base layer vulnerabilities. Consider whether to re-add the cleanup step for CVE-carrying codegen tools in the CI images.

1. 💡 Security: CVE-carrying codegen tools no longer removed from .ci images
   Files: ingestion/Dockerfile.ci:135-138, ingestion/Dockerfile.ci:182-185, ingestion/operators/docker/Dockerfile.ci:141-143, ingestion/operators/docker/Dockerfile.ci:157-160

   This commit deletes the `RUN pip uninstall -y datamodel-code-generator black` step from both `.ci` Dockerfiles, so `datamodel-code-generator==0.25.6` and `black` now remain installed in the built images even though they are only used to run the codegen step and nothing imports them at runtime. This directly reverses the CVE-reduction goal of the PR, and the PR description still carries the rationale for removing (not bumping) these packages, making the description stale relative to the code. If these images are published, confirm the reintroduced CVEs are acceptable; otherwise restore the uninstall step (placed after the final pip install so nothing pulls it back in).

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

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 skip-pr-checks Bypass PR metadata validation check

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants