Skip to content

Do not crash on URIs without a host component.#16184

Closed
tjgq wants to merge 1 commit intobazelbuild:masterfrom
tjgq:unix
Closed

Do not crash on URIs without a host component.#16184
tjgq wants to merge 1 commit intobazelbuild:masterfrom
tjgq:unix

Conversation

@tjgq
Copy link
Copy Markdown
Contributor

@tjgq tjgq commented Aug 29, 2022

URIs such as unix://... (Unix domain socket) may legitimately be missing a
host component. We should gracefully handle them when looking for a credential
helper (no such helper can exist for them since the lookup is host-based, but
this could change in the future).

Fixes #16171 which is a regression in 5.3. We had some tests for this in
remote_execution_test.sh, but they were disabled due to flakiness in 8e3c0df.
I've filed #16185 to reenable them.

Copy link
Copy Markdown
Contributor

@Yannic Yannic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A regression test in CredentialHelperProviderTest would be nice :)


String host = Preconditions.checkNotNull(uri.getHost());
String host = uri.getHost();
if (host == null) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe use Guava's Strings.isNullOrEmpty() here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@tjgq tjgq marked this pull request as ready for review August 29, 2022 13:27
URIs such as `unix://...` (Unix domain socket) may legitimately be missing a
host component. We should gracefully handle them when looking for a credential
helper (no such helper can exist for them since the lookup is host-based, but
this could change in the future).

Fixes bazelbuild#16171 which is a regression in 5.3. We had some tests for this in
remote_execution_test.sh, but they were disabled due to flakiness in 8e3c0df.
I've filed bazelbuild#16185 to reenable them.
@tjgq
Copy link
Copy Markdown
Contributor Author

tjgq commented Aug 29, 2022

A regression test in CredentialHelperProviderTest would be nice :)

Done.

@sgowroji sgowroji added team-Remote-Exec Issues and PRs for the Execution (Remote) team awaiting-review PR is awaiting review from an assigned reviewer labels Aug 29, 2022
@ShreeM01
Copy link
Copy Markdown
Contributor

@bazel-io fork 5.3.1

ShreeM01 added a commit that referenced this pull request Aug 31, 2022
URIs such as `unix://...` (Unix domain socket) may legitimately be missing a
host component. We should gracefully handle them when looking for a credential
helper (no such helper can exist for them since the lookup is host-based, but
this could change in the future).

Fixes #16171 which is a regression in 5.3. We had some tests for this in
remote_execution_test.sh, but they were disabled due to flakiness in 8e3c0df.
I've filed #16185 to reenable them.

Closes #16184.

PiperOrigin-RevId: 470724658
Change-Id: Ibd7203546f00fe2335c14e7a5fa6d5bf64868bac

Co-authored-by: Tiago Quelhas <[email protected]>
@ShreeM01 ShreeM01 removed the awaiting-review PR is awaiting review from an assigned reviewer label Sep 15, 2022
aiuto pushed a commit to aiuto/bazel that referenced this pull request Oct 12, 2022
URIs such as `unix://...` (Unix domain socket) may legitimately be missing a
host component. We should gracefully handle them when looking for a credential
helper (no such helper can exist for them since the lookup is host-based, but
this could change in the future).

Fixes bazelbuild#16171 which is a regression in 5.3. We had some tests for this in
remote_execution_test.sh, but they were disabled due to flakiness in 8e3c0df.
I've filed bazelbuild#16185 to reenable them.

Closes bazelbuild#16184.

PiperOrigin-RevId: 470724658
Change-Id: Ibd7203546f00fe2335c14e7a5fa6d5bf64868bac
@tjgq tjgq deleted the unix branch December 8, 2022 18:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

team-Remote-Exec Issues and PRs for the Execution (Remote) team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CredentialHelper change broke unix domain socket support

4 participants