From 8463b0fbb1cc457716feb6386e75306bb1e8ffa8 Mon Sep 17 00:00:00 2001 From: DineshKumarRA Date: Sun, 3 Nov 2024 21:54:19 +0000 Subject: [PATCH 1/9] Updated renovate.json to add correct commitMessagePrefix based on packages --- renovate.json | 37 ++++++++++++++++++++++--------------- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/renovate.json b/renovate.json index d21056870ba50..7698075745b27 100644 --- a/renovate.json +++ b/renovate.json @@ -4,33 +4,40 @@ "labels": ["dependencies"], "packageRules": [ { - "matchPackageNames": ["bazel", "bazelisk"], - "commitMessageSuffix": "[dotnet][java][js][py][rb][rust]" + "matchManagers": ["bazel", "bazel-module", "bazelisk"], + "commitMessagePrefix": "[dotnet][java][js][py][rb][rust]", + "labels": ["c-build"] }, { - "matchPackageNames": ["nuget"], - "commitMessagePrefix": "[dotnet]" + "matchManagers": ["nuget"], + "commitMessagePrefix": "[dotnet]", + "labels": ["c-dotnet"] }, { - "matchPackageNames": ["maven"], - "commitMessagePrefix": "[java]" + "matchManagers": ["maven", "github-actions"], + "commitMessagePrefix": "[java]", + "labels": ["c-java"] }, { - "matchPackageNames": ["npm"], - "commitMessagePrefix": "[js]" + "matchManagers": ["npm"], + "commitMessagePrefix": "[js]", + "labels": ["c-nodejs"] }, { - "matchPackageNames": ["pip_requirements"], - "commitMessagePrefix": "[py]" + "matchManagers": ["pip_requirements", "pip_setup", "pep621"], + "commitMessagePrefix": "[py]", + "labels": ["c-py"] }, { - "matchPackageNames": ["bundler", "ruby-version"], - "commitMessagePrefix": "[rb]" + "matchManagers": ["bundler", "ruby-version"], + "commitMessagePrefix": "[rb]", + "labels": ["c-rb"] }, { - "matchPackageNames": ["cargo"], - "commitMessagePrefix": "[rust]" + "matchManagers": ["cargo"], + "commitMessagePrefix": "[rust]", + "labels": ["c-rust"] } ], - "prConcurrentLimit": 5 + "prConcurrentLimit": 15 } From c4d6ea09e9a364ecf0c409b680ff0521c3c33e1c Mon Sep 17 00:00:00 2001 From: DineshKumarRA Date: Tue, 5 Nov 2024 10:24:06 +0000 Subject: [PATCH 2/9] Updated to add prefix for more packages --- renovate.json | 68 ++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 54 insertions(+), 14 deletions(-) diff --git a/renovate.json b/renovate.json index 7698075745b27..ee53c766acefb 100644 --- a/renovate.json +++ b/renovate.json @@ -4,39 +4,79 @@ "labels": ["dependencies"], "packageRules": [ { - "matchManagers": ["bazel", "bazel-module", "bazelisk"], + "matchManagers": [ "bazel", "bazel-module", "bazelisk" ], + "matchPackageNames": [ "!rules_java", "!rules_jvm_external", "!contrib_rules_jvm", "!rules_dotnet", "!aspect_rules_js", "!aspect_rules_ts", "!rules_nodejs", "!rules_python", "!rules_ruby", "!rules_cc" ], + "matchDatasources": [ "!maven" ], "commitMessagePrefix": "[dotnet][java][js][py][rb][rust]", - "labels": ["c-build"] + "labels": [ "dependencies", "c-build" ] }, { - "matchManagers": ["nuget"], + "matchManagers": [ "nuget" ], "commitMessagePrefix": "[dotnet]", - "labels": ["c-dotnet"] + "labels": [ "dependencies", "c-dotnet" ] }, { - "matchManagers": ["maven", "github-actions"], + "matchPackageNames": [ "rules_dotnet" ], + "commitMessagePrefix": "[dotnet]", + "labels": [ "dependencies", "c-dotnet" ] + }, + { + "matchManagers": [ "bazel", "bazel-module" ], + "matchDatasources": ["maven"], + "versioning": "maven", + "commitMessagePrefix": "[java]", + "labels": [ "dependencies", "c-java" ] + }, + { + "matchManagers": [ "bazel-module" ], + "matchPackageNames": [ "rules_java", "rules_jvm_external", "contrib_rules_jvm" ], "commitMessagePrefix": "[java]", - "labels": ["c-java"] + "labels": [ "dependencies", "c-java" ] }, { - "matchManagers": ["npm"], + "matchManagers": [ "maven" ], + "commitMessagePrefix": "[java]", + "labels": [ "dependencies", "c-java" ] + }, + { + "matchManagers": [ "npm" ], "commitMessagePrefix": "[js]", - "labels": ["c-nodejs"] + "labels": [ "dependencies", "c-nodejs" ] }, { - "matchManagers": ["pip_requirements", "pip_setup", "pep621"], + "matchPackageNames": [ "aspect_rules_js", "aspect_rules_ts", "rules_nodejs" ], + "commitMessagePrefix": "[js]", + "labels": [ "dependencies", "c-nodejs" ] + }, + { + "matchManagers": [ "pip_requirements", "pip_setup" ], "commitMessagePrefix": "[py]", - "labels": ["c-py"] + "labels": [ "dependencies", "c-py" ] + }, + { + "matchPackageNames": [ "rules_python" ], + "commitMessagePrefix": "[py]", + "labels": [ "dependencies", "c-py" ] + }, + { + "matchManagers": [ "bundler", "ruby-version" ], + "commitMessagePrefix": "[rb]", + "labels": [ "dependencies", "c-rb" ] }, { - "matchManagers": ["bundler", "ruby-version"], + "matchPackageNames": [ "rules_ruby" ], "commitMessagePrefix": "[rb]", - "labels": ["c-rb"] + "labels": [ "dependencies", "c-rb" ] + }, + { + "matchManagers": [ "cargo" ], + "commitMessagePrefix": "[rust]", + "labels": [ "dependencies", "c-rust" ] }, { - "matchManagers": ["cargo"], + "matchPackageNames": [ "rules_cc" ], "commitMessagePrefix": "[rust]", - "labels": ["c-rust"] + "labels": [ "dependencies", "c-rust" ] } ], "prConcurrentLimit": 15 From c658c7baf5eb6a28eaf671320d0e71a44494110f Mon Sep 17 00:00:00 2001 From: DineshKumarRA Date: Tue, 5 Nov 2024 12:08:37 +0000 Subject: [PATCH 3/9] Added a separate CI for renovate PR's to repin dependencies and run format script --- .github/workflows/ci-rbe.yml | 4 +- .github/workflows/ci-renovate-rbe.yml | 53 +++++++++++++++++++++++++++ renovate.json | 1 - 3 files changed, 55 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/ci-renovate-rbe.yml diff --git a/.github/workflows/ci-rbe.yml b/.github/workflows/ci-rbe.yml index 2e15949925580..e5b89ac0b7f59 100644 --- a/.github/workflows/ci-rbe.yml +++ b/.github/workflows/ci-rbe.yml @@ -10,7 +10,7 @@ on: jobs: format: name: Format - if: github.repository_owner == 'seleniumhq' + if: github.repository_owner == 'seleniumhq' && startsWith(github.head_ref, 'renovate/') != true uses: ./.github/workflows/bazel.yml with: name: Check format script run @@ -20,7 +20,7 @@ jobs: test: name: Test - if: github.repository_owner == 'seleniumhq' + if: github.repository_owner == 'seleniumhq' && startsWith(github.head_ref, 'renovate/') != true uses: ./.github/workflows/bazel.yml with: name: All RBE tests diff --git a/.github/workflows/ci-renovate-rbe.yml b/.github/workflows/ci-renovate-rbe.yml new file mode 100644 index 0000000000000..db8de174a723e --- /dev/null +++ b/.github/workflows/ci-renovate-rbe.yml @@ -0,0 +1,53 @@ +name: CI - Renovate - RBE + +on: + push: + branches: + - renovate/* + workflow_dispatch: + +jobs: + format: + runs-on: ubuntu-latest + if: github.repository_owner == 'seleniumhq' + steps: + - name: Checkout Repository + uses: actions/checkout@v2 + - name: Repin Dependencies + run: | + REPIN=1 bazel run @maven//:pin + - name: Run format script + run: ./scripts/format.sh + - name: Commit files + run: | + export CHANGES=$(git status -s) + if [ -n "$CHANGES" ]; then + git config --local user.email "selenium-ci@users.noreply.github.com" + git config --local user.name "Selenium CI Bot" + git add ./java/maven_install.json + git commit -m 'Repin maven dependencies' + echo "code_changes=true" >> $GITHUB_ENV + fi + - name: Push changes + if: ${{ env.code_changes }} == 'true' + uses: ad-m/github-push-action@master + with: + github_token: ${{ secrets.SELENIUM_CI_TOKEN }} + branch: ${{ github.ref }} + - name: Format + uses: ./.github/workflows/bazel.yml + with: + name: Check format script run + caching: false + ruby-version: jruby-9.4.8.0 + run: ./scripts/github-actions/check-format.sh + + test: + name: Test + if: github.repository_owner == 'seleniumhq' + uses: ./.github/workflows/bazel.yml + with: + name: All RBE tests + caching: false + ruby-version: jruby-9.4.8.0 + run: ./scripts/github-actions/ci-build.sh diff --git a/renovate.json b/renovate.json index ee53c766acefb..c6c26058b2989 100644 --- a/renovate.json +++ b/renovate.json @@ -1,7 +1,6 @@ { "$schema": "https://docs.renovatebot.com/renovate-schema.json", "extends": ["config:recommended"], - "labels": ["dependencies"], "packageRules": [ { "matchManagers": [ "bazel", "bazel-module", "bazelisk" ], From ca808c48532de52de5169b01e894a8b8f275d6fc Mon Sep 17 00:00:00 2001 From: DineshKumarRA Date: Tue, 5 Nov 2024 12:09:47 +0000 Subject: [PATCH 4/9] updated branch name ref in the renovate ci --- .github/workflows/ci-renovate-rbe.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-renovate-rbe.yml b/.github/workflows/ci-renovate-rbe.yml index db8de174a723e..24bb4c0171c99 100644 --- a/.github/workflows/ci-renovate-rbe.yml +++ b/.github/workflows/ci-renovate-rbe.yml @@ -33,7 +33,7 @@ jobs: uses: ad-m/github-push-action@master with: github_token: ${{ secrets.SELENIUM_CI_TOKEN }} - branch: ${{ github.ref }} + branch: ${{ github.head_ref }} - name: Format uses: ./.github/workflows/bazel.yml with: From dc238bc07c400207d2a84d9701c2c625e77b5379 Mon Sep 17 00:00:00 2001 From: DineshKumarRA Date: Tue, 5 Nov 2024 23:57:15 +0000 Subject: [PATCH 5/9] Review comments addressed by adding check format as a separate action instead of a step --- .github/workflows/bazel.yml | 3 +++ .github/workflows/ci-renovate-rbe.yml | 28 +++++++++++++-------------- 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/.github/workflows/bazel.yml b/.github/workflows/bazel.yml index 428ac9ae6f87a..9a9cb2f0c1c4f 100644 --- a/.github/workflows/bazel.yml +++ b/.github/workflows/bazel.yml @@ -82,6 +82,9 @@ jobs: steps: - name: Checkout source tree uses: actions/checkout@v4 + - name: Pull latest changes + if: startsWith(github.head_ref, 'renovate/') == true + run: git pull origin ${{ github.head_ref }} - name: Free space if: inputs.os != 'windows' run: ./scripts/github-actions/free-disk-space.sh diff --git a/.github/workflows/ci-renovate-rbe.yml b/.github/workflows/ci-renovate-rbe.yml index 24bb4c0171c99..22e790d97a6d8 100644 --- a/.github/workflows/ci-renovate-rbe.yml +++ b/.github/workflows/ci-renovate-rbe.yml @@ -12,7 +12,7 @@ jobs: if: github.repository_owner == 'seleniumhq' steps: - name: Checkout Repository - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Repin Dependencies run: | REPIN=1 bazel run @maven//:pin @@ -26,21 +26,19 @@ jobs: git config --local user.name "Selenium CI Bot" git add ./java/maven_install.json git commit -m 'Repin maven dependencies' - echo "code_changes=true" >> $GITHUB_ENV + git push fi - - name: Push changes - if: ${{ env.code_changes }} == 'true' - uses: ad-m/github-push-action@master - with: - github_token: ${{ secrets.SELENIUM_CI_TOKEN }} - branch: ${{ github.head_ref }} - - name: Format - uses: ./.github/workflows/bazel.yml - with: - name: Check format script run - caching: false - ruby-version: jruby-9.4.8.0 - run: ./scripts/github-actions/check-format.sh + + check-format: + needs: format + name: Check format + if: github.repository_owner == 'DineshKumarRA' + uses: ./.github/workflows/bazel.yml + with: + name: Check format script run + caching: false + ruby-version: jruby-9.4.8.0 + run: ./scripts/github-actions/check-format.sh test: name: Test From 1019650c55de739e83c9d0d1c32b8634d481b704 Mon Sep 17 00:00:00 2001 From: DineshKumarRA Date: Wed, 6 Nov 2024 00:05:24 +0000 Subject: [PATCH 6/9] Removed the newly added loop in bazel.yml --- .github/workflows/bazel.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/bazel.yml b/.github/workflows/bazel.yml index 9a9cb2f0c1c4f..f77eb03616e1a 100644 --- a/.github/workflows/bazel.yml +++ b/.github/workflows/bazel.yml @@ -83,7 +83,6 @@ jobs: - name: Checkout source tree uses: actions/checkout@v4 - name: Pull latest changes - if: startsWith(github.head_ref, 'renovate/') == true run: git pull origin ${{ github.head_ref }} - name: Free space if: inputs.os != 'windows' From a6eaa71d3f2c81869e1cbec1dd6afccbf2c05c08 Mon Sep 17 00:00:00 2001 From: DineshKumarRA Date: Wed, 6 Nov 2024 09:04:19 +0000 Subject: [PATCH 7/9] Added loop to do the pull only when repository_owner is seleniumhq --- .github/workflows/bazel.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/bazel.yml b/.github/workflows/bazel.yml index f77eb03616e1a..ce047c637e0a3 100644 --- a/.github/workflows/bazel.yml +++ b/.github/workflows/bazel.yml @@ -83,6 +83,7 @@ jobs: - name: Checkout source tree uses: actions/checkout@v4 - name: Pull latest changes + if: github.repository_owner == 'seleniumhq' run: git pull origin ${{ github.head_ref }} - name: Free space if: inputs.os != 'windows' From 0ede3fd62ed269225a51a71af0148368b27f2543 Mon Sep 17 00:00:00 2001 From: DineshKumarRA Date: Sat, 16 Nov 2024 22:42:41 +0000 Subject: [PATCH 8/9] Add all the changed files to commit after running the repin deps --- .github/workflows/bazel.yml | 2 +- .github/workflows/ci-renovate-rbe.yml | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/bazel.yml b/.github/workflows/bazel.yml index 5d94842e0cd63..69f5ab7c2256f 100644 --- a/.github/workflows/bazel.yml +++ b/.github/workflows/bazel.yml @@ -83,7 +83,7 @@ jobs: - name: Checkout source tree uses: actions/checkout@v4 - name: Pull latest changes - if: github.repository_owner == 'seleniumhq' + if: startsWith(github.head_ref, 'renovate/') run: git pull origin ${{ github.head_ref }} - name: Free space if: inputs.os != 'windows' diff --git a/.github/workflows/ci-renovate-rbe.yml b/.github/workflows/ci-renovate-rbe.yml index 22e790d97a6d8..06408b6330ce0 100644 --- a/.github/workflows/ci-renovate-rbe.yml +++ b/.github/workflows/ci-renovate-rbe.yml @@ -16,15 +16,14 @@ jobs: - name: Repin Dependencies run: | REPIN=1 bazel run @maven//:pin - - name: Run format script - run: ./scripts/format.sh + CARGO_BAZEL_REPIN=true bazel sync --only=crates - name: Commit files run: | export CHANGES=$(git status -s) if [ -n "$CHANGES" ]; then git config --local user.email "selenium-ci@users.noreply.github.com" git config --local user.name "Selenium CI Bot" - git add ./java/maven_install.json + git add . git commit -m 'Repin maven dependencies' git push fi @@ -32,7 +31,7 @@ jobs: check-format: needs: format name: Check format - if: github.repository_owner == 'DineshKumarRA' + if: github.repository_owner == 'seleniumhq' uses: ./.github/workflows/bazel.yml with: name: Check format script run From d18288ff0ab1bb879c52e9a60faee8d7b33b0a91 Mon Sep 17 00:00:00 2001 From: DineshKumarRA Date: Thu, 28 Nov 2024 22:41:39 +0000 Subject: [PATCH 9/9] repin dependencies for all the languages --- .github/workflows/ci-renovate-rbe.yml | 21 ++++++++++++++++----- renovate.json | 2 +- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci-renovate-rbe.yml b/.github/workflows/ci-renovate-rbe.yml index 06408b6330ce0..fc00c8761b1a7 100644 --- a/.github/workflows/ci-renovate-rbe.yml +++ b/.github/workflows/ci-renovate-rbe.yml @@ -13,10 +13,21 @@ jobs: steps: - name: Checkout Repository uses: actions/checkout@v4 - - name: Repin Dependencies - run: | - REPIN=1 bazel run @maven//:pin - CARGO_BAZEL_REPIN=true bazel sync --only=crates + - name: java - repin dependencies + if: contains(join(github.event.commits.*.message), '[java]') + run: REPIN=1 bazel run @maven//:pin + - name: rust - repin dependencies + if: contains(join(github.event.commits.*.message), '[rust]') + run: CARGO_BAZEL_REPIN=true bazel sync --only=crates + - name: js - repin dependencies + if: contains(join(github.event.commits.*.message), '[js]') + run: bazel run -- @pnpm//:pnpm install --dir $PWD --lockfile-only + - name: dotnet - repin dependencies + if: contains(join(github.event.commits.*.message), '[dotnet]') + run: ./dotnet/update-deps.sh + - name: py - repin dependencies + if: contains(join(github.event.commits.*.message), '[py]') + run: bazel run //py:requirements.update - name: Commit files run: | export CHANGES=$(git status -s) @@ -24,7 +35,7 @@ jobs: git config --local user.email "selenium-ci@users.noreply.github.com" git config --local user.name "Selenium CI Bot" git add . - git commit -m 'Repin maven dependencies' + git commit -m 'Repin dependencies' git push fi diff --git a/renovate.json b/renovate.json index c6c26058b2989..f5aba04d1c54e 100644 --- a/renovate.json +++ b/renovate.json @@ -78,5 +78,5 @@ "labels": [ "dependencies", "c-rust" ] } ], - "prConcurrentLimit": 15 + "prConcurrentLimit": 10 }