Skip to content

CI: Consolidate backend validation under shared entrypoints - #38801

Merged
manerow merged 31 commits into
mainfrom
ci-backend
Nov 30, 2026
Merged

manerow merged 31 commits into
mainfrom
ci-backend

Conversation

@IceS2

@IceS2 IceS2 commented Nov 26, 2026 •

Copy link
Copy Markdown
Collaborator

Describe your changes

Consolidate backend CI into ci-pr, ci-merge-queue, and ci-nightly. PRs and merge groups now detect relevant changes once and share the resulting workload selection across Java, Python, and config checks. Pushes to main no longer run these checks.

Type of change

  • Improvement

High-level design

  • A reusable planner matches one path configuration and applies the workload rules for each event. Python, UI and backend each report their required status through the shared ci-status-gate action, which runs on every non-draft PR and fails when the planner fails or a selected job does not succeed.
  • On PRs the backend runs as two jobs. backend-checks-status runs checkstyle, the service unit tests, the Kubernetes operator tests and the Docker smoke test as steps of one job, like py-tests-status. Each step runs only when the planner selects it and fails on its own, and the job ends with ci-status-gate. It builds the server image itself, and only when the smoke test is selected. validate-config runs the JSON/YAML, CI rule and quickstart compose checks as steps, including the Yarn plugin test that the deleted validate-jsons-yamls.yml ran; it is not required. The merge queue keeps backend-checks, the operator tests and the smoke test as separate jobs, because the integration tests wait for backend-checks. Both entrypoints use the same composite actions.
  • The merge queue builds the Java integration runtime once for all selected database profiles. The merge group already validates the merge candidate, so pushes to main no longer repeat the backend checks. This relies on the merge queue being enabled.
  • Nightly Python, all three Java integration setups (MySQL + Elasticsearch on the oldest MySQL, PostgreSQL + OpenSearch, and PostgreSQL + Elasticsearch + Redis), and Maven analysis now all run from one 01:00 UTC schedule in ci-nightly. Because pushes to main no longer run integration tests, the nightly is the daily run of every Java setup on main. A manual run can pick one workload, and each workload choice has its own concurrency key.
  • The Redis lane decision record now says that lane gates merges through the required backend-checks-status check.
  • A nightly failure alerts the team that owns the failed job. Python and ingestion jobs post to the ingestion channel and tag ingestion on-duty; the backend image, Java integration and Java Sonar jobs post to #ci-cleanup and tag Platform on-duty (a Sonar-only failure is not tagged). A job skipped because an upstream job failed is listed in that upstream owner's alert.

Local validation on the updated base passed the CI rule checks (208 tests, 2 runner-only skips), the Python CI tests, the Yarn plugin test, actionlint and the decision-record check. The broader CI-script suite had one existing merge-queue metrics failure that also reproduced on clean main.

Checklist

  • Reviewed the outgoing CI diff and covered event routing and planner failures.
  • Link the tracking issue before marking the PR ready.
  • Verify the workflow runs in GitHub. Required-check cutover: merge-rules requires backend-checks-status, py-tests-status, ui-tests-status, ui-checkstyle, ui-coverage and playwright-summary, and no longer backend-checks or the three integration-tests-* checks.

Summary by Gitar

  • Sonar analysis:
    • Runs Java Sonar analysis only on the nightly schedule via java-sonar action
  • Docker smoke test:
    • Builds only the backend image and narrows the docker-smoke path filter to image-affecting files
  • Test reports:
    • Retains failed Java surefire reports for seven days
  • Workflow pinning:
    • Pins reusable GitHub Actions to commit SHAs and skips dependency test compilation for operator checks
  • Path filters:
    • Moves path filters into .github/ci/paths.yml shared by PR, merge queue, and nightly planning
  • Workflow split:
    • Replaces the backend workflow with ci-pr, ci-merge-queue, and ci-nightly entrypoints
    • Replaces shell JSON/YAML validation with a Python validator running on Python 3.12
  • Dar workflow:
    • Moves data-access-request-e2e into the merge queue workflow, with 100-minute timeout
  • Planner:
    • Adds scripts/ci_plan.py selecting workloads per event and failing the Java and Python gates when planning fails
  • Validation:
    • Adds validate-ci-rules action and validate_ci_rules.sh running CI regression tests
  • Nightly alerts:
    • Adds nightly_summary.py writing a job-result table and posting a Slack alert on nightly failures
  • Manual dispatch:
    • Adds workload inputs to nightly and merge-queue workflows for selecting a subset of checks

This will update automatically on new commits.

@github-advanced-security github-advanced-security 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.

CodeQL found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.

Comment thread .github/workflows/ci-merge-queue.yml Resolved
Comment thread .github/workflows/ci-pr.yml Resolved
Comment thread .github/workflows/ci-pr.yml Outdated
Comment on lines +224 to +342
k8s_operator-unit-tests:
runs-on: ubuntu-latest
timeout-minutes: 30
needs: plan
if: ${{ needs.plan.outputs.java-operator == 'true' }}
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
ref: ${{ needs.plan.outputs.ref }}
persist-credentials: false
- name: Run Kubernetes operator unit tests
uses: ./.github/actions/java-k8s-operator-tests

docker-image-smoke-test:
runs-on: ubuntu-latest
timeout-minutes: 60
needs: [plan, backend]
if: ${{ needs.plan.outputs.docker-smoke == 'true' }}
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
ref: ${{ needs.plan.outputs.ref }}
persist-credentials: false
- name: Smoke test the server image
uses: ./.github/actions/java-docker-smoke

validate-json-yaml:
needs: plan
if: ${{ needs.plan.outputs.json-yaml == 'true' || needs.plan.outputs.ci-rules == 'true' }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
ref: ${{ needs.plan.outputs.ref }}
persist-credentials: false
- uses: ./.github/actions/setup-python
with:
python-version: '3.12'
- uses: ./.github/actions/validate-json-yaml
if: ${{ needs.plan.outputs.json-yaml == 'true' }}
- uses: ./.github/actions/validate-ci-rules
if: ${{ needs.plan.outputs.ci-rules == 'true' }}

validate-docker-compose:
needs: plan
if: ${{ needs.plan.outputs.quickstart-compose == 'true' }}
runs-on: ubuntu-latest
timeout-minutes: 30
env:
OPENMETADATA_DB_IMAGE: docker.getcollate.io/openmetadata/db:latest
OPENMETADATA_SERVER_IMAGE: docker.getcollate.io/openmetadata/server:latest
OPENMETADATA_INGESTION_IMAGE: docker.getcollate.io/openmetadata/ingestion:latest

steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7

with:
persist-credentials: false
- name: Validate OpenMetadata Docker Compose
uses: ./.github/actions/validate-omd-docker-compose
with:
compose_file: ./docker/docker-compose-quickstart/docker-compose.yml
health_check_timeout: 300

backend-checks-status:
name: backend-checks-status
needs: [plan, backend-checks, k8s_operator-unit-tests, docker-image-smoke-test]
runs-on: ubuntu-slim
timeout-minutes: 5
if: >-
${{ always() && github.event_name == 'pull_request' &&
(needs.plan.result != 'success' ||
needs.plan.outputs.checkstyle != 'false' ||
needs.plan.outputs.java-unit != 'false' ||
needs.plan.outputs.java-operator != 'false' ||
needs.plan.outputs.docker-smoke != 'false') }}
steps:
- name: Verify backend checks, operator tests, and Docker smoke test
env:
CHANGES_RESULT: ${{ needs.plan.result }}
CHECKSTYLE_CHANGED: ${{ needs.plan.outputs.checkstyle }}
JAVA_CHANGED: ${{ needs.plan.outputs.java-unit }}
K8S_CHANGED: ${{ needs.plan.outputs.java-operator }}
DOCKER_CHANGED: ${{ needs.plan.outputs.docker-smoke }}
SERVICE_RESULT: ${{ needs.backend-checks.result }}
K8S_RESULT: ${{ needs.k8s_operator-unit-tests.result }}
DOCKER_RESULT: ${{ needs.docker-image-smoke-test.result }}
run: |
if [[ "$CHANGES_RESULT" != "success" ]]; then
echo "::error::CI planning did not succeed: ${CHANGES_RESULT}"
exit 1
fi

fail=0
check() {
local name="$1" changed="$2" result="$3"
if [[ "$changed" != "true" ]]; then
echo "${name}: no relevant paths changed, skipped."
return
fi
if [[ "$result" != "success" ]]; then
echo "::error::${name} did not succeed (result=${result})"
fail=1
else
echo "${name}: success"
fi
}
backend_changed="false"
if [[ "$JAVA_CHANGED" == "true" || "$CHECKSTYLE_CHANGED" == "true" ]]; then
backend_changed="true"
fi
check "backend-checks" "$backend_changed" "$SERVICE_RESULT"
check "k8s_operator-unit-tests" "$K8S_CHANGED" "$K8S_RESULT"
check "docker-image-smoke-test" "$DOCKER_CHANGED" "$DOCKER_RESULT"
exit $fail

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.

These can be merged into a single job, max 2

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.

Done: on PRs the backend is now 2 jobs. backend-checks-status runs checkstyle, unit tests, k8s operator tests and the Docker smoke test as steps (only the ones the planner picks), and validate-config runs the JSON/YAML, CI rules and compose checks.
The merge queue keeps its separate jobs because the ITs wait for backend-checks.

Comment on lines +147 to +153
One final nightly job verifies the selected results and writes a workflow summary. On a failure it
posts the failed and incomplete jobs to Slack with a link to the run. Each alert goes to the team
that owns the job that failed: Python and ingestion jobs post to the ingestion channel and mention
`onduty-integrations`; the backend image, the Java integration runtime and tests, and Java Sonar
post to `#ci-cleanup` and mention `onduty-platform`. A job skipped because an upstream job failed
is listed in the upstream owner's alert, so a backend failure never mentions the ingestion team.
Sonar-only failures are reported without a mention.

@gitar-bot gitar-bot Bot Nov 27, 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.

💡 Quality: Decision text still says every nightly failure pages onduty-integrations

The v7 amendment (lines 147-153) says nightly alerts go to the team that owns the failed job, and that a backend-image failure "never mentions the ingestion team". The record's main Decision paragraph (lines 118-120) was not changed and still says "Scheduled and manual nightly failures notify ingestion Slack and mention onduty-integrations". So the same Accepted record now gives two conflicting rules. nightly_summary.py follows the amendment by posting backend and Java failures to the Platform channel, so a reader who relies on the Decision paragraph will look in the wrong place. Reword lines 118-120 to point at the owner-routing rule.

Make the Decision paragraph agree with the v7 routing rule:

Selected jobs must succeed; unexpected failures and skips fail the required status. Scheduled
and manual nightly failures notify the Slack channel and on-duty group of the team that owns the
failed job (see the nightly selection and reporting amendment); successful
or cancelled runs and PR/merge-queue modes stay silent.

Was this helpful? React with 👍 / 👎

@gitar-bot

gitar-bot Bot commented Nov 30, 2026

Copy link
Copy Markdown
Code Review 👍 Approved with suggestions 🔴 High risk 2 closed / 3 findings

Consolidating repo-wide PR and merge-queue gates around a shared workload planner could omit checks, allowing unvalidated changes to merge.

Consolidates backend CI into ci-pr, ci-merge-queue, and ci-nightly entrypoints with a shared planner and ci-status-gate action, and routes nightly failure alerts to the owning team. Manual dispatches of different workloads no longer cancel each other, and the required-check producer and routing contract now has a decision record.

  • Open: the main Decision paragraph in docs/decisions/2026-11-11-python-ci-selects-workloads-by-event.md (lines 118-120) still says nightly failures mention onduty-integrations, which conflicts with the v7 amendment (lines 147-153) and with nightly_summary.py. Reword that paragraph to point at the owner-routing rule.
💡 Quality: Decision text still says every nightly failure pages onduty-integrations

📄 docs/decisions/2026-11-11-python-ci-selects-workloads-by-event.md:118-120 📄 docs/decisions/2026-11-11-python-ci-selects-workloads-by-event.md:147-153

The v7 amendment (lines 147-153) says nightly alerts go to the team that owns the failed job, and that a backend-image failure "never mentions the ingestion team". The record's main Decision paragraph (lines 118-120) was not changed and still says "Scheduled and manual nightly failures notify ingestion Slack and mention onduty-integrations". So the same Accepted record now gives two conflicting rules. nightly_summary.py follows the amendment by posting backend and Java failures to the Platform channel, so a reader who relies on the Decision paragraph will look in the wrong place. Reword lines 118-120 to point at the owner-routing rule.

Make the Decision paragraph agree with the v7 routing rule
Selected jobs must succeed; unexpected failures and skips fail the required status. Scheduled
and manual nightly failures notify the Slack channel and on-duty group of the team that owns the
failed job (see the nightly selection and reporting amendment); successful
or cancelled runs and PR/merge-queue modes stay silent.
✅ 2 closed
✅ Bug: Manual dispatches of different workloads cancel each other

📄 .github/workflows/ci-merge-queue.yml:17-31 📄 .github/workflows/ci-pr.yml:20-33
The concurrency group is ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }} for every non-push event, and cancel-in-progress: true. Before this PR a dispatch could only run Python. Now ci-merge-queue can be dispatched as python, java or data-access-request, with a store-database-version input as well, so all of these land in the same group ci-merge-queue-workflow_dispatch-refs/heads/main. If someone dispatches data-access-request (up to about 100 minutes) and then dispatches java, the first run is cancelled without a word. ci-pr has the same problem with its python and quickstart-compose dispatches. ci-nightly already avoids this by adding a per-schedule suffix to its group. The fix is to add the dispatch inputs to the key.

✅ Quality: Required-check producer and routing contract has no decision record

📄 .github/workflows/ci-pr.yml:214-228 📄 .github/workflows/ci-merge-queue.yml:219-233 📄 scripts/ci_plan.py:20-34 📄 .github/ci/paths.yml:1-15
This PR changes a contract that the merge-rules ruleset has to agree with. The required checks backend-checks-status, py-tests-status and the three integration-tests-* contexts now come from ci-pr (where the integration placeholders are skipped on PRs) and from ci-merge-queue (where they actually run). The PR also makes .github/ci/paths.yml together with scripts/ci_plan.py the single source of workload selection for every event. The description says it needs to "coordinate the required-check name cutover", and nothing in docs/decisions/ records any of this. 2026-10-19-the-redis-cache-lane-gates-the-merge-queue.md still describes a per-lane workflow that "triggers on pull_request and skips every job there", and its Guard points reviewers at that workflow's trigger, which no longer exists. The record should state: "Required checks backend-checks-status, py-tests-status and integration-tests-{mysql-elasticsearch,postgres-opensearch,postgres-elasticsearch-redis} are emitted by ci-pr on PRs (the integration contexts skipped) and by ci-merge-queue in merge groups. Which workloads run for each event is decided only by .github/ci/paths.yml through scripts/ci_plan.py." It should also revise the Redis-lane record's Guard so it names ci-pr/ci-merge-queue.

🤖 Prompt for agents
Code Review: Consolidates backend CI into `ci-pr`, `ci-merge-queue`, and `ci-nightly` entrypoints with a shared planner and `ci-status-gate` action, and routes nightly failure alerts to the owning team. Manual dispatches of different workloads no longer cancel each other, and the required-check producer and routing contract now has a decision record.
  
  - Open: the main Decision paragraph in `docs/decisions/2026-11-11-python-ci-selects-workloads-by-event.md` (lines 118-120) still says nightly failures mention `onduty-integrations`, which conflicts with the v7 amendment (lines 147-153) and with `nightly_summary.py`. Reword that paragraph to point at the owner-routing rule.

1. 💡 Quality: Decision text still says every nightly failure pages onduty-integrations
   Files: docs/decisions/2026-11-11-python-ci-selects-workloads-by-event.md:118-120, docs/decisions/2026-11-11-python-ci-selects-workloads-by-event.md:147-153

   The v7 amendment (lines 147-153) says nightly alerts go to the team that owns the failed job, and that a backend-image failure "never mentions the ingestion team". The record's main Decision paragraph (lines 118-120) was not changed and still says "Scheduled and manual nightly failures notify ingestion Slack and mention `onduty-integrations`". So the same Accepted record now gives two conflicting rules. `nightly_summary.py` follows the amendment by posting backend and Java failures to the Platform channel, so a reader who relies on the Decision paragraph will look in the wrong place. Reword lines 118-120 to point at the owner-routing rule.

   Fix (Make the Decision paragraph agree with the v7 routing rule):
   Selected jobs must succeed; unexpected failures and skips fail the required status. Scheduled
   and manual nightly failures notify the Slack channel and on-duty group of the team that owns the
   failed job (see the nightly selection and reporting amendment); successful
   or cancelled runs and PR/merge-queue modes stay silent.

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

@manerow
manerow marked this pull request as ready for review November 30, 2026 11:18
@manerow
manerow requested review from a team, akash-jain-10 and harshach as code owners November 30, 2026 11:18
@manerow
manerow requested review from harshsoni2024 and removed request for a team November 30, 2026 11:18
@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.

@manerow
manerow merged commit 6301f23 into main Nov 30, 2026
52 of 54 checks passed
@manerow
manerow deleted the ci-backend branch November 30, 2026 12:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants