Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat(cli): implement exp task status command#19533

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
johnstcn merged 11 commits intomainfromcj/exp-cli-status
Aug 26, 2025
Merged

Conversation

johnstcn
Copy link
Member

@johnstcnjohnstcn commentedAug 25, 2025
edited
Loading

Closescoder/internal#900

  • Implementscoder exp task status
  • Addstestutil.MustURL helper

No robots were harmed in the making of this PR.

- Implements `coder exp task status`- Adds `testutil.MustURL` helper
args []string
expectOutput string
expectError string
hf func(context.Context) func(http.ResponseWriter, *http.Request)
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

review: I elected to mock the API response instead of standing up a wholecoderdtest. We have too many of these as it is.

DanielleMaywood reacted with thumbs up emoji
"testing"
)

func MustURL(t testing.TB, raw string) *url.URL {
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

review: I figured this might be useful.

State: codersdk.TaskStateWorking,
},
})
c.Add(1)
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

I'm just sad I couldn't writec++ here 😢

Copy link
Contributor

@DanielleMaywoodDanielleMaywood left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@mafredrimafredri left a comment

Choose a reason for hiding this comment

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

I think it'd be nice to have a/status endpoint in coderd that allows follow without polling, but I'm fine with the current implementation for now. Some comments/suggestions inline.


// TODO: right now tasks are still "workspaces" under the hood.
// We should update this once we have a proper task model.
ws, err := namedWorkspace(ctx, client, id)
Copy link
Member

Choose a reason for hiding this comment

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

Is this lookup necessary, is it mainly to support e.g. workspace name rather than plain uuid lookups?

We should perhaps consider supporting name lookup in the get task endpoint.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Yeah this is basically for convenience due to the current task <-> workspace relationship

mafredri reacted with thumbs up emoji

var (
ctx = testutil.Context(t, testutil.WaitShort)
now = time.Now().UTC() // TODO: replace with quartz
Copy link
MemberAuthor

@johnstcnjohnstcnAug 26, 2025
edited
Loading

Choose a reason for hiding this comment

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

review: this is unfortunately flake-prone unless we just test the JSON output which omits the relative time.

Copy link
Member

@mafredrimafredri left a comment

Choose a reason for hiding this comment

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

I think switching to the table approach was a good call, nice. A few suggestions pertaining to JSON output but otherwise LGTM.

Handler: func(i *serpent.Invocation) error {
ctx := i.Context()
ec := codersdk.NewExperimentalClient(client)
id := i.Args[0]
Copy link
Member

Choose a reason for hiding this comment

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

Just realized this could support multiple args (tasks) as well, and watching each. But let's leave that for future.

johnstcn reacted with thumbs up emoji
@johnstcnjohnstcn merged commit5baaf27 intomainAug 26, 2025
26 checks passed
@johnstcnjohnstcn deleted the cj/exp-cli-status branchAugust 26, 2025 15:01
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsAug 26, 2025
@johnstcnjohnstcn added the cherry-pick/v2.26Needs to be cherry-picked to the 2.26 release branch labelAug 29, 2025
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@mafredrimafredrimafredri approved these changes

@DanielleMaywoodDanielleMaywoodDanielleMaywood approved these changes

Assignees

@johnstcnjohnstcn

Labels
cherry-pick/v2.26Needs to be cherry-picked to the 2.26 release branch
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Tasks CLI: Addstatus command
3 participants
@johnstcn@mafredri@DanielleMaywood

[8]ページ先頭

©2009-2025 Movatter.jp