Skip to content

[27.x backport] vendor.mod: put github.com/pkg/browser in the right group - #5408

Merged
thaJeztah merged 1 commit into
docker:27.xfrom
thaJeztah:27.x_backport_mod_tidy
Sep 5, 2024
Merged

[27.x backport] vendor.mod: put github.com/pkg/browser in the right group#5408
thaJeztah merged 1 commit into
docker:27.xfrom
thaJeztah:27.x_backport_mod_tidy

Conversation

@thaJeztah

Copy link
Copy Markdown
Member

commit fcfdd7b (#5344) introduced github.com/pkg/browser as a direct dependency, but it ended up in the group for indirect dependencies.

commit fcfdd7b introduced github.com/pkg/browser
as a direct dependency, but it ended up in the group for indirect dependencies.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 1b8180a)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@thaJeztahthaJeztah added status/2-code-review kind/refactor PR's that refactor, or clean-up code labels Sep 5, 2024
@thaJeztahthaJeztah added this to the 27.2.1 milestone Sep 5, 2024
@thaJeztahthaJeztah self-assigned this Sep 5, 2024
@codecov-commenter

codecov-commenter commented Sep 5, 2024

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 59.77%. Comparing base (d0c1a80) to head (869df10).
Report is 3 commits behind head on 27.x.

Additional details and impacted files
@@ Coverage Diff @@## 27.x #5408 +/- ##
=======================================
Coverage 59.77% 59.77% =======================================
Files 345 345 Lines 23405 23405 =======================================
Hits 13990 13990 Misses 8445 8445 Partials 970 970 

@thaJeztah

Copy link
Copy Markdown
MemberAuthor

Flaky test?

=== Failed
=== FAIL: e2e/registry TestOauthLogin (1.00s)
login_test.go:28: terminating PID 10523
login_test.go:33: assertion failed: expression is false: strings.Contains(string(output), "USING WEB-BASED LOGIN"): Failed to start web-based login - falling back to command line login...
Log in with your Docker ID or email address to push and pull images from Docker Hub. If you don't have a Docker ID, head over to https://hub.docker.com/ to create one.
You can log in with your password or a Personal Access Token (PAT). Using a limited-scope PAT grants better security and is required for organizations using SSO. Learn more at https://docs.docker.com/go/access-tokens/
Username: 

@laurazard

laurazard commented Sep 5, 2024

Copy link
Copy Markdown
Member

Flaky due to it failing to reach login.docker.com 😅

Failed to start web-based login - falling back to command line login...

I have a branch somewhere with a refactor/more e2e tests here, so I'll make sure this is more resilient. It's not testing the full login flow, just that the oauth login is triggered by a docker login, so if it fallbacks to regular login that's fine.

@thaJeztah

Copy link
Copy Markdown
MemberAuthor

I just noticed that we're swallowing the error there, which ... probably is fine, but wondering if we need some what to present it 🤔 (although not sure if we want a log.Debug because they're so ugly on the commandline.. maybe?

response, err:=loginWithDeviceCodeFlow(ctx, dockerCli)
// if the error represents a failure to initiate the device-code flow,
// then we fallback to regular cli credentials login
if!errors.Is(err, manager.ErrDeviceLoginStartFail) {
returnresponse, err
}
fmt.Fprint(dockerCli.Err(), "Failed to start web-based login - falling back to command line login...\n\n")

I wish the CLI had a location to log to (without that meaning "print and show the user")

@thaJeztah
thaJeztah merged commit 667d9fd into docker:27.xSep 5, 2024
@thaJeztah
thaJeztah deleted the 27.x_backport_mod_tidy branch September 5, 2024 12:53
@laurazard

Copy link
Copy Markdown
Member

Yeah, we could do something like a log.Debug.

@thaJeztah

Copy link
Copy Markdown
MemberAuthor

It's a tricky one, due to the nature of the cli being short-lived; we'll be potentially opening a can of worms to handle concurrency, log-rotation, and multiple instances of the cli probably needing something to associate logs with each invocation.

Well, or have a new file created at all times, but we'd still need something to clean it up. Sending to a logging service would be ideal, but not available in all cases.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/refactorPR's that refactor, or clean-up codestatus/2-code-review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@thaJeztah@codecov-commenter@laurazard