Skip to content
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

[bug] Renovate seems broken #3634

Closed
ianlewis opened this issue May 14, 2024 · 4 comments · Fixed by #3635
Closed

[bug] Renovate seems broken #3634

ianlewis opened this issue May 14, 2024 · 4 comments · Fixed by #3635
Labels
area:tooling An issue with project tooling and config type:bug Something isn't working

Comments

@ianlewis
Copy link
Member

Renovate seems to not be working properly since #3019 was merged. All the PRs were closed and the Dependency Dashboard (#408) hasn't been updated.

@ianlewis ianlewis added type:bug Something isn't working area:tooling An issue with project tooling and config labels May 14, 2024
@ianlewis
Copy link
Member Author

ianlewis commented May 14, 2024

Is the config:base preset even a thing anymore? I can't find a reference to it at all.
https://docs.renovatebot.com/presets-config/

@ianlewis
Copy link
Member Author

Running renovate-config-validator on the current renovate.json in main results in the following errors. It mentions that we need to migrate the config:base preset to config:recommended and that the schedule setting is invalid.

$ npx --yes --package renovate -- renovate-config-validator --strict                                                                      
 INFO: Validating renovate.json
 WARN: Config migration necessary
       "oldConfig": {               
         "$schema": "https://docs.renovatebot.com/renovate-schema.json",
         "extends": ["config:base", ":gitSignOff"],       
         "schedule": ["before 4 am on the first day of the month"],
         "vulnerabilityAlerts": {"schedule": "before 4am"},
         "postUpdateOptions": ["gomodTidy", "gomodUpdateImportPaths"],                                                                                        
         "packageRules": [
           {
             "matchManagers": ["github-actions"],
             "excludePackageNames": ["slsa-framework/slsa-github-generator"],
             "groupName": "github-actions",
             "pinDigests": true
           },
           {
             "matchManagers": ["github-actions"],
             "matchPackageNames": ["slsa-framework/slsa-github-generator"],
             "groupName": "github-actions",
             "pinDigests": false
           },
           {
             "matchManagers": ["dockerfile"],
             "matchPackageNames": ["golang"],
             "matchUpdateTypes": ["minor", "patch"],
             "groupName": "golang"
           },
           {
             "matchManagers": ["gomod"],
             "matchPackageNames": ["go"],
             "matchUpdateTypes": ["minor", "patch"],
             "groupName": "golang"
           },
           {
             "matchManagers": ["gomod"],
             "excludePackageNames": ["go", "github.com/in-toto/in-toto-golang"],
             "matchUpdateTypes": ["minor", "patch"],
             "groupName": "go"
           },
           {
             "matchManagers": ["npm"],
             "matchDepTypes": ["dependencies"],
             "matchUpdateTypes": ["minor", "patch"],
             "groupName": "npm"
           },
           {
             "matchManagers": ["npm"],
             "matchDepTypes": ["devDependencies"],
             "groupName": "npm dev"
           }
         ]
       },
       "newConfig": {               
         "$schema": "https://docs.renovatebot.com/renovate-schema.json",
         "extends": ["config:recommended", ":gitSignOff"],
         "schedule": ["before 4 am on the first day of the month"],
         "vulnerabilityAlerts": {"schedule": "before 4am"},
         "postUpdateOptions": ["gomodTidy", "gomodUpdateImportPaths"],                                                                                        
         "packageRules": [
           {
             "matchManagers": ["github-actions"],
             "excludePackageNames": ["slsa-framework/slsa-github-generator"],
             "groupName": "github-actions",
             "pinDigests": true
           },
           {
             "matchManagers": ["github-actions"],
             "matchPackageNames": ["slsa-framework/slsa-github-generator"],
             "groupName": "github-actions",
             "pinDigests": false
           },
           {
             "matchManagers": ["dockerfile"],
             "matchPackageNames": ["golang"],
             "matchUpdateTypes": ["minor", "patch"],
             "groupName": "golang"
           },
           {
             "matchManagers": ["gomod"],
             "matchPackageNames": ["go"],
             "matchUpdateTypes": ["minor", "patch"],
             "groupName": "golang"
           },
           {
             "matchManagers": ["gomod"],
             "excludePackageNames": ["go", "github.com/in-toto/in-toto-golang"],
             "matchUpdateTypes": ["minor", "patch"],
             "groupName": "go"
           },
           {
             "matchManagers": ["npm"],
             "matchDepTypes": ["dependencies"],
             "matchUpdateTypes": ["minor", "patch"],
             "groupName": "npm"
           },
           {
             "matchManagers": ["npm"],
             "matchDepTypes": ["devDependencies"],
             "groupName": "npm dev"
           }
         ]
       }
ERROR: Found errors in configuration
       "file": "renovate.json",
       "errors": [
         {
           "topic": "Configuration Error",
           "message": "Invalid schedule: `Invalid schedule: Failed to parse \"before 4 am on the first day of the month\"`"
         }
       ]

@ianlewis
Copy link
Member Author

It seems that renovate will reopen the same issue (#404) if the config is invalid rather than creating a new issue. That may be one reason that this went unnoticed.

@ramonpetgrave64
Copy link
Collaborator

ramonpetgrave64 commented May 15, 2024

Fixed the schedule
#3638 (comment)

ramonpetgrave64 added a commit that referenced this issue May 15, 2024
# Summary

Fixes renovate config to use the
[`config:best-practices`](https://docs.renovatebot.com/presets-config/#configbest-practices)
preset rather than the `config:base` preset since `config:base` seems to
have gone away at some point.

Also fixes the `schedule` config by using the
[`schedule:monthly`](https://docs.renovatebot.com/presets-schedule/#schedulemonthly)
preset. The previous `schedule` config seems to have been invalid
because "4 am" had space between "4" and "am" (this was fixed in the
`slsa-verifier` repo on
slsa-framework/slsa-verifier#727 but was never
fixed here).

Also adds a pre-submit to run the
[`renovate-config-validator`](https://docs.renovatebot.com/config-validation/)
to ensure that renovate config is valid. This pre-submit will need to be
made required in the repository branch protection rule for `main` in the
repository settings after this PR is merged.

Fixes #3634 #404 

## Testing Process

- Run `make renovate-config-validator` to check that the config is
valid.

## Checklist

- [x] Review the contributing
[guidelines](https://github.com/slsa-framework/slsa-github-generator/blob/main/CONTRIBUTING.md)
- [x] Add a reference to related issues in the PR description.
- [x] Update documentation if applicable.
- [x] Add unit tests if applicable.
- [x] Add changes to the
[CHANGELOG](https://github.com/slsa-framework/slsa-github-generator/blob/main/CHANGELOG.md)
if applicable.

---------

Signed-off-by: Ian Lewis <ianlewis@google.com>
Signed-off-by: Ramon Petgrave <32398091+ramonpetgrave64@users.noreply.github.com>
Co-authored-by: Ramon Petgrave <32398091+ramonpetgrave64@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:tooling An issue with project tooling and config type:bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants