Skip to content

Commit 351188d

Browse files
iancha1992tjgq
andauthored
Declare credential helpers to be a stable feature. (#18752)
Closes #18615. PiperOrigin-RevId: 539607278 Change-Id: I250250452db923ba132f1445c46b0112b175e505 Co-authored-by: Tiago Quelhas <[email protected]>
1 parent b752c2f commit 351188d

File tree

4 files changed

+21
-18
lines changed

4 files changed

+21
-18
lines changed

src/main/java/com/google/devtools/build/lib/authandtls/AuthAndTLSOptions.java

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,8 @@ public class AuthAndTLSOptions extends OptionsBase {
141141
public Duration grpcKeepaliveTimeout;
142142

143143
@Option(
144-
name = "experimental_credential_helper",
144+
name = "credential_helper",
145+
oldName = "experimental_credential_helper",
145146
defaultValue = "null",
146147
allowMultiple = true,
147148
converter = UnresolvedScopedCredentialHelperConverter.class,
@@ -160,7 +161,8 @@ public class AuthAndTLSOptions extends OptionsBase {
160161
public List<UnresolvedScopedCredentialHelper> credentialHelpers;
161162

162163
@Option(
163-
name = "experimental_credential_helper_timeout",
164+
name = "credential_helper_timeout",
165+
oldName = "experimental_credential_helper_timeout",
164166
defaultValue = "10s",
165167
converter = DurationConverter.class,
166168
documentationCategory = OptionDocumentationCategory.UNCATEGORIZED,
@@ -172,7 +174,8 @@ public class AuthAndTLSOptions extends OptionsBase {
172174
public Duration credentialHelperTimeout;
173175

174176
@Option(
175-
name = "experimental_credential_helper_cache_duration",
177+
name = "credential_helper_cache_duration",
178+
oldName = "experimental_credential_helper_cache_duration",
176179
defaultValue = "30m",
177180
converter = DurationConverter.class,
178181
documentationCategory = OptionDocumentationCategory.UNCATEGORIZED,
@@ -184,7 +187,7 @@ public class AuthAndTLSOptions extends OptionsBase {
184187
+ " of this flag.")
185188
public Duration credentialHelperCacheTimeout;
186189

187-
/** One of the values of the `--experimental_credential_helper` flag. */
190+
/** One of the values of the `--credential_helper` flag. */
188191
@AutoValue
189192
public abstract static class UnresolvedScopedCredentialHelper {
190193
/** Returns the scope of the credential helper (if any). */
@@ -194,7 +197,7 @@ public abstract static class UnresolvedScopedCredentialHelper {
194197
public abstract String getPath();
195198
}
196199

197-
/** A {@link Converter} for the `--experimental_credential_helper` flag. */
200+
/** A {@link Converter} for the `--credential_helper` flag. */
198201
public static final class UnresolvedScopedCredentialHelperConverter
199202
extends Converter.Contextless<UnresolvedScopedCredentialHelper> {
200203
public static final UnresolvedScopedCredentialHelperConverter INSTANCE =

src/test/py/bazel/bzlmod/bzlmod_credentials_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ def testCredentialsFromHelper(self):
125125
) as static_server:
126126
_, stdout, _ = self.RunBazel([
127127
'run',
128-
'--experimental_credential_helper=%workspace%/credhelper',
128+
'--credential_helper=%workspace%/credhelper',
129129
'--registry=' + static_server.getURL(),
130130
'--registry=https://bcr.bazel.build',
131131
'//:main',
@@ -156,7 +156,7 @@ def testCredentialsFromHelperOverrideNetrc(self):
156156
_, stdout, _ = self.RunBazel(
157157
[
158158
'run',
159-
'--experimental_credential_helper=%workspace%/credhelper',
159+
'--credential_helper=%workspace%/credhelper',
160160
'--registry=' + static_server.getURL(),
161161
'--registry=https://bcr.bazel.build',
162162
'//:main',

src/test/shell/bazel/remote/remote_execution_test.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -108,15 +108,15 @@ function test_credential_helper_remote_cache() {
108108

109109
bazel build \
110110
--remote_cache=grpc://localhost:${worker_port} \
111-
--experimental_credential_helper="${TEST_TMPDIR}/credhelper" \
111+
--credential_helper="${TEST_TMPDIR}/credhelper" \
112112
//a:a >& $TEST_log || fail "Build with credentials should have succeeded"
113113

114114
# First build should have called helper for 4 distinct URIs.
115115
expect_credential_helper_calls 4
116116

117117
bazel build \
118118
--remote_cache=grpc://localhost:${worker_port} \
119-
--experimental_credential_helper="${TEST_TMPDIR}/credhelper" \
119+
--credential_helper="${TEST_TMPDIR}/credhelper" \
120120
//a:b >& $TEST_log || fail "Build with credentials should have succeeded"
121121

122122
# Second build should have hit the credentials cache.
@@ -138,7 +138,7 @@ function test_credential_helper_remote_execution() {
138138
bazel build \
139139
--spawn_strategy=remote \
140140
--remote_executor=grpc://localhost:${worker_port} \
141-
--experimental_credential_helper="${TEST_TMPDIR}/credhelper" \
141+
--credential_helper="${TEST_TMPDIR}/credhelper" \
142142
//a:a >& $TEST_log || fail "Build with credentials should have succeeded"
143143

144144
# First build should have called helper for 5 distinct URIs.
@@ -147,7 +147,7 @@ function test_credential_helper_remote_execution() {
147147
bazel build \
148148
--spawn_strategy=remote \
149149
--remote_executor=grpc://localhost:${worker_port} \
150-
--experimental_credential_helper="${TEST_TMPDIR}/credhelper" \
150+
--credential_helper="${TEST_TMPDIR}/credhelper" \
151151
//a:b >& $TEST_log || fail "Build with credentials should have succeeded"
152152

153153
# Second build should have hit the credentials cache.
@@ -160,7 +160,7 @@ function test_credential_helper_clear_cache() {
160160
bazel build \
161161
--spawn_strategy=remote \
162162
--remote_executor=grpc://localhost:${worker_port} \
163-
--experimental_credential_helper="${TEST_TMPDIR}/credhelper" \
163+
--credential_helper="${TEST_TMPDIR}/credhelper" \
164164
//a:a >& $TEST_log || fail "Build with credentials should have succeeded"
165165

166166
expect_credential_helper_calls 5
@@ -170,7 +170,7 @@ function test_credential_helper_clear_cache() {
170170
bazel build \
171171
--spawn_strategy=remote \
172172
--remote_executor=grpc://localhost:${worker_port} \
173-
--experimental_credential_helper="${TEST_TMPDIR}/credhelper" \
173+
--credential_helper="${TEST_TMPDIR}/credhelper" \
174174
//a:b >& $TEST_log || fail "Build with credentials should have succeeded"
175175

176176
# Build after clean should have called helper again.

src/test/shell/bazel/starlark_repository_test.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1801,12 +1801,12 @@ function test_auth_from_credential_helper() {
18011801
bazel build //:it \
18021802
&& fail "Expected failure when downloading repo without credential helper"
18031803

1804-
bazel build --experimental_credential_helper="${TEST_TMPDIR}/credhelper" //:it \
1804+
bazel build --credential_helper="${TEST_TMPDIR}/credhelper" //:it \
18051805
|| fail "Expected success when downloading repo with credential helper"
18061806

18071807
expect_credential_helper_calls 1
18081808

1809-
bazel build --experimental_credential_helper="${TEST_TMPDIR}/credhelper" //:it \
1809+
bazel build --credential_helper="${TEST_TMPDIR}/credhelper" //:it \
18101810
|| fail "Expected success when downloading repo with credential helper"
18111811

18121812
expect_credential_helper_calls 1 # expect credentials to have been cached
@@ -1822,7 +1822,7 @@ function test_auth_from_credential_helper_overrides_starlark() {
18221822

18231823
setup_auth baduser badpass
18241824

1825-
bazel build --experimental_credential_helper="${TEST_TMPDIR}/credhelper" //:it \
1825+
bazel build --credential_helper="${TEST_TMPDIR}/credhelper" //:it \
18261826
|| fail "Expected success when downloading repo with credential helper overriding basic auth"
18271827
}
18281828

@@ -2217,7 +2217,7 @@ genrule(
22172217
cmd = "cp $< $@",
22182218
)
22192219
EOF
2220-
bazel build --experimental_credential_helper="${TEST_TMPDIR}/credhelper" //:it \
2220+
bazel build --credential_helper="${TEST_TMPDIR}/credhelper" //:it \
22212221
|| fail "Expected success despite needing a file behind credential helper"
22222222
}
22232223

@@ -2264,7 +2264,7 @@ genrule(
22642264
cmd = "cp $< $@",
22652265
)
22662266
EOF
2267-
bazel build --experimental_credential_helper="${TEST_TMPDIR}/credhelper" //:it \
2267+
bazel build --credential_helper="${TEST_TMPDIR}/credhelper" //:it \
22682268
|| fail "Expected success despite needing a file behind credential helper"
22692269
}
22702270

0 commit comments

Comments
 (0)