Skip to content
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

POD-779 | Initial integration of devpod-crane #1230

Conversation

janekbaraniewski
Copy link
Contributor

Part of POD-779

@janekbaraniewski janekbaraniewski force-pushed the POD-779/initial-integration-of-crane branch 13 times, most recently from ef201c2 to 580d6df Compare August 21, 2024 14:56
@janekbaraniewski janekbaraniewski changed the title WIP | POD-779 | Initial integration of devpod-crane POD-779 | Initial integration of devpod-crane Aug 21, 2024
@janekbaraniewski janekbaraniewski marked this pull request as ready for review August 21, 2024 14:58
@janekbaraniewski janekbaraniewski force-pushed the POD-779/initial-integration-of-crane branch from 580d6df to 91dd848 Compare August 21, 2024 15:07
@janekbaraniewski janekbaraniewski force-pushed the POD-779/initial-integration-of-crane branch from 91dd848 to 18d85e6 Compare August 21, 2024 15:48
cmd/up.go Show resolved Hide resolved

GitCrane = "git"

BinPath = "devpod-crane" // FIXME
Copy link
Contributor

Choose a reason for hiding this comment

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

is this comment still valid?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah would be nice to make it at least somehow configurable to support dev/debug binaries

Copy link
Contributor

@bkneis bkneis left a comment

Choose a reason for hiding this comment

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

Looking good! I really like some of the refactoring done here and the new code looks good. I just had a couple of comments / questions then ready to merge

}

if language.MapConfig[lang] == nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we need to check the key exits first
if _, ok := language.MapConfig[lang]; ok {}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah definitely. didn't really go into this code yet, tried to break it down a bit to make it easier to refactor.

return options.Recreate && !isDockerDriver
}

func (r *runner) getRawConfig(options provider2.CLIOptions) (*config.DevContainerConfig, error) {
if r.WorkspaceConfig.Workspace.DevContainerConfig != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

this if else if else if block is a little hard to read. Since we have early returns in each block can we separate into separate if statements?

// will be gracefully handled by the auto-detection mechanism
if err != nil && !os.IsNotExist(err) {
return nil, errors.Wrap(err, "parsing devcontainer.json")
} else if rawParsedConfig == nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

else if can be replaced here with separate if

Copy link
Member

@pascalbreuninger pascalbreuninger left a comment

Choose a reason for hiding this comment

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

LGTM

@janekbaraniewski janekbaraniewski merged commit 6812c57 into loft-sh:main Aug 22, 2024
23 checks passed
@janekbaraniewski janekbaraniewski deleted the POD-779/initial-integration-of-crane branch August 22, 2024 08:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants