Skip to content

fix: org-gate 补 on: 触发器 + 中心仓跳过守卫(P3-1,ADR-0046) - #23

Merged
randypanding merged 1 commit into
mainfrom
p3-1-org-gate-triggers
Aug 20, 2026
Merged

fix: org-gate 补 on: 触发器 + 中心仓跳过守卫(P3-1,ADR-0046)#23
randypanding merged 1 commit into
mainfrom
p3-1-org-gate-triggers

Conversation

@randypanding

Copy link
Copy Markdown
Contributor

ruleset API 实测硬约束:required workflow 文件必须声明 pull_request/pull_request_target/merge_queue 触发器之一(否则 ruleset 创建报 Workflow must have one of the following triggers configured)。补 on: pull_request + merge_group;中心仓自身因 on: pull_request 触发的运行由 job 级守卫跳过(防与自测 ci.yml 重复)。

@coderabbitai

coderabbitai Bot commented Aug 20, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@randypanding, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 11 minutes

Limit details: You’ve used all 10 included reviews currently available.

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

Wait for the limit to reset, then comment @coderabbitai review or push new commits to the PR.

An organization admin can change what happens after included review limits in Billing.

How do review limits work?

CodeRabbit enforces per-developer PR review limits within each organization.

For paid Pro and Pro+ reviews, CodeRabbit uses a developer's included PR review attempts over the past 7 days to set the current hourly allowance. At typical activity levels, the full plan allowance applies. Higher sustained activity can lower the allowance until earlier attempts leave the 7-day window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 0f7cb8fa-30b1-4568-82fc-676050bfd070

📥 Commits

Reviewing files that changed from the base of the PR and between 5d4aed5 and 59f855e.

📒 Files selected for processing (1)
  • .github/workflows/org-gate.yml

Comment @coderabbitai help to get the list of available commands.

@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Make org-gate ruleset-compatible and skip central-repository runs

🐞 Bug fix ⚙️ Configuration changes 🕐 10-20 Minutes

Grey Divider

AI Description

• Declares pull-request and merge-group triggers required by the ruleset API.
• Skips org-gate jobs in the central repository to avoid duplicate CI.
Diagram

graph TD
  A["PR or merge queue"] --> B{"Central repository?"} -->|No| D["Hygiene check"] --> E["ADR check"] --> F["Gate result"]
  B -->|Yes| C["Skip org gate"]
Loading
High-Level Assessment

Declaring supported events while suppressing central-repository jobs is the most direct way to satisfy the ruleset API without duplicating self-CI. Before merging, remove the newly introduced empty uses: entry under hygiene, which duplicates the pinned reusable-workflow key and may invalidate the workflow.

Files changed (1) +14 / -2

Bug fix (1) +14 / -2
org-gate.ymlAdd required triggers and central-repository job guards +14/-2

Add required triggers and central-repository job guards

• Declares 'pull_request' and 'merge_group' events so the workflow qualifies for ruleset registration. Adds repository conditions to skip hygiene, ADR validation, and gate aggregation in 'Cloudbird-Software/CI-Workflows'; the current diff also introduces an empty duplicate 'uses:' key under 'hygiene' that should be removed.

.github/workflows/org-gate.yml

@randypanding
randypanding merged commit ae7079d into main Aug 20, 2026
10 checks passed
@randypanding
randypanding deleted the p3-1-org-gate-triggers branch August 20, 2026 07:43
@qodo-code-review

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (2) 📘 Rule violations (0) 📜 Skill insights (0)

Grey Divider


Action required

1. Duplicate uses invalidates workflow 🐞 Bug ≡ Correctness
Description
The added empty uses: duplicates the concrete reusable-workflow reference in the same hygiene
job, producing an invalid YAML mapping/job definition. GitHub cannot load the required workflow, so
none of its checks can run.
Code

.github/workflows/org-gate.yml[28]

+    uses:
Relevance

●●● Strong

An empty duplicate job-level uses key conflicts with the concrete reusable-workflow reference and
invalidates the workflow definition.

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The job has an empty uses at line 28 and a second concrete uses at line 31. The target file
declares workflow_call, and GitHub documents that reusable workflows are called with a job-level
uses keyword.

.github/workflows/org-gate.yml[23-31]
.github/workflows/hygiene.yml[1-4]
🌐 GitHub states that reusable workflows are called directly within a job using the uses keyword.

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The `hygiene` job contains an empty `uses:` key followed by another `uses:` key with the actual reusable-workflow reference. Remove the empty duplicate so the workflow is valid.

## Issue Context
A reusable workflow must be invoked through one concrete job-level `uses` value. Duplicate mapping keys make the workflow invalid.

## Fix Focus Areas
- .github/workflows/org-gate.yml[27-31]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


2. Merge queue always fails 🐞 Bug ≡ Correctness
Description
The new merge_group trigger runs the workflow with github.event_name == 'merge_group', causing
adr-required to be skipped by its PR-only condition. The strict gate then treats that skipped
dependency as a failure, so every merge-queue run fails even when hygiene succeeds.
Code

.github/workflows/org-gate.yml[18]

+  merge_group:
Relevance

●●● Strong

Direct event-condition mismatch makes merge-queue runs fail; this is a concrete workflow correctness
defect.

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The PR enables the distinct merge_group event, but adr-required is conditioned on
pull_request. The gate always executes and its jq assertion fails whenever any needed job result
differs from success, including the resulting skipped status.

.github/workflows/org-gate.yml[16-18]
.github/workflows/org-gate.yml[33-37]
.github/workflows/org-gate.yml[96-112]
🌐 GitHub documents that merge_group is separate from pull_request and is the event used to execute required checks for merge queues.

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`merge_group` runs skip `adr-required`, but the final gate rejects every non-success dependency result. Make merge-group execution produce an explicitly accepted result without weakening failure handling for PR runs.

## Issue Context
GitHub treats `merge_group` as a distinct event. The ADR job currently runs only for `pull_request`, while the gate runs under `always()` and fails when any dependency is skipped.

## Fix Focus Areas
- .github/workflows/org-gate.yml[16-18]
- .github/workflows/org-gate.yml[33-37]
- .github/workflows/org-gate.yml[96-112]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Context sources
✅ Web pages:
  +2 more
Review mode: ⚖️ Balanced: This changes GitHub Actions triggers and job-level guards on an organization gate workflow, affecting required-workflow enforcement and execution behavior; it is behavioral CI configuration with meaningful blast radius, though not dense enough to warrant extended review.

Grey Divider

Tip of the day
💡 Did you know, you can copy the agent prompt from any finding and feed it to your IDE agent

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

# 中心仓自身的 PR 会因 on: pull_request 触发本 workflow——跳过防重复
# (中心仓自有 ci.yml 自测;ruleset 不作用于 CI-Workflows 自身)
if: github.repository != 'Cloudbird-Software/CI-Workflows'
uses:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Action required

1. Duplicate uses invalidates workflow 🐞 Bug ≡ Correctness

The added empty uses: duplicates the concrete reusable-workflow reference in the same hygiene
job, producing an invalid YAML mapping/job definition. GitHub cannot load the required workflow, so
none of its checks can run.
Agent Prompt
## Issue description
The `hygiene` job contains an empty `uses:` key followed by another `uses:` key with the actual reusable-workflow reference. Remove the empty duplicate so the workflow is valid.

## Issue Context
A reusable workflow must be invoked through one concrete job-level `uses` value. Duplicate mapping keys make the workflow invalid.

## Fix Focus Areas
- .github/workflows/org-gate.yml[27-31]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

# job 级守卫跳过,防自测重复)
on:
pull_request:
merge_group:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Action required

2. Merge queue always fails 🐞 Bug ≡ Correctness

The new merge_group trigger runs the workflow with github.event_name == 'merge_group', causing
adr-required to be skipped by its PR-only condition. The strict gate then treats that skipped
dependency as a failure, so every merge-queue run fails even when hygiene succeeds.
Agent Prompt
## Issue description
`merge_group` runs skip `adr-required`, but the final gate rejects every non-success dependency result. Make merge-group execution produce an explicitly accepted result without weakening failure handling for PR runs.

## Issue Context
GitHub treats `merge_group` as a distinct event. The ADR job currently runs only for `pull_request`, while the gate runs under `always()` and fails when any dependency is skipped.

## Fix Focus Areas
- .github/workflows/org-gate.yml[16-18]
- .github/workflows/org-gate.yml[33-37]
- .github/workflows/org-gate.yml[96-112]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

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.

1 participant