Skip to content

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

Merged
merged 1 commit into from
Dec 1, 2023

Conversation

spikecurtis
Copy link
Contributor

fixes #10884

Copy link
Contributor Author

spikecurtis commented Dec 1, 2023

@spikecurtis spikecurtis force-pushed the spike/10884-state-pull branch from 5eff582 to 32d6651 Compare December 1, 2023 08:02
if err != nil {
return err
}
build, err = client.WorkspaceBuildByUsernameAndWorkspaceNameAndBuildNumber(inv.Context(), owner, workspace, strconv.FormatInt(buildNumber, 10))
Copy link
Member

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?

Comment on lines +31 to +36
r := dbfake.WorkspaceBuild(t, store, database.Workspace{
OrganizationID: owner.OrganizationID,
OwnerID: taUser.ID,
}).
Seed(database.WorkspaceBuild{ProvisionerState: wantState}).
Do()
Copy link
Member

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) {
Copy link
Member

Choose a reason for hiding this comment

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

👍 👍

@spikecurtis spikecurtis merged commit b267497 into main Dec 1, 2023
@spikecurtis spikecurtis deleted the spike/10884-state-pull branch December 1, 2023 09:03
@github-actions github-actions bot locked and limited conversation to collaborators Dec 1, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

coder state pull --build <num> errors with "Route not found'
2 participants