Skip to content

chore(.github/workflowsw): move main CI checks to merge queue runs#3887

Merged
dd-mergequeue[bot] merged 6 commits into
mainfrom
dario.castane/ktlo/disable-main-branch-ci
Sep 4, 2025
Merged

chore(.github/workflowsw): move main CI checks to merge queue runs#3887
dd-mergequeue[bot] merged 6 commits into
mainfrom
dario.castane/ktlo/disable-main-branch-ci

Conversation

@darccio

@darccio darccio commented Aug 18, 2025

Copy link
Copy Markdown
Member

What does this PR do?

Updates workflows so main CI checks happen during a merge queue run. Specifically it marks all workflows that run in push events to main to run on those events on branches starting with mq-working-branch.

Additionally:

  • Standardises pull_request triggers to explicitly set opened, reopened, and synchronized default states.
  • Standardises tags-ignore for push triggers to ignore all nested modules' version tags.
  • Removes merge_group triggers.
  • Removes synchronized event on pull-request-title-validation.
  • Updates Go version to the highest supported one on pull-request workflow.
  • Swaps main-branch-tests with pull-requests, making sure any flakiness is early detected.
  • main-branch-tests run only high-signal unit-integration-tests with a smaller set.
  • Fixes indentation on system-tests.
  • Introduces repository caching to avoid pulling it in matrix-based tests like system-tests, pull-request, or main-branch-tests.

Motivation

Clarify CI usage and ensure that failing CI checks have visibility and impact. Currently we can only see if anything is wrong on main by looking at the CI checks for a commit in GitHub's UI.

Note 1: this PR requires a small change on repository's settings to move the required checks PR Unit and Integration Tests / test-core and PR Unit and Integration Tests / test-contrib to PR Unit and Integration Tests.

Note 2: this PR would cause that no check will run if somebody with admin privileges doesn't use the merge queue. It should be possible to avoid that by setting some kind of break glass job that must run when merging directly from the UI. Merge queue should work by skipping it.

Reviewer's Checklist

  • Changed code has unit tests for its functionality at or near 100% coverage.
  • System-Tests covering this feature have been added and enabled with the va.b.c-dev version tag.
  • There is a benchmark for any new code, or changes to existing code.
  • If this interacts with the agent in a new way, a system test has been added.
  • New code is free of linting errors. You can check this by running ./scripts/lint.sh locally.
  • Add an appropriate team label so this PR gets put in the right place for the release notes.
  • Non-trivial go.mod changes, e.g. adding new modules, are reviewed by @DataDog/dd-trace-go-guild.

Unsure? Have a question? Request a review!

@darccio
darccio marked this pull request as ready for review August 18, 2025 17:44
@darccio
darccio requested review from a team as code owners August 18, 2025 17:44
@datadog-datadog-prod-us1

datadog-datadog-prod-us1 Bot commented Aug 18, 2025

Copy link
Copy Markdown

✅ Tests

🎉 All green!

❄️ No new flaky tests detected
🧪 All tests passed

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 957c7cf | Docs | Was this helpful? Give us feedback!

Comment thread .github/workflows/pull-request.yml Outdated
@darccio
darccio force-pushed the dario.castane/ktlo/disable-main-branch-ci branch from acd62bd to b742c82 Compare August 19, 2025 08:14
@pr-commenter

pr-commenter Bot commented Aug 19, 2025

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2025-09-03 14:40:47

Comparing candidate commit 957c7cf in PR branch dario.castane/ktlo/disable-main-branch-ci with baseline commit 1921d92 in branch main.

Found 0 performance improvements and 0 performance regressions! Performance is the same for 24 metrics, 0 unstable metrics.

@hannahkm hannahkm 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.

Looks good, thank you!

@darccio
darccio force-pushed the dario.castane/ktlo/disable-main-branch-ci branch 2 times, most recently from d742705 to 849e00d Compare August 21, 2025 10:07
@darccio darccio changed the title chore(ci): move main CI checks to merge queue runs chore(.github/workflowsw): move main CI checks to merge queue runs Aug 21, 2025
@darccio
darccio force-pushed the dario.castane/ktlo/disable-main-branch-ci branch from 8635ff7 to 58b7fa2 Compare August 22, 2025 10:29

@kakkoyun kakkoyun left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@darccio
darccio force-pushed the dario.castane/ktlo/disable-main-branch-ci branch 3 times, most recently from f9521df to bd8a68a Compare August 28, 2025 08:49
@darccio

darccio commented Aug 28, 2025

Copy link
Copy Markdown
Member Author

/merge

@dd-devflow-routing-codex

dd-devflow-routing-codex Bot commented Aug 28, 2025

Copy link
Copy Markdown

View all feedbacks in Devflow UI.

2025-08-28 09:28:50 UTC ℹ️ Start processing command /merge


2025-08-28 09:29:01 UTC ℹ️ MergeQueue: waiting for PR to be ready

This merge request is not mergeable yet, because of pending checks/missing approvals. It will be added to the queue as soon as checks pass and/or get approvals.
Note: if you pushed new commits since the last approval, you may need additional approval.
You can remove it from the waiting list with /remove command.


2025-08-28 09:47:52 UTC ⚠️ MergeQueue: This merge request was unqueued

[email protected] unqueued this merge request

Comment thread .github/workflows/api-check.yml Outdated
Comment thread .github/workflows/appsec.yml Outdated
Comment thread .github/workflows/codeql-analysis.yml Outdated
Comment thread .github/workflows/generate.yml Outdated
runs-on: ${{ matrix.runs-on }}
ref: ${{ inputs.ref || github.ref }}
secrets: inherit
go-version: "1.25" # Should be the highest supported version of Go

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.

Would be neat if that supported the stable alias?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

That introduces the "risk" of having red CI if a new Go release causes the pipeline to fail. I prefer to have control, in the same line of the previous point about stating explicitly configs equivalent to the defaults.

Comment thread .github/workflows/parametric-tests.yml Outdated
Comment thread .github/workflows/pull-request-title-validation.yml
Comment thread .github/workflows/smoke-tests.yml Outdated
Comment thread .github/workflows/static-checks.yml Outdated
Comment thread .github/workflows/system-tests.yml Outdated
@darccio

darccio commented Aug 28, 2025

Copy link
Copy Markdown
Member Author

/merge -c

@dd-devflow-routing-codex

dd-devflow-routing-codex Bot commented Aug 28, 2025

Copy link
Copy Markdown

View all feedbacks in Devflow UI.

2025-08-28 09:47:41 UTC ℹ️ Start processing command /merge -c

Comment on lines -22 to +27
inputs:
ref:
description: 'System Tests ref/tag/branch'
required: true
default: main
type: string
inputs:
ref:
description: 'System Tests ref/tag/branch'
required: true
default: main
type: string

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.

Is it just me or I think this part in indented differently ?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

It had extra indentation, that's why it was modified.

@darccio
darccio force-pushed the dario.castane/ktlo/disable-main-branch-ci branch from ba0972d to 957c7cf Compare September 3, 2025 14:27
@darccio

darccio commented Sep 4, 2025

Copy link
Copy Markdown
Member Author

/merge

@dd-devflow-routing-codex

dd-devflow-routing-codex Bot commented Sep 4, 2025

Copy link
Copy Markdown

View all feedbacks in Devflow UI.

2025-09-04 06:37:07 UTC ℹ️ Start processing command /merge


2025-09-04 06:37:12 UTC ℹ️ MergeQueue: pull request added to the queue

The expected merge time in main is approximately 14m (p90).


2025-09-04 06:51:00 UTC ℹ️ MergeQueue: This merge request was merged

@dd-mergequeue
dd-mergequeue Bot merged commit d6a972f into main Sep 4, 2025
263 checks passed
@dd-mergequeue
dd-mergequeue Bot deleted the dario.castane/ktlo/disable-main-branch-ci branch September 4, 2025 06:50
gh-worker-dd-mergequeue-cf854d Bot pushed a commit that referenced this pull request May 4, 2026
…us (#4704)

## Problem

The [CodeQL status page](https://github.com/DataDog/dd-trace-go/security/code-scanning/tools/CodeQL/status) shows the last scan date as **2025-09-03**, even though CodeQL runs successfully on every PR and every `mq-working-branch-**` push.

This is an **association problem, not an execution problem.** GitHub Code Scanning indexes each SARIF upload by the `ref` the trigger event carried. The default-branch status panel only counts uploads tagged with `refs/heads/main`. CodeQL is running, but every upload it produces is filed under a non-default ref.

### Root cause

PR #3887 (2025-09-04, _"move `main` CI checks to merge queue runs"_) restructured the workflow triggers:

| Removed | Kept / Added |
|---|---|
| `push: branches: [main, master]` | `push: branches: [mq-working-branch-**]` |
| `pull_request: branches: [main]` | `pull_request:` (no branch filter) |
| `merge_group:` | `workflow_call:` (unused — no caller wires CodeQL) |

After this change, CodeQL only ever sees refs of the form `refs/pull/<n>/merge` or `refs/heads/mq-working-branch-XXX`. The repository's merge mechanism fast-forwards `main` onto a green staging commit and deletes the staging branch — no `push` event for `refs/heads/main` fires, so CodeQL never runs against the default branch. The SARIF uploaded during the queue run stays tagged with the staging ref even after that exact SHA becomes `HEAD` of `main`.

This is asymmetric with GitHub's _native_ merge queue: native queue events arrive on `refs/heads/gh-readonly-queue/main/<sha>` and Code Scanning rolls those uploads up to the default branch on completion. Custom queues built on fast-forward branches get no such roll-up.

### Why it matters

- The [security tab](https://github.com/DataDog/dd-trace-go/security/code-scanning/tools/CodeQL/status) shows the configuration as inactive, which trips compliance alarms and looks like a regression to auditors.
- New CodeQL findings introduced after 2025-09-03 are recorded against PR / staging refs and never roll up to the canonical `main` view.
- Branch-protection rules of the form "CodeQL must be passing on default branch" can mis-report.

## Verification

- [x] `git diff` shows exactly one inserted line: `      - main`
- [x] `actionlint .github/workflows/codeql-analysis.yml` passes with no errors
- [ ] After merge, the Actions tab shows a new "CodeQL" run on `refs/heads/main`
- [ ] The [status page](https://github.com/DataDog/dd-trace-go/security/code-scanning/tools/CodeQL/status) shows a timestamp newer than 2025-09-03, still with configuration ID `FZTWS5DIOVRC653POJVWM3DPO5ZS6Y3PMRSXC3BNMFXGC3DZONUXGLTZNVWA`

Co-authored-by: darccio <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants