Skip to content

Commit 6eb8b00

Browse files
authored
Merge pull request #17525 from protocolbuffers/fix-25.x-staleness
backport staleness changes to 25.x
2 parents 314fc8b + d491c4c commit 6eb8b00

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

.github/workflows/staleness_check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040

4141
- name: Run all staleness tests
4242
env:
43-
USE_BAZEL_VERSION: '6.3.0'
43+
USE_BAZEL_VERSION: '6.3.2'
4444
# Run all tests if either of the following is true, otherwise simply run the query to make
4545
# sure it continues to work:
4646
# 1) If this is not a commit-based run it means it's scheduled or manually dispatched. In

regenerate_stale_files.sh

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,24 @@ cd $(dirname -- "$0")
1212

1313
readonly BazelBin="${BAZEL:-bazel} ${BAZEL_STARTUP_FLAGS}"
1414

15+
STALENESS_TESTS=(
16+
"src:cmake_lists_staleness_test"
17+
"src/google/protobuf:well_known_types_staleness_test"
18+
"objectivec:well_known_types_staleness_test"
19+
"php:test_amalgamation_staleness"
20+
"ruby/ext/google/protobuf_c:test_amalgamation_staleness"
21+
"upb/cmake:test_generated_files"
22+
)
23+
1524
# Run and fix all staleness tests.
16-
${BazelBin} test src:cmake_lists_staleness_test "$@" || ./bazel-bin/src/cmake_lists_staleness_test --fix
17-
${BazelBin} test src/google/protobuf:well_known_types_staleness_test "$@" || ./bazel-bin/src/google/protobuf/well_known_types_staleness_test --fix
18-
${BazelBin} test objectivec:well_known_types_staleness_test "$@" || ./bazel-bin/objectivec/well_known_types_staleness_test --fix
19-
${BazelBin} test php:test_amalgamation_staleness "$@" || ./bazel-bin/php/test_amalgamation_staleness --fix
20-
${BazelBin} test ruby/ext/google/protobuf_c:test_amalgamation_staleness "$@" || ./bazel-bin/ruby/ext/google/protobuf_c/test_amalgamation_staleness --fix
21-
${BazelBin} test upb/cmake:test_generated_files "$@" || ./bazel-bin/upb/cmake/test_generated_files --fix
25+
for test in ${STALENESS_TESTS[@]}; do
26+
${BazelBin} test $test "$@" || ./bazel-bin/${test%%:*}/${test#*:} --fix
27+
done
2228

2329
# Generate C# code.
2430
# This doesn't currently have Bazel staleness tests, but there's an existing
2531
# shell script that generates everything required. The output files are stable,
26-
# so just regenerating in place should be harmless.
32+
# so just regenerating in place should be harmless.
2733
${BazelBin} build src/google/protobuf/compiler:protoc "$@"
2834
(export PROTOC=$PWD/bazel-bin/protoc && cd csharp && ./generate_protos.sh)
2935

0 commit comments

Comments
 (0)