Skip to content

Commit

Permalink
fix(dependencies): version should be latest if not specified
Browse files Browse the repository at this point in the history
  • Loading branch information
bodinsamuel committed Sep 17, 2023
1 parent 0c1ff91 commit ffb6d14
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 8 deletions.
5 changes: 5 additions & 0 deletions .renovaterc.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,10 @@
],
"baseBranches": [
"chore/renovateBaseBranch"
],
"prHourlyLimit": 10,
"prConcurrentLimit": 10,
"schedule": [
"after 10pm every weekday"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ exports[`docker > should match all dependencies 2`] = `
[
"docker",
"postgres",
"15.4-alpine",
"latest",
],
[
"githubAction",
Expand Down Expand Up @@ -431,7 +431,7 @@ exports[`docker > should match all dependencies 2`] = `
[
"githubAction",
"snyk/actions/php",
undefined,
"latest",
],
[
"githubAction",
Expand Down
2 changes: 1 addition & 1 deletion src/rules/spec/githubActions/component.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
postgres:
env:
POSTGRES_PASSWORD: postgres
image: postgres:15.4-alpine
image: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
Expand Down
6 changes: 3 additions & 3 deletions src/rules/spec/githubActions/component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export const detectGithubActionsComponent: ComponentMatcher = async (
for (const step of config.steps) {
if (step.uses) {
const [name, version] = step.uses.split('@');
dependencies.push(['githubAction', name, version]);
dependencies.push(['githubAction', name, version || 'latest']);
const matched = matchDependencies([name], 'githubAction');
if (matched.size > 0) {
pl.addTechs(matched);
Expand All @@ -76,7 +76,7 @@ export const detectGithubActionsComponent: ComponentMatcher = async (

if (config.container) {
const [imageName, imageVersion] = config.container.split(':');
dependencies.push(['docker', imageName, imageVersion]);
dependencies.push(['docker', imageName, imageVersion || 'latest']);
const matched = matchDependencies([imageName], 'docker');
if (matched.size > 0) {
pl.addTechs(matched);
Expand All @@ -89,7 +89,7 @@ export const detectGithubActionsComponent: ComponentMatcher = async (
continue;
}
const [imageName, imageVersion] = service.image.split(':');
dependencies.push(['docker', imageName, imageVersion]);
dependencies.push(['docker', imageName, imageVersion || 'latest']);
const matched = matchDependencies([imageName], 'docker');
if (matched.size > 0) {
pl.addTechs(matched);
Expand Down
2 changes: 1 addition & 1 deletion src/rules/spec/golang/lockfile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export const detectGolangLockfile: ComponentMatcher = async (
continue;
}

dependencies.push(['golang', url, version]);
dependencies.push(['golang', url, version || 'latest']);
const matched = matchDependencies([url], 'golang');
if (matched.size <= 0) {
continue;
Expand Down
2 changes: 1 addition & 1 deletion src/rules/spec/ruby/lockfile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export const detectRubyLockfile: ComponentMatcher = async (files, provider) => {
const techs = matchDependencies(Object.keys(deps), 'ruby');
const depsFlatten: Analyser['dependencies'] = Object.entries(deps).map(
([name, value]) => {
return ['ruby', name, value];
return ['ruby', name, value || 'latest'];
}
);

Expand Down

0 comments on commit ffb6d14

Please sign in to comment.