Propagate requires-network execution requirement to REAPI Platform properties #339
All Vouch review confidence checks passed
Residual risk 0.29 = Change Risk (0.45) × (1 − Review Confidence (0.36)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.45 · 418 lines diff across 5 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 34% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.361
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #339"
general
weight: 0.35
dzbarsky
Description
Add an opt-in flag
--experimental_remote_propagate_requires_network(defaultfalse) that propagates therequires-networkexecution requirement fromspawn.getExecutionInfo()to REAPIPlatform.propertiesasrequires-network="":RemoteOptions.java: Adds--experimental_remote_propagate_requires_network(defaultValue = "false",OptionDocumentationCategory.REMOTE,effectTags = {AFFECTS_OUTPUTS, EXECUTION},metadataTags = {EXPERIMENTAL}).PlatformUtils.java: InPlatformUtils.getPlatformProto(), whenremoteOptions != null && remoteOptions.getRemotePropagateRequiresNetwork()andSpawns.requiresNetwork(spawn, / defaultSandboxDisallowNetwork= / false)is true, addsExecutionRequirements.REQUIRES_NETWORK -> ""viaputIfAbsent(...)before mergingadditionalProperties.- Respects
block-networkoverridingrequires-networkviaSpawns.requiresNetwork().- Does not overwrite an explicit
requires-networkproperty set via target/platformexec_propertiesor--remote_default_exec_properties.- Preserves
additionalPropertiessuch aspersistentWorkerKey/persistentWorkerProtocol.- Covers both
RemoteExecutionService.buildRemoteAction()(Action.platformandCommand.platform, separating Action Cache keys for networked vs. offline actions) andSpawnLogContext.getPlatform().PlatformUtilsTest.java&RemoteExecutionServiceTest.java: Add unit tests covering default-off behavior, propagation onrequires-network, omission when unset,block-networkprecedence, non-clobbering of explicitexec_properties, Action Cache key separation, and compatibility with persistent worker properties.Motivation
With
--nosandbox_default_allow_network, local sandboxes checkSpawns.requiresNetwork(), which inspectsspawn.getExecutionInfo()(populated fromtags = ["requires-network"]andctx.actions.run(execution_requirements = ...)). Over Remote Execution,PlatformUtils.getPlatformProto()previously only inspectedexec_propertiesand--remote_default_exec_properties, completely ignoringspawn.getExecutionInfo(). As a result, remote execution backends (such as Buildbarn) could not block outbound network by default while honoringtags = ["requires-network"]without duplicating it intoexec_propertiesacross every rule and macro.Gating this behind
--experimental_remote_propagate_requires_network(defaultfalse) avoids breaking exact-match RBE schedulers whose workers do not yet advertiserequires-network, and avoids unexpected Action Cache key invalidations when sharing caches with stock Bazel.Testing
Ran both full test suites:
bazel test //src/test/java/com/google/devtools/build/lib/analysis/platform:PlatformAnalysisTests(PASSED)bazel test //src/test/java/com/google/devtools/build/lib/remote:RemoteTests(PASSED)Build API Changes
Adds experimental flag
--experimental_remote_propagate_requires_network.Checklist
Release Notes
RELNOTES: Added
--experimental_remote_propagate_requires_networkto propagate therequires-networkexecution requirement (tags = ["requires-network"]/execution_requirements) to REAPIPlatform.properties.