bazel-contrib / bazel-contrib/bazel-lib

[FR] Simple validation of stamp substitutions in expand_template

Open
#954 0 comments 0 reactions 0 assignees View on GitHub
help wanted need: funding
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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.