Repository navigation
chore(deps): update dependencies for sinon, mocha, nyc, ilc-plugins-sdk, newrelic, and tar #721
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
Merged
Merged
Changes from 2 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
7563ab9
chore(deps): update dependencies for sinon, mocha, nyc, ilc-plugins-s…
stas-nc ba240cd
test(ilc/server): increase coverage for registryFactory, preProcessRe…
stas-nc 4243ddc
chore(deps): scope e2e mocha overrides and drop unneeded editorconfig…
stas-nc e8f42ad
chore(deps): bump @newrelic/native-metrics to ^13.1.0 in ilc and regi…
stas-nc 0af1df3
Merge remote-tracking branch 'origin/master' into chore/deps
stas-nc File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,78 @@ | ||
| import axios from 'axios'; | ||
| import { expect } from 'chai'; | ||
| import config from 'config'; | ||
| import nock from 'nock'; | ||
| import sinon from 'sinon'; | ||
| import reportPlugin from '../plugins/reportingPlugin'; | ||
| import Registry from './Registry'; | ||
| import { registryFactory } from './factory'; | ||
|
|
||
| const registryConfig = { | ||
| apps: {}, | ||
| routes: [], | ||
| specialRoutes: [], | ||
| settings: {}, | ||
| sharedLibs: {}, | ||
| dynamicLibs: {}, | ||
| }; | ||
|
|
||
| describe('registryFactory', () => { | ||
| const registryAddress: string = config.get('registry.address'); | ||
|
|
||
| let logger: { debug: sinon.SinonStub; info: sinon.SinonStub; warn: sinon.SinonStub; error: sinon.SinonStub }; | ||
|
|
||
| beforeEach(() => { | ||
| logger = { debug: sinon.stub(), info: sinon.stub(), warn: sinon.stub(), error: sinon.stub() }; | ||
| sinon.stub(reportPlugin, 'getLogger').returns(logger); | ||
| }); | ||
|
|
||
| afterEach(() => { | ||
| sinon.restore(); | ||
| nock.cleanAll(); | ||
| }); | ||
|
|
||
| it('creates a Registry that fetches config from the configured registry address', async () => { | ||
| const scope = nock(registryAddress).get('/api/v1/config').reply(200, registryConfig); | ||
|
|
||
| const registry = registryFactory(); | ||
|
|
||
| expect(registry).to.be.instanceOf(Registry); | ||
| expect(await registry.getConfig()).to.deep.equal(registryConfig); | ||
| expect(scope.isDone()).to.be.true; | ||
| }); | ||
|
|
||
| it('logs a warning when the registry cache evicts an entry after exceeding 1000 keys', async () => { | ||
| const requestsCount = 1001; | ||
| sinon.stub(axios, 'get').resolves({ data: registryConfig }); | ||
|
|
||
| const registry = registryFactory(); | ||
|
|
||
| // Every domain filter produces a distinct cache key, so the 1001st entry evicts the oldest one | ||
| await Promise.all( | ||
| Array.from({ length: requestsCount }, (_, index) => | ||
| registry.getConfig({ filter: { domain: `domain-${index}.example.com` } }), | ||
| ), | ||
| ); | ||
|
|
||
| sinon.assert.calledOnceWithExactly( | ||
| logger.warn, | ||
| { key: sinon.match.string }, | ||
| sinon.match('ILC registry cache eviction: maxSize (1000) exceeded.'), | ||
| ); | ||
| }); | ||
|
|
||
| it('does not log an eviction warning while the cache stays within 1000 keys', async () => { | ||
| const requestsCount = 1000; | ||
| sinon.stub(axios, 'get').resolves({ data: registryConfig }); | ||
|
|
||
| const registry = registryFactory(); | ||
|
|
||
| await Promise.all( | ||
| Array.from({ length: requestsCount }, (_, index) => | ||
| registry.getConfig({ filter: { domain: `domain-${index}.example.com` } }), | ||
| ), | ||
| ); | ||
|
|
||
| sinon.assert.notCalled(logger.warn); | ||
| }); | ||
| }); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR adds
overridesblocks here and inilc,registryandregistry/client, but nothing records which advisory each pin addresses, and the PR description is empty. Overrides keep forcing a version regardless of what upstream later declares, so without a reference nobody can tell when one is safe to drop. Two examples from this block:editorconfig → minimatch ^9.0.7: editorconfig 1.0.7's own range (^9.0.1) already admits the patched 9.0.9, so a lockfile refresh gives the same result without a permanent pin.mocha → diff ^8.0.3: right for the mocha 11.7.5 locked here (diff 7 is the affected one), but once mocha moves to 12 (which wantsdiff ^9) this override will force diff 8 back onto it.Could you add a one-line comment or PR note per override naming the GHSA/CVE it fixes?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added in PR desc, package.json could not commented in a good way.