Skip to content

tls: Allow TLS flags to be reset#29312

Open
alloveras wants to merge 1 commit intobazelbuild:masterfrom
alloveras:alloveras-tls-flags-reset
Open

tls: Allow TLS flags to be reset#29312
alloveras wants to merge 1 commit intobazelbuild:masterfrom
alloveras:alloveras-tls-flags-reset

Conversation

@alloveras
Copy link
Copy Markdown
Contributor

@alloveras alloveras commented Apr 16, 2026

Description

Add a NullableStringConverter to the options framework that maps an empty string to null and wire it to the TLS flags --tls_certificate, --tls_client_certificate, and --tls_client_key so that passing --<flag-name>= on the command line resets the flag to its unset state.

Motivation

Flags with defaultValue = "null" are correctly null at startup, but there was no way to reset them back to unset from the command line (e.g. to override a .bazelrc setting). Passing --tls_certificate= leaves the value as an empty string, which is then passed to new File(""), causing a confusing error.

Build API Changes

This PR affects the following command-line flags:

  • --tls_certificate
  • --tls_client_certificate
  • --tls_client_key
  1. Has this been discussed in a design doc or issue? bazelbuild/bazel#4595

  2. Is the change backward compatible? Any previously valid non-empty value continues to work exactly as before. Any empty string now correctly resets the flag to its default value as opposed to propagating the empty string value downstream, which, in some cases, turns out to be catastrophic.

  3. If it's a breaking change, what is the migration plan? N/A.

Checklist

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

Release Notes

RELNOTES: --tls_certificate=, --tls_client_certificate=, and --tls_client_key= can now be used to reset those flags to their unset state.

@github-actions github-actions bot added the awaiting-review PR is awaiting review from an assigned reviewer label Apr 16, 2026
@alloveras alloveras force-pushed the alloveras-tls-flags-reset branch from 7b31180 to 3d389c1 Compare April 16, 2026 02:52
@alloveras
Copy link
Copy Markdown
Contributor Author

alloveras commented Apr 16, 2026

The failed test seems to be a flake or somehow unrelated breakage to this change 🤔 ? I don't seem to have enough permissions to retry the failed step, so I am unsure how to proceed. I would appreciate some guidance 😉

@iancha1992 iancha1992 added the team-Remote-Exec Issues and PRs for the Execution (Remote) team label Apr 16, 2026
@meisterT meisterT requested a review from tjgq April 17, 2026 08:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting-review PR is awaiting review from an assigned reviewer team-Remote-Exec Issues and PRs for the Execution (Remote) team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants