bazel-contrib / bazel-contrib/bazel-lib
[FR] Simple validation of stamp substitutions in expand_template
- Dominant language
- Starlark
- Stars
- 182
- Forks
- 134
- Avg merge
- 1d 46m
- Merged PRs (30d)
- 1
Description
It would be useful to be able to provide simple validations of values given to expand_template to ensure that incorrect information has not been given to Bazel. If the values do not pass validation, the build should fail.
This is particularly important when [implementing "deliverables"](https://docs.aspect.build/workflows/features/delivery/#stamping), since an incorrect stamp might lead to artifacts going to the wrong place.
A validation regex seems like a good balance of simplicity / expressiveness.
For example, a sem-ver regex: https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string
Contributor guide
Research direction
Locate the expand_template entry point and review how stamp substitutions are currently handled. Define the validation-regex interface and failure behavior, then verify that an invalid substitution fails the Bazel build and a valid sem-ver value succeeds.
Written by the indexing model from the issue text.
Assessment
- Domain
- build-system
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100