-
Notifications
You must be signed in to change notification settings - Fork 1.1k
feat(agent): add CLI commands to enable coder script interdependency #20719
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
feat(agent): add CLI commands to enable coder script interdependency #20719
Conversation
831a36b to
c300efb
Compare
51c9d3b to
ce2bf8a
Compare
c300efb to
234bb48
Compare
ce2bf8a to
d994626
Compare
234bb48 to
72a8f70
Compare
d994626 to
c344440
Compare
Co-authored-by: Mathias Fredriksson <mafredri@gmail.com>
Co-authored-by: Mathias Fredriksson <mafredri@gmail.com>
Co-authored-by: Mathias Fredriksson <mafredri@gmail.com>
Co-authored-by: Mathias Fredriksson <mafredri@gmail.com>
Co-authored-by: Mathias Fredriksson <mafredri@gmail.com>
Co-authored-by: Mathias Fredriksson <mafredri@gmail.com>
mafredri
left a comment
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.
Basically approved but some final touches would be nice. Also one request for follow-up PR (re client and server unix/windows split).
mafredri
left a comment
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.
One simplification, but ignore Q about path, I found the answer.
| header := fmt.Sprintf("Unit: %s\nStatus: %s\nReady: %t\n\nDependencies:\n", unit, statusResp.Status, statusResp.IsReady) | ||
| if formatter.FormatID() == "table" && len(statusResp.Dependencies) == 0 { | ||
| out = header + "No dependencies found" | ||
| } else { | ||
| out, err = formatter.Format(ctx, statusResp) | ||
| if err != nil { | ||
| return xerrors.Errorf("format status: %w", err) | ||
| } | ||
|
|
||
| if formatter.FormatID() == "table" { | ||
| out = header + out | ||
| } | ||
| } |
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.
| header := fmt.Sprintf("Unit: %s\nStatus: %s\nReady: %t\n\nDependencies:\n", unit, statusResp.Status, statusResp.IsReady) | |
| if formatter.FormatID() == "table" && len(statusResp.Dependencies) == 0 { | |
| out = header + "No dependencies found" | |
| } else { | |
| out, err = formatter.Format(ctx, statusResp) | |
| if err != nil { | |
| return xerrors.Errorf("format status: %w", err) | |
| } | |
| if formatter.FormatID() == "table" { | |
| out = header + out | |
| } | |
| } | |
| out, err = formatter.Format(ctx, statusResp) | |
| if err != nil { | |
| return xerrors.Errorf("format status: %w", err) | |
| } | |
| if formatter.FormatID() == "table" { | |
| if len(statusResp.Dependencies) == 0 { | |
| out = "No dependencies found" | |
| } | |
| out = fmt.Sprintf("Unit: %s\nStatus: %s\nReady: %t\n\nDependencies:\n%s", unit, statusResp.Status, statusResp.IsReady, out) | |
| } |
This seemed a bit complicated, with checking ID multiple times.
359b11c
into
jjs/internal-1095-branch4-sdk-client


relates to: coder/internal#1094
This is number 5 of 5 pull requests in an effort to add agent script ordering. It adds CLI commands that allow coder scripts to manage dependencies between one another at runtime.
I used an LLM to produce some of these changes, but I have conducted thorough self review and consider this contribution to be ready for an external reviewer.