feat(bazel): featurize deployment behind a generic BazelTrait seam - #1374
Draft
jbedard wants to merge 1 commit into
Draft
feat(bazel): featurize deployment behind a generic BazelTrait seam#1374jbedard wants to merge 1 commit into
jbedard wants to merge 1 commit into
Conversation
Tasks no longer know about deployments. `BazelTrait` grows the seams a
feature needs to wire a build:
base_flags default flags prepended BEFORE the user's --bazel-flag,
so a user override still wins (extra_flags appends after
and therefore beats them)
bes_backends extra CLI-streamed BES backend URIs
bes_results_sources (backend, viewer) pairs the build-result link is drawn
from, matched against what the build actually reports to
rc_flags hooks called with (ctx, resolved rc, command) after the
.bazelrc is parsed, for flags that depend on the FINAL rc
A new `Deployment` feature resolves `--remote` / `--deployment` and fills
those in, including the `--remote_header` / `--bes_header` auth hook that
`bazel/flags.axl` used to own. A bazel-driving task now applies one generic
call, `bazel.rc_flags(ctx, rc, command)`, and stays ignorant of what a
feature injected.
`advertised_results_url` / `bes_results_url_flag` move to
`bazel/build_events.axl` and take the registered `(backend, viewer)` pairs
rather than a `DeploymentFlags` record, so the BES layer no longer depends on
the deployment module. Their tests move with them.
The unused `BazelTrait.flags` / `.startup_flags` transforms are dropped;
`extra_flags` / `base_flags` cover both directions.
`--remote` and `--deployment` keep their names via an explicit `long =` (a
feature arg is otherwise exposed as `--<feature>:<arg>`), and now reach every
bazel-driving task rather than just build/test.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Tasks no longer know about deployments.
BazelTraitgrows the seams a feature needs to wire a build:base_flags default flags prepended BEFORE the user's --bazel-flag,
so a user override still wins (extra_flags appends after
and therefore beats them)
bes_backends extra CLI-streamed BES backend URIs
bes_results_sources (backend, viewer) pairs the build-result link is drawn
from, matched against what the build actually reports to
rc_flags hooks called with (ctx, resolved rc, command) after the
.bazelrc is parsed, for flags that depend on the FINAL rc
A new
Deploymentfeature resolves--remote/--deploymentand fills those in, including the--remote_header/--bes_headerauth hook thatbazel/flags.axlused to own. A bazel-driving task now applies one generic call,bazel.rc_flags(ctx, rc, command), and stays ignorant of what a feature injected.advertised_results_url/bes_results_url_flagmove tobazel/build_events.axland take the registered(backend, viewer)pairs rather than aDeploymentFlagsrecord, so the BES layer no longer depends on the deployment module. Their tests move with them.The unused
BazelTrait.flags/.startup_flagstransforms are dropped;extra_flags/base_flagscover both directions.--remoteand--deploymentkeep their names via an explicitlong =(a feature arg is otherwise exposed as--<feature>:<arg>), and now reach every bazel-driving task rather than just build/test.Changes are visible to end-users: no
Test plan