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

chore: Add renovate bot config validation workflow #2404

Merged
merged 10 commits into from
Jan 22, 2024
Merged

Conversation

ddixit14
Copy link
Contributor

@ddixit14 ddixit14 commented Jan 20, 2024

Changes in this PR introduce renovate bot config validation workflow for this repository. Upon every commit to "renovate.json" file, this check will run.

@ddixit14 ddixit14 requested a review from a team as a code owner January 20, 2024 23:56
@product-auto-label product-auto-label bot added the size: xs Pull request size is extra small. label Jan 20, 2024
@product-auto-label product-auto-label bot added size: s Pull request size is small. and removed size: xs Pull request size is extra small. labels Jan 21, 2024
@ddixit14
Copy link
Contributor Author

Commit (948d393) resulted in check error, as expected. Hence confirmed it is workin on this repository.
image

@ddixit14
Copy link
Contributor Author

Confirming behaviour for one of downstream repos:

check run on java-logging-logback outputs this config, which matches with the actual config. So it should be working for others as well (hopefully). If needed, I can confirm the behaviour in the failure case as well (modify google-cloud-java renovate incorrectly, run the check again, verify, revert the changes).

@@ -321,3 +321,20 @@ jobs:
uses: ./java-shared-dependencies/unmanaged-dependency-check
with:
bom-path: gapic-generator-java-bom/pom.xml

renovate_config_check:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you make this as independent workflow?

Then I think of 2 options:

  • workflow dispatch to periodically validate the config files in ~13 repositories. It's installed in sdk-platform-java.
  • workflow for pull requests that touches renovate.json. It's installed in every ~13 repositories via synthtool template.

What is the trade off?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

synthool is better, periodically validating makes no sense if we can run it upon every touch to renovate.json
Raised googleapis/synthtool#1920

Copy link
Contributor Author

@ddixit14 ddixit14 Jan 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trade off:

  1. Using manual workflow dispatch for periodic validation is not a good idea because
    (a) Manual invocation required everytime
    (b) If there is an error in the config, we would get to know about it only when we run this check manually.
  2. Using synthtool, this check will be installed as an independent workflow in each repository, running on every commit to config file, hence catching errors as and when they are about to be committed. This way we can catch the error faster and better. Cons about this is the maintenance toil via the synthool template.

Hence going with synthool.

@@ -87,3 +87,9 @@ function find_last_release_version {
parts=($(echo "$primary_artifact" | tr ":" "\n"))
echo "${parts[1]}"
}

function validate_renovate_config {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see the command is in the workflow YAML file. This seems unnecessary.

Copy link

sonarcloud bot commented Jan 21, 2024

Quality Gate Passed Quality Gate passed for 'gapic-generator-java-root'

Kudos, no new issues were introduced!

0 New issues
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

Copy link

sonarcloud bot commented Jan 21, 2024

Quality Gate Passed Quality Gate passed for 'java_showcase_integration_tests'

Kudos, no new issues were introduced!

0 New issues
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

Copy link
Member

@suztomo suztomo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update the pull request description.

@ddixit14 ddixit14 merged commit 71e2333 into main Jan 22, 2024
39 checks passed
@ddixit14 ddixit14 deleted the renovate-check branch January 22, 2024 15:53
@ddixit14 ddixit14 changed the title chore: renovate bot config validation chore: Add renovate bot config validation workflow Jan 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size: s Pull request size is small.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants