Skip to content

Conversation

@pull
Copy link

@pull pull bot commented Nov 19, 2025

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

owlstronaut and others added 2 commits November 18, 2025 14:00
This pull request introduces extensive enhancements to the npm token
management command, adding support for creating Granular Access Tokens
(GATs) with fine-grained permissions. It updates the CLI interface,
configuration, and documentation to allow users to specify token details
such as name, description, expiration, package/scope/org restrictions,
permission levels, and bypassing two-factor authentication. The changes
also improve error messaging and ensure all new options are reflected in
the config and docs.

---------

Co-authored-by: Gar <gar+gh@danger.computer>
Fix a race condition in `withLock` where a slow `fs.stat` call could
result in an ECOMPROMISED false positive. Due to the usage of
`setInterval`, one callback could mutate `mtime` just before an
overlapping callback's `fs.stat` promise has resolved, causing a
mismatch. By switching to `setTimeout`, we ensure that we don't have
overlapping callbacks and incorrect values.

Additionally bump the stale threshold higher, to reduce the likelihood
of another caller taking over a seemingly-stale-but-actually-active
lock. Under Windows in particular, `fs.stat` [has been
observed](#8710 (comment))
to sometimes take over 20 seconds, so we should err on the side of a
higher threshold before we judge a lock as stale. The minor potential
downside is that we might wait longer before taking over a stale lock,
but lock takeover is already a very exceptional case (i.e. it would
typically only happen if another process was SIGKILLed while holding the
same lock)

## Testing Notes
- Added a new test to cover this scenario
- Verified [the
failure](https://github.com/jenseng/cli/actions/runs/19373681768/job/55435674539)
and [the
fix](https://github.com/jenseng/cli/actions/runs/19373765497/job/55435952370)
via one-off GHA workflow that does `npx --yes jest --version`

## References
Fixes #8710
@pull pull bot locked and limited conversation to collaborators Nov 19, 2025
@pull pull bot added the ⤵️ pull label Nov 19, 2025
@pull pull bot merged commit 3439a89 into LadyK-21:latest Nov 19, 2025
0 of 3 checks passed
@LadyK-21
Copy link
Owner

⚠️ Snyk checks are incomplete.

Status Scanner Critical High Medium Low Total (1)
⚠️ Open Source Security 0 1 0 0 See details

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants