- Notifications
You must be signed in to change notification settings - Fork928
feat(agent/agentcontainers): support displayApps from devcontainer config#18342
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
Uh oh!
There was an error while loading.Please reload this page.
Changes from1 commit
3b44a89
e12ccc7
4b6209e
aa77e9e
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
- Loading branch information
Uh oh!
There was an error while loading.Please reload this page.
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -19,15 +19,15 @@ import ( | ||
// Unfortunately we cannot make use of `dcspec` as the output doesn't appear to | ||
// match. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. This is unfortunate. Any particular thing it choked on? Btw, I notice there's no "merged" configuration. I suppose we won't get customizations added by features etc here? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. They aren't 1:1 on schema.
If I run There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. I don't see that | ||
type DevcontainerConfig struct { | ||
MergedConfiguration DevcontainerConfiguration `json:"mergedConfiguration"` | ||
} | ||
type DevcontainerConfiguration struct { | ||
Customizations DevcontainerCustomizations `json:"customizations,omitempty"` | ||
} | ||
type DevcontainerCustomizations struct { | ||
Coder *CoderCustomization `json:"coder,omitempty"` | ||
} | ||
type CoderCustomization struct { | ||
@@ -196,23 +196,17 @@ func (d *devcontainerCLI) Up(ctx context.Context, workspaceFolder, configPath st | ||
cmd.Stderr = io.MultiWriter(stderrWriters...) | ||
if err := cmd.Run(); err != nil { | ||
_, err2 := parseDevcontainerCLILastLine[devcontainerCLIResult](ctx, logger, stdoutBuf.Bytes()) | ||
if err2 != nil { | ||
err = errors.Join(err, err2) | ||
} | ||
return "", err | ||
} | ||
result, err := parseDevcontainerCLILastLine[devcontainerCLIResult](ctx, logger, stdoutBuf.Bytes()) | ||
if err != nil { | ||
return "", err | ||
} | ||
return result.ContainerID, nil | ||
} | ||
@@ -260,7 +254,7 @@ func (d *devcontainerCLI) ReadConfig(ctx context.Context, workspaceFolder, confi | ||
conf := applyDevcontainerCLIReadConfigOptions(opts) | ||
logger := d.logger.With(slog.F("workspace_folder", workspaceFolder), slog.F("config_path", configPath)) | ||
args := []string{"read-configuration", "--include-merged-configuration"} | ||
if workspaceFolder != "" { | ||
args = append(args, "--workspace-folder", workspaceFolder) | ||
} | ||
@@ -339,6 +333,18 @@ type devcontainerCLIResult struct { | ||
Description string `json:"description"` | ||
} | ||
func (r *devcontainerCLIResult) UnmarshalJSON(data []byte) error { | ||
type wrapperResult devcontainerCLIResult | ||
var wrappedResult wrapperResult | ||
if err := json.Unmarshal(data, &wrappedResult); err != nil { | ||
return err | ||
} | ||
*r = devcontainerCLIResult(wrappedResult) | ||
return r.Err() | ||
} | ||
func (r devcontainerCLIResult) Err() error { | ||
if r.Outcome == "success" { | ||
return nil | ||
Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.
Uh oh!
There was an error while loading.Please reload this page.
Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.