Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: --age or --filterMeta #833

Open
wadeharrell opened this issue Feb 23, 2021 · 6 comments
Open

Feature: --age or --filterMeta #833

wadeharrell opened this issue Feb 23, 2021 · 6 comments

Comments

@wadeharrell
Copy link

Running into a slight challenge when using ncu due to being on a corp registry that only syncs on a cron. Packages that have been published between crons are not available on the corp registry yet. It would be handy to have a flag that would allow us to specify an age in hours for the packages to be updated. Anything younger than that age would be excluded from the update.

I have been using the tool for years and never run into this before, but Babel is doing updates across their packages right now and it has been preventing us from using ncu easily for the past few days. If there was a way to specify "only update packages that were published more than 12 hours ago" it would solve the concern. It might also be a nice "comfort" feature for those concerned about dangerous code updates.

@raineorshine
Copy link
Owner

raineorshine commented Feb 23, 2021

Thanks for the suggestion! Maybe something like --filterVersion but for package metadata, i.e. --filterMeta "time > 12hrs".

@kanoshin
Copy link

kanoshin commented Jun 28, 2021

--filterMeta is a great idea. Additional use-case are packages that need to stay on the same version because they are published from the same monorepo but for some reason filtering by name is not suffice.

In my organization we publish packages within org scope, say @myorg/*. Some of those packages use parallel versioning and some do not, so we would like to be able to filter by meta property like repository url ncu "@myorg/*" --filterMeta "repository.url = https://github.com/myorg/myrepo.git"

@raineorshine raineorshine changed the title Feature request - age flag Feature: --age or --filterMeta Jun 29, 2021
@Litee
Copy link

Litee commented Jul 28, 2021

Two words about my use case - in our org we have internal npm repo which ignores any packages from npm.org that are younger than 72 hours for security reasons. It means that some of ncu upgrade recommendations cannot be done and it takes time to understand which upgrades are working and which are not.

@raineorshine
Copy link
Owner

This option could benefit from supporting functions, like the recent enhancement to target: #1052.

@raineorshine
Copy link
Owner

raineorshine commented Oct 16, 2022

--filterMeta is a nice generalization, though I think a --min-age option would be convenient, even if it was just an alias for --filterMeta "time > 72hrs".

@limonte
Copy link

limonte commented Oct 17, 2022

Maybe the naming of the alias could be aligned with Renovate (the only place where I did find this feature!), it's called stabilityDays

Also stabilityDays is mentioned in this RFC: npm/rfcs#549

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

No branches or pull requests

5 participants