chore(ci): conditionally stamp genrules (#63204)

See https://github.com/bazelbuild/bazel/releases/tag/7.1.0 which
introduces a new value for the stamp attribute for `genrule`: `stamp =
-1` which makes the stamping conditional.

Previously, any genrule that had `stamp = 1` would be stamping all the
time due to how it was implemented prior 7.1. An as we stamp builds with
a computed version that is date dependent, we would never get cache hits
on those, leading to `//cmd/migrator:image_test` being executed all the
time. It wasn't that big of an issue as it's rather quick, but still.

Now the `genrule` supports that there's no reason to fix that one. 


## Test plan

<!-- All pull requests REQUIRE a test plan:
https://docs-legacy.sourcegraph.com/dev/background-information/testing_principles
-->

CI 

## Changelog

- Avoid invalidating cache in stamped genrules on dev builds.
This commit is contained in:
Jean-Hadrien Chabran 2024-06-12 15:04:43 +02:00 committed by GitHub
parent bce9eeeb7c
commit fa7fce585c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View File

@ -63,7 +63,7 @@ genrule(
tar -cf $@ --owner=:0 --group=:0 --numeric-owner schema-descriptions/
fi
""",
stamp = 1,
stamp = -1,
visibility = ["//visibility:public"],
)

View File

@ -71,7 +71,7 @@ genrule(
tar -cf $@ --owner=:0 --group=:0 --numeric-owner schema-descriptions/
fi
""",
stamp = 1,
stamp = -1,
tags = ["requires-network"],
tools = [":airgappedgen"],
visibility = ["//cmd/migrator:__subpackages__"],