Skip to content

[1.13] ci: run PR code on pull_request only and retire the safe to test label - #35435

Merged
pmbrull merged 5 commits into
1.13from
pmbrull/retire-safe-to-test-1.13
Nov 10, 2026
Merged

pmbrull merged 5 commits into
1.13from
pmbrull/retire-safe-to-test-1.13

Conversation

@pmbrull

@pmbrull pmbrull commented Oct 14, 2026 •

Copy link
Copy Markdown
Member

Describe your changes:

Alignment update (2026-11-10): refreshed onto current 1.13 and pushed 4e7e3e7d55d. Independent self-review of the workflow changes and the separate formatter-target repair found no blocking regressions. Commit and push hooks passed. The 1.13 ruleset now requires its eight existing contexts, and latest-push approval is enabled for the main rollout.

No linked issue — CI hardening, labelled skip-pr-checks. Release-branch backport of #35426; merge this before #35426. Companion backports: #35433 (2.0), #37470 (2.1, replacing closed #36403). Already released patch branches need no separate backport.

pull_request_target always runs the default branch's workflow file (GitHub behaviour since 2025-12-08), so PRs into 1.13 currently run main's pull_request_target copies of these workflows; 1.13's own copies never run. #35426 moves main's copies to pull_request, which reads the workflow from the PR's merge commit, i.e. 1.13's own copies — and those still trigger only on pull_request_target. Without this backport, 1.13 PRs would stop reporting java-checkstyle, py-checkstyle and py-tests-status, all required by 1.13.x-protection.

This converts 1.13's own copies with the same rules as #35426 (ADR:2026-10-14-pr-code-never-runs-on-pull-request-target on main):

  • pull_request_target → pull_request (ui-checkstyle already had a pull_request trigger; its PRT trigger is dropped); labeled dropped; the "Wait for the labeler" / "Verify PR labels" gates and label clauses removed (ui-checkstyle's authorize job folded into its path conditions).
  • Steps that need a secret or a write token run only for same-repo, non-Dependabot PRs; fork and Dependabot PRs get the comment text in the job summary and an ::error:: annotation instead.
  • A workflow_dispatch of type generation for a fork PR stops before checking out the fork's code.
  • maven-build-collate dispatches Collate the way main's copy does, which is what 1.13 PRs get today: REST dispatch of openmetadata-dispatch.yml on the Collate branch matching the base (Collate 1.13, which takes the same sha / event inputs), with a 5,700 s wait. 1.13's own copy dispatched Collate main through a name lookup that only reads the first page of Collate's workflows (30 of 71). PR runs keep reporting to Collate as pull_request_target.

Files: integration-tests-mysql-elasticsearch, integration-tests-postgres-opensearch, playwright-postgresql-e2e, java-checkstyle, py-checkstyle, ui-checkstyle, validate-jsons-yamls, py-operator-build-test, maven-sonar-build, airflow-apis-tests, yarn-coverage, py-tests, py-tests-postgres, typescript-type-generation, maven-build-collate.

What changes for 1.13 PRs: they run 1.13's own versions of these workflows instead of main's, so the checks match the branch's code and tooling.

  • py-checkstyle has been a skipped no-op on 1.13 PRs since fix(ci): skip Python checkstyle for 1.13 PRs #32245 (main's copy skipped 1.13 because its tooling did not fit); it now runs 1.13's own checks and may surface existing drift.
  • py-tests runs 1.13's full unit and integration matrix for PRs that touch Python or the service.

Required-check alignment: both existing Java integration lanes run on pull_request without label authorization. playwright-summary reports on PRs, fails when an expected build or test run fails, and accepts only deliberate skips for drafts, unrelated paths, or PRs without cloud-connector secrets. Test-report writes skip fork and Dependabot PRs. The stale integration-tests-postgres-elasticsearch-redis requirement was removed from the ruleset because this branch has no such workflow. The remaining legacy target-only workflows are not required checks and remain inert under GitHub's default-branch execution rule.

Type of change:

  • Improvement

High-level design:

Same as #35426; see the rule list above.

Tests:

Use cases covered

  • Same-repo 1.13 PR: the converted workflows run on pull_request; java-checkstyle, py-checkstyle, ui-checkstyle, checkstyle and py-tests-status report.
  • Fork / Dependabot 1.13 PR: required checks report; secret-backed browser scenarios and privileged report/comment writes are explicitly skipped.

Unit tests

python -m pytest .github/scripts/tests/test_pr_workflow_gates.py -q --tb=short: 15 passed. Trigger and summary-gate cases failed before the repair; report-write guard cases also failed before adding the origin checks. A Make dry-run regression also verifies that formatting and linting remain separate commands. The summary tests execute the actual workflow Bash for success, legitimate skips, build/test failure, cancellation, unexpected skips, and failed/missing change detection.

Backend integration tests / Playwright

Full application suites and GitHub CI are pending. The workflow commands are preserved; this change repairs their trigger and required-result reporting.

Python formatting

Reproduced the existing isort failure, then applied the branch's pycln/isort/Black targets. The resulting 47 Python files preserve their syntax trees after normalizing import order; only two have an AST import-order difference. Full make py_format_check passes over 2,323 files. The first new CI run confirmed that all formatters passed, then exposed a legacy Pylint 9.99/10 failure. The workflow explicitly defers linting until 10/10, so py_format_check now runs only its formatters; the existing standalone make lint target is unchanged. The new Make regression failed before this repair and passes afterward. Full application and GitHub CI remain pending.

Manual testing performed

  1. yaml.safe_load on all 15 changed workflows.
  2. actionlint before/after on the same files: no new findings (58 → 54); maven-build-collate.yml has none.
  3. Static check over every step: no remaining pull_request_target trigger, labeled type, label gate or allow-unsafe-pr-checkout; every step using a non-GITHUB_TOKEN secret or writing to the PR is gated for same-repo, non-Dependabot PRs.
  4. This PR runs 1.13's converted workflows on itself through pull_request; main's pull_request_target copies also run until ci: run PR code on pull_request only and retire the safe to test label #35426 merges, so some check names appear twice.

UI screen recording:

Not applicable — CI configuration only.

Checklist:

  • I have read the CONTRIBUTING document.
  • My PR title is Fixes <issue-number>: <short explanation> — no linked issue; CI hardening, labelled skip-pr-checks.
  • My PR is linked to a GitHub issue via Fixes #<issue-number> above — see above.
  • I have commented on my code, particularly in hard-to-understand areas.
  • For JSON Schema changes: not applicable.
  • For a UI feature or feature task: not applicable.
  • I have added tests (unit / integration / Playwright as applicable) and listed them above — CI configuration; the checks run are listed above.
  • Decision check: follows ADR:2026-10-14-pr-code-never-runs-on-pull-request-target (added on main by ci: run PR code on pull_request only and retire the safe to test label #35426).

🤖 Generated with Claude Code

…st label

Backports the trigger change of #35426 to 1.13. pull_request_target
always runs the default branch's workflow file, so 1.13 PRs have been
running main's copies of these workflows. Once main stops triggering
them on pull_request_target, 1.13 PRs only get the checks their own
branch defines on pull_request, which reads the workflow from the PR's
merge commit. Without this change they would lose java-checkstyle,
py-checkstyle, py-tests-status and the rest.

The twelve 1.13 workflows that check out or run PR code move to
pull_request and drop the "safe to test" label gate. Sonar PR scans,
bot comments, the generated-types auto-commit and the Collate dispatch
run only for same-repo, non-Dependabot PRs; the Collate dispatch still
reports a PR run as pull_request_target, the event Collate keys its PR
mode on. Checkstyle failures also go to an error annotation and the
job summary so fork PRs see the fix, and a typescript-type-generation
dispatch for a fork PR stops instead of checking out its code.
@pmbrull pmbrull added the skip-pr-checks Bypass PR metadata validation check label Oct 14, 2026
@pmbrull pmbrull added the skip-pr-checks Bypass PR metadata validation check label Oct 14, 2026
@github-actions github-actions Bot added Ingestion safe to test Add this label to run secure Github workflows on PRs labels Oct 14, 2026
… name

1.13 PRs have so far run main's maven-build-collate.yml, which builds
Collate's 1.13 branch through the REST dispatch endpoint and waits up
to 95 minutes. The 1.13 copy dispatched Collate main instead, by
workflow name through the-actions-org/workflow-dispatch with a 1-hour
wait, so once 1.13 PRs run their own copy they would build main-only
Collate code against a 1.13 checkout.

Bring over main's branch resolution and REST dispatch so 1.13 PRs keep
building Collate 1.13, whose openmetadata-dispatch.yml takes the same
sha and event inputs. PR runs still report the event as
pull_request_target.
@sonarqubecloud

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown
Contributor

The Python checkstyle failed.

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

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

Report Java integration checks on pull_request and propagate expected Playwright build and test failures. Guard report writes and secret-backed browser tests on fork and Dependabot PRs. Repair existing Python formatting violations without changing runtime behavior.
@pmbrull
pmbrull requested a review from a team as a code owner November 10, 2026 07:47
@pmbrull
pmbrull requested review from ulixius9 and removed request for a team November 10, 2026 07:47
@github-actions

Copy link
Copy Markdown
Contributor

The Python checkstyle failed.

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

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

Comment on lines +53 to +55
for view_name in self.inspector.get_view_names(
schema_name
) # pyright: ignore[reportAttributeAccessIssue]

@gitar-bot gitar-bot Bot Nov 10, 2026 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Bug: Black reflow moved # pyright: ignore comments off the erroring line

Reformatting these lines with black moved each trailing # pyright: ignore[...] onto a closing ) line. Pyright only suppresses a diagnostic when the ignore comment sits on the same line as the diagnostic. The diagnostics are still reported where they were: self.inspector.get_view_names( / get_materialized_view_names( in common_pg_mappings.py (lines 53/61, comments now on 55/63), self.context.get().table_data.Name in glue/metadata.py (line 422, comment on 423) and self.involved_tables or [] in lineage/parser.py (line 230, comment on 231). reportAttributeAccessIssue is configured as error. Because the reflow also moved these expressions to new columns, entries in .basedpyright/baseline.json (which match on column range) are unlikely to cover them either. So the static-checks nox session in py-tests.yml will probably report new errors on the required py-tests check. Fix: put each ignore on the line that opens the flagged expression, where black leaves trailing comments alone.

Anchor the ignore comment on the line that holds the flagged attribute access (same pattern for glue and parser.py):

            for view_name in self.inspector.get_view_names(  # pyright: ignore[reportAttributeAccessIssue]
                schema_name
            )
            or []
...
                for matview_name in self.inspector.get_materialized_view_names(  # pyright: ignore[reportAttributeAccessIssue]
                    schema_name
                )
                or []
...
        table_name = self.context.get().table_data.Name  # pyright: ignore[reportAttributeAccessIssue]  # fmt: skip
...
        for table in (
            self.involved_tables or []  # pyright: ignore[reportGeneralTypeIssues]
        ):

Was this helpful? React with 👍 / 👎

The Python Checkstyle workflow explicitly defers linting until the branch reaches 10/10, but py_format_check still invoked Pylint and failed at 9.99 after all formatters passed. Keep py_format_check limited to formatters; the existing lint target remains unchanged. Add a regression for both Make command boundaries.
@gitar-bot

gitar-bot Bot commented Nov 10, 2026

Copy link
Copy Markdown
Code Review ⚠️ Changes requested 0 closed / 1 findings

🔴 High risk · Converting 15 CI workflows from pull_request_target to pull_request changes code execution and secret gates; gating errors could expose credentials or misreport required checks.

Converts the 1.13 CI workflows from pull_request_target to pull_request and retires the safe to test label gate, so 1.13 PRs run their own checkstyle and test workflows. Changes requested: black reflow moved # pyright: ignore comments off the erroring lines in ingestion/src/metadata/ingestion/source/database/common_pg_mappings.py, ingestion/src/metadata/ingestion/source/database/glue/metadata.py and ingestion/src/metadata/ingestion/lineage/parser.py, so the static-checks session in py-tests.yml will likely fail on the required py-tests check. Move each ignore onto the line that opens the flagged expression.

⚠️ Bug: Black reflow moved # pyright: ignore comments off the erroring line

📄 ingestion/src/metadata/ingestion/source/database/common_pg_mappings.py:53-55 📄 ingestion/src/metadata/ingestion/source/database/common_pg_mappings.py:61-63 📄 ingestion/src/metadata/ingestion/source/database/glue/metadata.py:421-423 📄 ingestion/src/metadata/ingestion/lineage/parser.py:229-231

Reformatting these lines with black moved each trailing # pyright: ignore[...] onto a closing ) line. Pyright only suppresses a diagnostic when the ignore comment sits on the same line as the diagnostic. The diagnostics are still reported where they were: self.inspector.get_view_names( / get_materialized_view_names( in common_pg_mappings.py (lines 53/61, comments now on 55/63), self.context.get().table_data.Name in glue/metadata.py (line 422, comment on 423) and self.involved_tables or [] in lineage/parser.py (line 230, comment on 231). reportAttributeAccessIssue is configured as error. Because the reflow also moved these expressions to new columns, entries in .basedpyright/baseline.json (which match on column range) are unlikely to cover them either. So the static-checks nox session in py-tests.yml will probably report new errors on the required py-tests check. Fix: put each ignore on the line that opens the flagged expression, where black leaves trailing comments alone.

Anchor the ignore comment on the line that holds the flagged attribute access (same pattern for glue and parser.py)
            for view_name in self.inspector.get_view_names(  # pyright: ignore[reportAttributeAccessIssue]
                schema_name
            )
            or []
...
                for matview_name in self.inspector.get_materialized_view_names(  # pyright: ignore[reportAttributeAccessIssue]
                    schema_name
                )
                or []
...
        table_name = self.context.get().table_data.Name  # pyright: ignore[reportAttributeAccessIssue]  # fmt: skip
...
        for table in (
            self.involved_tables or []  # pyright: ignore[reportGeneralTypeIssues]
        ):
🤖 Prompt for agents
Code Review: Converts the 1.13 CI workflows from `pull_request_target` to `pull_request` and retires the `safe to test` label gate, so 1.13 PRs run their own checkstyle and test workflows. Changes requested: black reflow moved `# pyright: ignore` comments off the erroring lines in `ingestion/src/metadata/ingestion/source/database/common_pg_mappings.py`, `ingestion/src/metadata/ingestion/source/database/glue/metadata.py` and `ingestion/src/metadata/ingestion/lineage/parser.py`, so the `static-checks` session in `py-tests.yml` will likely fail on the required py-tests check. Move each ignore onto the line that opens the flagged expression.

1. ⚠️ Bug: Black reflow moved `# pyright: ignore` comments off the erroring line
   Files: ingestion/src/metadata/ingestion/source/database/common_pg_mappings.py:53-55, ingestion/src/metadata/ingestion/source/database/common_pg_mappings.py:61-63, ingestion/src/metadata/ingestion/source/database/glue/metadata.py:421-423, ingestion/src/metadata/ingestion/lineage/parser.py:229-231

   Reformatting these lines with black moved each trailing `# pyright: ignore[...]` onto a closing `)` line. Pyright only suppresses a diagnostic when the ignore comment sits on the same line as the diagnostic. The diagnostics are still reported where they were: `self.inspector.get_view_names(` / `get_materialized_view_names(` in common_pg_mappings.py (lines 53/61, comments now on 55/63), `self.context.get().table_data.Name` in glue/metadata.py (line 422, comment on 423) and `self.involved_tables or []` in lineage/parser.py (line 230, comment on 231). `reportAttributeAccessIssue` is configured as `error`. Because the reflow also moved these expressions to new columns, entries in `.basedpyright/baseline.json` (which match on column range) are unlikely to cover them either. So the `static-checks` nox session in py-tests.yml will probably report new errors on the required py-tests check. Fix: put each ignore on the line that opens the flagged expression, where black leaves trailing comments alone.

   Fix (Anchor the ignore comment on the line that holds the flagged attribute access (same pattern for glue and parser.py)):
               for view_name in self.inspector.get_view_names(  # pyright: ignore[reportAttributeAccessIssue]
                   schema_name
               )
               or []
   ...
                   for matview_name in self.inspector.get_materialized_view_names(  # pyright: ignore[reportAttributeAccessIssue]
                       schema_name
                   )
                   or []
   ...
           table_name = self.context.get().table_data.Name  # pyright: ignore[reportAttributeAccessIssue]  # fmt: skip
   ...
           for table in (
               self.involved_tables or []  # pyright: ignore[reportGeneralTypeIssues]
           ):

Verification

Rules No rules evaluated

Functional validation Not enabled

Set up

Auto-approval Not enabled

Set up

For more verification details, comment gitar display:verbose.

Options

Display: compact → Showing compact verification results.

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

Compact
gitar display:verbose         

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

@pmbrull
pmbrull merged commit c878654 into 1.13 Nov 10, 2026
59 of 80 checks passed
@pmbrull
pmbrull deleted the pmbrull/retire-safe-to-test-1.13 branch November 10, 2026 09:06
@pmbrull pmbrull mentioned this pull request Nov 10, 2026
7 tasks done

This branch had an error being deployed

1 failed deployment
test — 4e7e3e7d Deployed Nov 10, 2026 by pmbrull via playwright-ci-postgresql (4, 6) #114148
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.

1 participant