-
Notifications
You must be signed in to change notification settings - Fork 936
fix: parse username/workspace correctly on coder state pull --build #10973
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Current dependencies on/for this PR:
This stack of pull requests is managed by Graphite. |
5eff582
to
32d6651
Compare
if err != nil { | ||
return err | ||
} | ||
build, err = client.WorkspaceBuildByUsernameAndWorkspaceNameAndBuildNumber(inv.Context(), owner, workspace, strconv.FormatInt(buildNumber, 10)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Non-blocking:
I wonder if it would make sense to introduce something like
type WorkspaceName string
type WorkspaceOwner string
and make splitNamedWorkspace
return those types?
r := dbfake.WorkspaceBuild(t, store, database.Workspace{ | ||
OrganizationID: owner.OrganizationID, | ||
OwnerID: taUser.ID, | ||
}). | ||
Seed(database.WorkspaceBuild{ProvisionerState: wantState}). | ||
Do() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
var gotState bytes.Buffer | ||
inv.Stdout = &gotState | ||
clitest.SetupConfig(t, templateAdmin, root) | ||
err := inv.Run() | ||
require.NoError(t, err) | ||
require.Equal(t, wantState, bytes.TrimSpace(gotState.Bytes())) | ||
}) | ||
t.Run("OtherUserBuild", func(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 👍
fixes #10884