Add per-target bazel run arg/env delegation for itest_* targets - #84
Add per-target bazel run arg/env delegation for itest_* targets#84darkrift wants to merge 1 commit into
bazel run arg/env delegation for itest_* targets#84Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2574af7cd0
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| return [ | ||
| str(native.package_relative_label(label)) | ||
| for label in labels |
There was a problem hiding this comment.
Preserve configurable service labels
When deps or services is supplied as a configurable select(...), this new helper tries to iterate that selector during macro expansion before forwarding it to the underlying attr.label_list. Those attrs were previously passed through unchanged, so existing users with platform/config-specific service graphs now fail to load even if they are not using target-argument delegation. Consider preserving select values or making the new internal metadata configurable as well.
Useful? React with 👍 / 👎.
| bazel run //path/to:target -- \ | ||
| --target_env //path/to:some_task EXTRA_ENV=value \ | ||
| --target_arg //path/to:some_task --flag value --other-flag "two words" \ | ||
| --target_env //path/to:service_alias EXTRA_ENV=value "OTHER_ENV=value with space" \ |
There was a problem hiding this comment.
Don't document unsupported multi-env syntax
The documented command shows two KEY=VALUE entries after one --target_env, but the parser only consumes the single token at i+2; the second assignment is then treated as a positional argument for the previous --target_arg section. Users following this example will silently pass OTHER_ENV=... as an arg instead of setting it on service_alias, so split the example into separate --target_env invocations or update the parser to consume multiple assignments.
Useful? React with 👍 / 👎.
This is useful when using
bazel runto locally launch stacks that require custom/personalized arguments and env vars.Summary
itest_*targets via--target_arg--target_envDetails
svcinitto parsebazel runCLI sections and append delegated args to the matching target’s configuredargsKEY=VALUEenv vars into the matching executable target before launch--target_argcarrying multiple arguments for a target--target_envfor per-target env injectionTARGET_ARGS_env output for readabilityTesting
bazel test //cmd/svcinit:svcinit_test //cmd/svcinit/target_args:target_args_testcd examples && bazel build //target_args:workflow