Repository navigation
Cache registered manager version lookups - #2005
Conversation
Co-authored-by: edvilme <5952839+edvilme@users.noreply.github.com>
|
Fixes #2001 |
There was a problem hiding this comment.
🟡 Changes recommended
The version cache omits managerId from its key, allowing environments with identical IDs from different managers to receive the wrong cached version and produce incorrect telemetry.
1 open issue
What changed in this PR
This PR addresses #2004 by caching version lookups in registered manager wrappers, reducing repeated underlying tool probes.
Changes:
- Cache one version promise per environment manager and one per environment ID for package managers.
- Reuse pending promises and cache unavailable (
undefined) results. - Add tests for repeated lookups and distinct package-manager versions across environments.
| File | Description |
|---|---|
src/test/managers/common/registeredManagers.versionLookup.unit.test.ts |
Adds version-cache tests for both manager wrappers. |
src/managers/common/registeredManagers.ts |
Adds shared and environment-keyed version-promise caches. |
Review effort: Balanced
|
🔒 Automated review in progress — Rich Chiodo (@rchiodo) is auto-reviewing this PR. |
|
Reviewed commit: Result: ✅ Verification detailsVerification: Automated verification is best effort. The PR author remains responsible for testing. Summary: Offline dependency restoration and TypeScript test compilation succeeded in the container. All 11 targeted repository tests passed, including both tests added by the PR. Additional probes passed for concurrent deduplication, cached undefined results, environment-ID scoping, and independent manager caches. No test failures were observed. **Reviewer dependency follow-up (nonblocking):** Suggest a separate PR adding `@renovatebot/pep440@^4.2.4`, `mocha@^10.8.2`, `sinon@^19.0.2`, `ts-mockito@^2.6.1`, `typescript@^5.1.3` to the official reviewer dependency declarations, using `package.json` as the dependency/version evidence. Do not automatically create that PR. This is reviewer environment maintenance, not a required change to the reviewed PR. Test runs: 4 passed, 1 not run
|
Rich Chiodo (rchiodo)
left a comment
There was a problem hiding this comment.
Approved via Review Center.
Stella Huang (StellaHuang95)
left a comment
There was a problem hiding this comment.
Approved via Review Center.
Bill Schnurr (bschnurr)
left a comment
There was a problem hiding this comment.
Approved via Review Center.

Repeated
getVersion()calls re-ran underlying tool probes. Registered managers now cache version lookups by the appropriate scope.Environment managers
Package managers
environment.envId.id.Cache semantics
undefined) results.