Skip to content

docs: fix npmMinimalAgeGate default value.#7125

Merged
arcanis merged 4 commits into
yarnpkg:masterfrom
ryanfox1985:fix_default_parameter
Jun 2, 2026
Merged

docs: fix npmMinimalAgeGate default value.#7125
arcanis merged 4 commits into
yarnpkg:masterfrom
ryanfox1985:fix_default_parameter

Conversation

@ryanfox1985
Copy link
Copy Markdown
Contributor

@ryanfox1985 ryanfox1985 commented Apr 30, 2026

What's the problem this PR addresses?

according the documentation https://github.com/ryanfox1985/berry/blob/fix_default_parameter/packages/docusaurus/static/configuration/yarnrc.json#L506

    "npmMinimalAgeGate": {
      "_package": "@yarnpkg/core",
      "title": "Minimum age of a package version according to the publish date on the npm registry to be considered for installation.",
      "description": "If a package version is newer than the minimal age gate, it will not be considered for installation. This can be used to reduce the likelihood of installing compromised packages, or to avoid relying on packages that could still be unpublished (e.g. the npm registry has specific rules for packages less than 3 days old).",
      "type": ["number", "string"],
      "oneOf": [
        { "type": "number" },
        { "type": "string", "pattern": "^(\\d*\\.?\\d+)(ms|s|m|h|d|w)?$" }
      ],
      "default": "3d"
    },

The default parameter is 3 days and current code doesn't apply any default.

How did you fix it?

Just appending the default value.

Checklist

  • I have set the packages that need to be released for my changes to be effective.
  • I will check that all automated PR checks pass before the PR gets reviewed.

@ryanfox1985 ryanfox1985 changed the title Fixed default parameter. Fixed npmMinimalAgeGate default parameter. Apr 30, 2026
@ryanfox1985 ryanfox1985 changed the title Fixed npmMinimalAgeGate default parameter. Fixed npmMinimalAgeGate default value. Apr 30, 2026
@ryanfox1985 ryanfox1985 changed the title Fixed npmMinimalAgeGate default value. Fix: npmMinimalAgeGate default value. Apr 30, 2026
Copy link
Copy Markdown
Member

@clemyan clemyan left a comment

Choose a reason for hiding this comment

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

No. The docs is wrong here, so that's what should be fixed. Set the correct default there and bump 3d down to an example.

Enabling minimal age by default is a huge breaking change and should not be done lightly

@ryanfox1985
Copy link
Copy Markdown
Contributor Author

@clemyan I pushed the docs fix then.

{ "type": "string", "pattern": "^(\\d*\\.?\\d+)(ms|s|m|h|d|w)?$" }
],
"default": "3d"
"default": "0m"
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.

Suggested change
"default": "0m"
"default": "0m",
"examples": ["3d"]

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Perhaps we could append 1w too?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

As an array

@merceyz merceyz changed the title Fix: npmMinimalAgeGate default value. docs: fix npmMinimalAgeGate default value. May 5, 2026
clemyan
clemyan previously approved these changes May 7, 2026
@arcanis arcanis merged commit 33d2911 into yarnpkg:master Jun 2, 2026
3 of 4 checks passed
@PierreNoll
Copy link
Copy Markdown

PierreNoll commented Jun 2, 2026

hi there, maybe I miss something but isn't the default value for npmMinimalAgeGate: 1d instead of 0 as per #7135 shipped in release v4.15.0 ?

@ryanfox1985
Copy link
Copy Markdown
Contributor Author

@PierreNoll this PR was opened before #7135 (you can see by PR number), I think there was a concurrent problem. What is wierd is why this PR didn't cause any conflict with Master...

@ryanfox1985
Copy link
Copy Markdown
Contributor Author

btw the iniciative of this PR was to upgrade to 3d, some recommended value on other package managers because the security issues...

@ryanfox1985
Copy link
Copy Markdown
Contributor Author

ryanfox1985 commented Jun 2, 2026

I think @arcanis is the cultprit upgrading this PR in the lastest commit: e6c1edf

by not resolving properly the conflict in this line...

@ryanfox1985
Copy link
Copy Markdown
Contributor Author

ping @clemyan #7125 (review) I though by enabling a minal age would be a huge breaking change xDDDDD

@arcanis
Copy link
Copy Markdown
Member

arcanis commented Jun 2, 2026

It would have been a breaking change had we not been careful. It was not done lightly, so it worked out.

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