Conversation
| var script string | ||
| switch { | ||
| case opts.LifecycleFilePath != "": | ||
| content, err := os.ReadFile(opts.LifecycleFilePath) |
There was a problem hiding this comment.
can we check filesize before we read it into memory?
| return assignments, nil | ||
| } | ||
|
|
||
| func validateTunnelName(name string) string { |
There was a problem hiding this comment.
could these just be errors?
There was a problem hiding this comment.
This is just message function for an error call
| if start < 1 || start > 65535 || end < 1 || end > 65535 { | ||
| return 0, 0, breverrors.NewValidationError(fmt.Sprintf("port range %q must stay within 1-65535", raw)) | ||
| } | ||
| if start >= end { |
There was a problem hiding this comment.
can't they be equal if you want to use a single port?
There was a problem hiding this comment.
That's if it uses the notation "-",implying range, otherwise just specify "22" directly,
| ) | ||
|
|
||
| const ( | ||
| defaultLaunchableViewAccess = "public" |
There was a problem hiding this comment.
defaulting to public feels scary in case people are testing and using keys in them. How do you feel about defaulting to organization?
| return u.String() | ||
| } | ||
|
|
||
| func parseSizeToGiB(raw string) (int, error) { |
There was a problem hiding this comment.
there is existing logic you can follow. @drewmalin did some refactor work to try and fix this area because it was wrong in a bunch of places:
Claude recommendation from analyzing cloud SDK and dev-plane:
Recommended fix (smallest path): drop the base-10 aliases and just handle kib/mib/gib/tib (and optionally b), matching what units.Base2Bytes emits. The case-insensitive match is fine to keep for defensiveness.
Better path (longer-term alignment): have the CLI consume the new MinSizeBytes / MaxSizeBytes JSON (cloudv1.Bytes with {value, unit} shape), and use cloudv1.ByteCountInUnitInt64(cloudv1.Gibibyte) directly. Removes string parsing entirely and stays correct across unit changes.
|
can you generate some tests? |
| YamlString string `json:"yamlString,omitempty"` | ||
| } | ||
|
|
||
| type ValidateDockerComposeResponse map[string]interface{} |
There was a problem hiding this comment.
doesn't seem like we need the response? Could ValidateDockerCompose just return error, and we just use the res inside the function to se if it isError() ?
| for i := range allInstanceTypes.AllInstanceTypes { | ||
| if allInstanceTypes.AllInstanceTypes[i].Type == instanceType { | ||
| if len(allInstanceTypes.AllInstanceTypes[i].WorkspaceGroups) == 0 { | ||
| return nil, breverrors.NewValidationError(fmt.Sprintf("instance type %q does not have a workspace group for this organization", instanceType)) |
There was a problem hiding this comment.
can we change this error message to:
instance type %q not valid for this organization since workspace groups aren't a thing users can do anything with
|
|
||
| Use Compose mode when you want: | ||
|
|
||
| - a multi-service environment |
There was a problem hiding this comment.
should this also include jupyter since we set that to true by default for compose?
|
|
||
| Allowed values: | ||
|
|
||
| - `public` |
There was a problem hiding this comment.
is it worth explaining these visibilities ? e.g. what's the difference between public and published? Are you thinking that's more of a concern for the skill?
| if len(name) > 63 { | ||
| return "Name must be 63 characters or fewer" | ||
| } | ||
| if !regexp.MustCompile(`^[a-z0-9]`).MatchString(name) { |
There was a problem hiding this comment.
can we pull these three regexes up as vars that way we don't have to compile them every time? like githubDirectoryURLPattern
|
Hey @tylerfong — I was working on a parallel CLI path (#364) before I noticed this PR. Yours is further along and more comprehensive, so I'm going to close #364 and defer to this one. Two follow-up asks I'd love to see (happy to do them as separate PRs after this lands):
Related bonus ask for the Console team (not this PR, just flagging): once the schema exists, the Console's launchable-creation wizard should accept a JSON upload as an alternative to clicking through the form. Same schema, two entry points (wizard + upload), one source of truth. That closes the loop for users who author their launchable in a text editor and don't want to re-enter everything in a UI. Happy to drive either (1) or (2) after #357 merges. None of this is a blocker on the existing review. |
|
Steph actually has been messing with the instance type service proto, and in particular the "get instance types available" route is... available! We should be able to do: req := connect.NewRequest(&devplaneapiv1.ListInstanceTypeRequest{
Options: &devplaneapiv1.ListInstanceTypeOptions{
OrganizationId: orgID,
},
})
resp, err := client.ListInstanceType(ctx, req)and have the full types here. Then we don't need to redefine structs like GPU, Price, Storage, etc. etc. |
No description provided.