Skip to content

chore: enforce dependency age tooling and portable lockfiles - #324

Open
David Gamero (davidgamero) wants to merge 1 commit into
Azure:mainfrom
davidgamero:chore/dependency-age-portable-lockfile
Open

David Gamero (davidgamero) wants to merge 1 commit into
Azure:mainfrom
davidgamero:chore/dependency-age-portable-lockfile

Conversation

@davidgamero

@davidgamero David Gamero (davidgamero) commented Nov 30, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Keep the existing seven-day Dependabot cooldown for both npm and GitHub Actions, retain the twice-monthly schedule and minor/patch grouping, and use the documented / directory for GitHub Actions discovery.
  • Require npm >= 11.10.0 through devEngines, select Node 24 consistently in install jobs, and use npm ci instead of allowing CI to update dependency resolutions.
  • Add omit-lockfile-registry-resolved=true and regenerate only the lockfile. The lockfile diff removes 121 registry resolved URLs; all dependency versions and all 121 existing SHA-512 integrity entries are unchanged. No registry override is committed.
  • Add isolated, local-registry regression tests for minimum release age, exact-version rejection, URL omission with integrity preservation, and the developer package-manager guard.
  • Clarify policy boundaries and registry-independent lockfile maintenance in the development documentation.

Review findings and limitations

  • Both Dependabot ecosystems already had cooldown.default-days: 7; this PR preserves it rather than changing the waiting period. Cooldown applies to version updates, not Dependabot security updates.
  • npm's min-release-age=7 is a resolution filter, not an independent age audit of every previously locked package. npm ci installs the reviewed lockfile. Review remains necessary for transitive changes and security updates.
  • Older npm releases may ignore min-release-age; npm clients supporting devEngines now reject an unsupported package-manager version. Very old clients can also ignore devEngines and must not be used. CI explicitly selects Node 24.
  • The pinned shared release workflow already selects Node 24, so no release-workflow changes are needed.
  • Registry proxies can omit SHA-512 metadata. Preserving an existing lockfile keeps its SHA-512 values, but resolving a new version can produce SHA-1-only integrity. URL omission does not repair missing metadata; dependency updates still need integrity review.

Validation

  • Fresh npm ci --ignore-scripts --no-audit --no-fund through the configured corporate proxy endpoint: passed, 52 packages installed; the endpoint was supplied only as a local command-line override, not committed to the repository or workflows.
  • npm run test-dependency-policy: 4 passed; uses an isolated localhost metadata fixture, no real package downloads or lifecycle scripts.
  • npm test: 119 passed across 6 files.
  • npm run check: passed.
  • npm run build: passed; generated lib/ files remain ignored and are not committed.
  • npm run format-check: passed.
  • git diff --check: passed.
  • Parsed the Dependabot/workflow YAML and checked both seven-day cooldowns, unchanged schedules, Node 24 selection before installs, and full-SHA action references.
  • Structurally compared the regenerated lockfile with upstream: only registry URLs were removed; versions and integrity hashes are unchanged.
  • All nine GitHub checks passed on signed commit 40d0ef8bc0130aee9f9aac50586c6db304d81d58: Windows/macOS/Linux integration, unit/policy tests, formatting, CodeQL analysis and results, commit-signature verification, and CLA. Actual Dependabot service behavior will be validated by its next run after merge.

This is a maintenance-only PR: no action runtime code, dependency versions, action runtime declaration, or changelog changes. Merging this PR should not trigger the changelog-driven release workflow. No tag or release was created, and no merge was performed.

Follow-up cooldown research and exhaustive proxy validation

  • Downloaded all 121 exact locked tarballs through CFS, including foreign-platform optional packages: 121/121 passed, no retries, 475,197,805 bytes. Every tarball matched the committed SHA-512 hash and CFS SHA-1 metadata; no public-registry fallback was used. This confirms availability/integrity, not native execution on every platform.
  • Repeated a fresh native Linux install with empty cache and empty user/global npm configuration: 52 packages installed, all 52 retaining SHA-512, with the committed lockfile unchanged. Type checking, build, 119 unit tests and four policy tests then passed. Install lifecycle scripts were disabled. An initial build hit an unrelated empty temporary-parent manifest; repeating in a clean parent passed without repository changes.
  • Current Dependabot implementation carries the cooldown into npm resolution for transitive updates when npm >=11.10 is available; normal updates retain the stronger of cooldown and .npmrc. Security-only updates explicitly pass --min-release-age=0, overriding .npmrc. Registry-side quarantine remains independent.
  • GitHub Actions cooldown lookup uses release publication dates with tag/commit-date fallbacks. Missing/unparseable dates and some lookup failures do not block an update; cooldown is not a fail-closed security boundary.
  • These are documented/source-reviewed behaviors, not a claim that a particular hosted Dependabot revision has been deployed or that a live update job was run. The existing uniform seven-day policy, no exclusions, and twice-monthly schedule remain unchanged.

@davidgamero
David Gamero (davidgamero) marked this pull request as ready for review November 30, 2026 21:30
@davidgamero
David Gamero (davidgamero) requested a review from a team as a code owner November 30, 2026 21:30

@bosesuneha Suneha Bose (bosesuneha) 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

Copilot 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.

🟢 Approval recommended

No active review issues remain for the dependency-policy tooling and registry-independent lockfile updates.

No open issues 🎉

What changed in this PR

This maintenance PR strengthens dependency-policy tooling and makes the action’s lockfile registry-independent, without changing runtime code or dependency versions.

Changes:

  • Requires npm >= 11.10.0, standardizes installation jobs on Node 24, and replaces mutable CI installs with npm ci.
  • Removes 121 registry URLs from the lockfile while preserving dependency versions and SHA-512 integrity hashes.
  • Adds isolated policy regression tests and clarifies policy limits, while preserving Dependabot’s seven-day cooldown and twice-monthly schedule.
File Description
scripts/​dependency-policy.test.mjs Adds local-registry tests for release age, lockfile preservation, and the npm version guard.
README.md Documents tooling requirements, policy boundaries, and registry-independent lockfile maintenance.
package.json Declares the npm requirement and adds the policy-test command.
package-lock.json Removes registry URLs without changing versions or integrity hashes.
.npmrc Enables omission of registry URLs from lockfiles.
.github/​workflows/​unit-tests.yml Selects Node 24, installs with npm ci, and runs policy tests.
.github/​workflows/​prettify-code.yml Selects Node 24 for formatting checks.
.github/​workflows/​integration-tests.yaml Selects Node 24 and uses npm ci, retaining existing peer-dependency flags.
.github/​dependabot.yml Uses / for Actions discovery and adds a comment clarifying cooldown scope.

Review effort: Balanced

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