Skip to content

Dependabot: Add npm entry so security update PRs can be rebased#79076

Open
manzoorwanijk wants to merge 2 commits into
trunkfrom
fix/dependabot-npm-security-updates
Open

Dependabot: Add npm entry so security update PRs can be rebased#79076
manzoorwanijk wants to merge 2 commits into
trunkfrom
fix/dependabot-npm-security-updates

Conversation

@manzoorwanijk

Copy link
Copy Markdown
Member

What?

Adds an npm entry to .github/dependabot.yml so that Dependabot security updates for npm packages have an owning config block. Version updates for npm remain disabled via open-pull-requests-limit: 0.

Why?

Dependabot security updates run from the repository's security settings, independently of dependabot.yml, and will open PRs for npm vulnerabilities even though we only configure the github-actions ecosystem today. Because there is no npm entry, those PRs have no owning config, so @dependabot rebase and @dependabot recreate both fail with a misleading message:

The dependabot.yml entry that created this PR has been deleted so this PR can't be rebased. Please close the PR so Dependabot can create a new one with the current dependabot.yml.

This leaves the only recourse as closing the PR and waiting for the next scan — see the loop on #75964. Adding an npm ecosystem entry gives these security PRs a config owner so rebase/recreate work, and lets us apply consistent labels and a cooldown.

We deliberately do not want to enable npm version updates across this monorepo, which would flood the repo with hundreds of PRs. Setting open-pull-requests-limit: 0 disables version updates while leaving security updates unaffected (the limit does not apply to them).

How?

  • Add a package-ecosystem: 'npm' entry rooted at /.
  • Set open-pull-requests-limit: 0 to keep version updates off while security updates continue.
  • Apply a 7-day cooldown and the dependencies / [Type] Build Tooling labels, mirroring the existing github-actions configuration.

Testing Instructions

  1. Confirm the YAML is valid and parses (e.g. npx js-yaml .github/dependabot.yml or any YAML linter).
  2. After merge, the next Dependabot npm security PR should accept @dependabot rebase / @dependabot recreate instead of reporting a missing config entry, and should carry the configured labels.
  3. Verify no new npm version-update PRs are opened (only security updates).

Use of AI Tools

This PR was drafted with the assistance of Claude Code. All changes were reviewed by the author.

@manzoorwanijk manzoorwanijk requested a review from desrosj as a code owner June 10, 2026 08:11
Dependabot security updates run independently of dependabot.yml and open
npm PRs even though only the github-actions ecosystem is configured.
Without an npm entry those PRs have no owning config, so rebase/recreate
fail. Add an npm entry with open-pull-requests-limit: 0 to give security
updates a config owner while keeping noisy version updates disabled.
@github-actions

github-actions Bot commented Jun 10, 2026

Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: manzoorwanijk <manzoorwanijk@git.wordpress.org>
Co-authored-by: aduth <aduth@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@manzoorwanijk manzoorwanijk force-pushed the fix/dependabot-npm-security-updates branch from 9969a6d to 5bfa5f1 Compare June 10, 2026 08:11
@manzoorwanijk manzoorwanijk added the [Type] Security Related to security concerns or efforts label Jun 10, 2026
@manzoorwanijk manzoorwanijk self-assigned this Jun 10, 2026
@github-actions

github-actions Bot commented Jun 10, 2026

Copy link
Copy Markdown

Flaky tests detected in 295ac56.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/27321031938
📝 Reported issues:

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

I'd be curious if folks like @desrosj would be interested to keep and continue maintaining the dependency updates for non-security updates? There's some engagement here on our part.

Comment thread .github/dependabot.yml
Comment on lines +30 to +37
# disables noisy npm *version* updates across the monorepo;
# *security* updates ignore this limit and keep running.
open-pull-requests-limit: 0
cooldown:
default-days: 7
labels:
- 'dependencies'
- '[Type] Build Tooling'

@aduth aduth Jun 10, 2026

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.

I'm trying to understand this configuration in relation to the behavior you describe in the original comment. If security updates don't consider dependabot.yml, then what's the point of adding cooldown and labels here? Will security updates consider those aspects of the configuration (which for labeling would be great to avoid a little bit of maintainer tedium)? And would we want a cooldown for security updates, or want those immediately?

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.

Good catch! When a matching ecosystem entry exists, security PRs honor labels (on the default branch) but not cooldown ("only available for version updates"). open-pull-requests-limit is also ignored by security updates.

So labels is the point - it removes the manual labeling tedium you linked. cooldown is inert here (and we wouldn't want to delay security fixes anyway). I'll update it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Type] Security Related to security concerns or efforts

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants