mirror of
https://github.com/renovatebot/renovate.git
synced 2026-10-27 07:50:47 +00:00
8776389291
* feat(vulnerability): Add vulnerability alerts to deps-end + lein deps-edn and lein both essentially use maven upstream for several packages. Some packages come from clojars directly but others are typical java packages. If there is an OSV alert for a maven package however, it will not propagate to the deps-edn or lein dependency update from renovate. This tries to adjust that so that clojure can derive dependency alerts from maven as well so that those dependencies are treated the same way. * chore: Code review feedback * chore: Make ecosystem to datasource one to many Technically datasource to ecosystem was already many to one in a way, as maven appeared in the values twice. Once for clojure and once for maven itself. This changes it so that the ecosystem to datasource is the same way and looking up by ecosystem you will get multiple datasources (should match the map above the modified code). Then to make this work, instead of keying off of datasource for vulnerabilities we key off of ecosystem so that all of the datasources that are part of that ecosystem inherit the vulnerabilities for the same dependency. * chore: Tweaking to try to force CI/CD retry
59 lines
1.8 KiB
TypeScript
59 lines
1.8 KiB
TypeScript
import {
|
|
datasourceToOsvEcosystem,
|
|
githubEcosystemToDatasource,
|
|
} from './ecosystem.ts';
|
|
|
|
describe('util/vulnerability/ecosystem', () => {
|
|
describe('datasourceToOsvEcosystem', () => {
|
|
it('maps crate datasource to crates.io ecosystem', () => {
|
|
expect(datasourceToOsvEcosystem.crate).toBe('crates.io');
|
|
});
|
|
|
|
it('maps clojure datasource to Maven ecosystem', () => {
|
|
expect(datasourceToOsvEcosystem.clojure).toBe('Maven');
|
|
});
|
|
|
|
it('maps go datasource to Go ecosystem', () => {
|
|
expect(datasourceToOsvEcosystem.go).toBe('Go');
|
|
});
|
|
|
|
it('maps npm datasource to npm ecosystem', () => {
|
|
expect(datasourceToOsvEcosystem.npm).toBe('npm');
|
|
});
|
|
|
|
it('maps pypi datasource to PyPI ecosystem', () => {
|
|
expect(datasourceToOsvEcosystem.pypi).toBe('PyPI');
|
|
});
|
|
|
|
it('returns undefined for unknown datasource', () => {
|
|
expect(datasourceToOsvEcosystem.unknown).toBeUndefined();
|
|
});
|
|
});
|
|
|
|
describe('githubEcosystemToDatasource', () => {
|
|
it('maps actions to github-tags datasource', () => {
|
|
expect(githubEcosystemToDatasource.actions).toEqual(['github-tags']);
|
|
});
|
|
|
|
it('maps pip to pypi datasource', () => {
|
|
expect(githubEcosystemToDatasource.pip).toEqual(['pypi']);
|
|
});
|
|
|
|
it('maps rust to crate datasource', () => {
|
|
expect(githubEcosystemToDatasource.rust).toEqual(['crate']);
|
|
});
|
|
|
|
it('maps npm to npm datasource', () => {
|
|
expect(githubEcosystemToDatasource.npm).toEqual(['npm']);
|
|
});
|
|
|
|
it('maps composer to packagist datasource', () => {
|
|
expect(githubEcosystemToDatasource.composer).toEqual(['packagist']);
|
|
});
|
|
|
|
it('maps maven to both maven and clojure datasources', () => {
|
|
expect(githubEcosystemToDatasource.maven).toEqual(['maven', 'clojure']);
|
|
});
|
|
});
|
|
});
|