← Back to Pull requests

Propagate requires-network execution requirement to REAPI Platform properties #339

Closed
unknown closed this pull request without merging on Dec 03, 2026 01:54 UTC
View on GitHub
unknown unknown commented on Dec 03, 2026 01:50 UTC
Author

Description

Add an opt-in flag --experimental_remote_propagate_requires_network (default false) that propagates the requires-network execution requirement from spawn.getExecutionInfo() to REAPI Platform.properties as requires-network="":

  • RemoteOptions.java: Adds --experimental_remote_propagate_requires_network (defaultValue = "false", OptionDocumentationCategory.REMOTE, effectTags = {AFFECTS_OUTPUTS, EXECUTION}, metadataTags = {EXPERIMENTAL}).

  • PlatformUtils.java: In PlatformUtils.getPlatformProto(), when remoteOptions != null && remoteOptions.getRemotePropagateRequiresNetwork() and Spawns.requiresNetwork(spawn, / defaultSandboxDisallowNetwork= / false) is true, adds ExecutionRequirements.REQUIRES_NETWORK -> "" via putIfAbsent(...) before merging additionalProperties.

  • - Respects block-network overriding requires-network via Spawns.requiresNetwork().
    - Does not overwrite an explicit requires-network property set via target/platform exec_properties or --remote_default_exec_properties.
    - Preserves additionalProperties such as persistentWorkerKey / persistentWorkerProtocol.
    - Covers both RemoteExecutionService.buildRemoteAction() (Action.platform and Command.platform, separating Action Cache keys for networked vs. offline actions) and SpawnLogContext.getPlatform().
  • PlatformUtilsTest.java & RemoteExecutionServiceTest.java: Add unit tests covering default-off behavior, propagation on requires-network, omission when unset, block-network precedence, non-clobbering of explicit exec_properties, Action Cache key separation, and compatibility with persistent worker properties.
  • Motivation

    With --nosandbox_default_allow_network, local sandboxes check Spawns.requiresNetwork(), which inspects spawn.getExecutionInfo() (populated from tags = ["requires-network"] and ctx.actions.run(execution_requirements = ...)). Over Remote Execution, PlatformUtils.getPlatformProto() previously only inspected exec_properties and --remote_default_exec_properties, completely ignoring spawn.getExecutionInfo(). As a result, remote execution backends (such as Buildbarn) could not block outbound network by default while honoring tags = ["requires-network"] without duplicating it into exec_properties across every rule and macro.

    Gating this behind --experimental_remote_propagate_requires_network (default false) avoids breaking exact-match RBE schedulers whose workers do not yet advertise requires-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

  • I have added tests for the new use cases (if any).

  • I have updated the documentation (if applicable).
  • Release Notes

    RELNOTES: Added --experimental_remote_propagate_requires_network to propagate the requires-network execution requirement (tags = ["requires-network"] / execution_requirements) to REAPI Platform.properties.

    Diff: 418 lines (+313 / -105) across 5 files Reviewer: dzbarsky Review duration: 3m
    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
    0.45
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 34% · Reviewer familiarity: 35%
    35%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    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
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 35.8% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 45.0% (MEDIUM) · Higher = larger blast radius
    45.0%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 35.8% · Lower = rushed or shallow review
    35.8%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 28.9% · Safe to merge
    28.9%
    Repository