Skip to content

Commit 54a3715

Browse files
committed
Merge branch 'main' into e2e-port
2 parents f621b7c + 064a08e commit 54a3715

33 files changed

+491
-590
lines changed

.github/workflows/ci.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -666,7 +666,7 @@ jobs:
666666
# to main branch. We are only building this for amd64 platform. (>95% pulls
667667
# are for amd64)
668668
needs: changes
669-
if: needs.changes.outputs.docs-only == 'false' && !github.event.pull_request.head.repo.fork
669+
if: github.ref == 'refs/heads/main' && needs.changes.outputs.docs-only == 'false' && !github.event.pull_request.head.repo.fork
670670
runs-on: ${{ github.repository_owner == 'coder' && 'buildjet-8vcpu-ubuntu-2204' || 'ubuntu-latest' }}
671671
env:
672672
DOCKER_CLI_EXPERIMENTAL: "enabled"

.github/workflows/contrib.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
steps:
3535
- name: cla
3636
if: (github.event.comment.body == 'recheck' || github.event.comment.body == 'I have read the CLA Document and I hereby sign the CLA') || github.event_name == 'pull_request_target'
37-
uses: contributor-assistant/github-action@v2.3.1
37+
uses: contributor-assistant/github-action@v2.3.2
3838
env:
3939
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4040
# the below token should have repo scope and must be manually added by you in the repository's secret

cli/login.go

+1-12
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ import (
1818

1919
"github.com/coder/pretty"
2020

21-
"github.com/coder/coder/v2/buildinfo"
2221
"github.com/coder/coder/v2/cli/cliui"
2322
"github.com/coder/coder/v2/coderd/userpassword"
2423
"github.com/coder/coder/v2/codersdk"
@@ -180,21 +179,11 @@ func (r *RootCmd) login() *serpent.Command {
180179
serverURL.Scheme = "https"
181180
}
182181

183-
client, err := r.createUnauthenticatedClient(ctx, serverURL)
182+
client, err := r.createUnauthenticatedClient(ctx, serverURL, inv)
184183
if err != nil {
185184
return err
186185
}
187186

188-
// Try to check the version of the server prior to logging in.
189-
// It may be useful to warn the user if they are trying to login
190-
// on a very old client.
191-
err = r.checkVersions(inv, client, buildinfo.Version())
192-
if err != nil {
193-
// Checking versions isn't a fatal error so we print a warning
194-
// and proceed.
195-
_, _ = fmt.Fprintln(inv.Stderr, pretty.Sprint(cliui.DefaultStyles.Warn, err.Error()))
196-
}
197-
198187
hasFirstUser, err := client.HasFirstUser(ctx)
199188
if err != nil {
200189
return xerrors.Errorf("Failed to check server %q for first user, is the URL correct and is coder accessible from your browser? Error - has initial user: %w", serverURL.String(), err)

cli/logout_test.go

-27
Original file line numberDiff line numberDiff line change
@@ -97,33 +97,6 @@ func TestLogout(t *testing.T) {
9797

9898
<-logoutChan
9999
})
100-
t.Run("NoSessionFile", func(t *testing.T) {
101-
t.Parallel()
102-
103-
pty := ptytest.New(t)
104-
config := login(t, pty)
105-
106-
// Ensure session files exist.
107-
require.FileExists(t, string(config.URL()))
108-
require.FileExists(t, string(config.Session()))
109-
110-
err := os.Remove(string(config.Session()))
111-
require.NoError(t, err)
112-
113-
logoutChan := make(chan struct{})
114-
logout, _ := clitest.New(t, "logout", "--global-config", string(config))
115-
116-
logout.Stdin = pty.Input()
117-
logout.Stdout = pty.Output()
118-
119-
go func() {
120-
defer close(logoutChan)
121-
err = logout.Run()
122-
assert.ErrorContains(t, err, "You are not logged in. Try logging in using 'coder login'.")
123-
}()
124-
125-
<-logoutChan
126-
})
127100
t.Run("CannotDeleteFiles", func(t *testing.T) {
128101
t.Parallel()
129102

0 commit comments

Comments
 (0)