Skip to content

Add submodule validation workflow#1893

Open
GromNaN wants to merge 6 commits into
mongodb:v2.xfrom
GromNaN:ci-submodule
Open

Add submodule validation workflow#1893
GromNaN wants to merge 6 commits into
mongodb:v2.xfrom
GromNaN:ci-submodule

Conversation

@GromNaN
Copy link
Copy Markdown
Member

@GromNaN GromNaN commented May 6, 2026

Validates submodule references on every PR targeting v*.* or feature/* branches.

Checks

  1. Commit is on the upstream branch — the referenced commit must be an ancestor of the configured branch (or the remote's default branch if not set in .gitmodules)
  2. No regression — the commit must not be older than what the target branch already points to

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 6, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.72%. Comparing base (d4306b2) to head (83b87cc).
⚠️ Report is 1 commits behind head on v2.x.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff            @@
##               v2.x    #1893   +/-   ##
=========================================
  Coverage     87.72%   87.72%           
  Complexity     3328     3328           
=========================================
  Files           454      454           
  Lines          6656     6656           
=========================================
  Hits           5839     5839           
  Misses          817      817           
Flag Coverage Δ
6.0-replica_set 86.56% <ø> (ø)
6.0-server 82.61% <ø> (ø)
6.0-sharded_cluster 86.35% <ø> (ø)
8.0-replica_set 87.59% <ø> (ø)
8.0-server 83.35% <ø> (ø)
8.0-sharded_cluster 87.42% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds automation to ensure submodule pointers remain valid and non-regressive when updating branches used for releases/maintenance.

Changes:

  • Annotates existing submodules in .gitmodules with their intended upstream tracking branches.
  • Introduces a GitHub Actions workflow to validate submodule references on PRs (and merge queue runs) when submodule pointers/config change.

Reviewed changes

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

File Description
.gitmodules Specifies intended upstream branches for each submodule to support validation logic.
.github/workflows/submodules.yml Adds a workflow that runs a submodule validation action on relevant PR/merge-queue changes.

Comment thread .github/workflows/submodules.yml Outdated
Comment on lines +11 to +15
pull_request:
branches:
- "v*.*"
- "feature/*"
paths:
Copilot AI review requested due to automatic review settings May 20, 2026 20:05
@GromNaN GromNaN enabled auto-merge (squash) May 20, 2026 20:06
GromNaN added 4 commits May 20, 2026 22:07
Adds a GitHub Actions workflow that validates submodule references on
PRs: checks that the referenced commit is on the upstream branch and
does not regress from the target branch.

Also adds explicit branch tracking to .gitmodules for all submodules.
Move the validation logic into .github/actions/validate-submodules so it
can be ported to mongodb-labs/drivers-github-tools. The script now uses
the GitHub API exclusively — no checkout required.
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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

Comment thread .github/workflows/submodules.yml
Comment thread .github/workflows/submodules.yml
@GromNaN
Copy link
Copy Markdown
Member Author

GromNaN commented May 20, 2026

Interestingly, when the submodule is updated on the target branch, the new action fails because it's behind. Not a big deal because this action is only run when a submodule is updated, and the solution is just to rebase the PR.

Copilot AI review requested due to automatic review settings May 20, 2026 20:11
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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

Comment thread .github/workflows/submodules.yml
Comment on lines +30 to +33
- name: "Validate submodule commits"
uses: "mongodb-labs/drivers-github-tools/validate-submodules@v3"
with:
token: ${{ github.token }}
@GromNaN GromNaN requested a review from alcaeus May 20, 2026 20:13
Copy link
Copy Markdown
Member

@alcaeus alcaeus left a comment

Choose a reason for hiding this comment

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

Workflow LGTM. We should consider removing the paths restriction to be able to block pull requests on inconsistent submodules.

branches:
- "v*.*"
- "feature/*"
paths:
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.

Limiting this to paths would prevent us from making this workflow as required.

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.

4 participants