-
Notifications
You must be signed in to change notification settings - Fork 58
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
Feature: Allow for cli version specification #253
base: main
Are you sure you want to change the base?
Conversation
@microsoft-github-policy-service agree company="M Science LLC" |
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.
Thanks for the PR! I have left a few comments. Could you take a look and address them. Thanks!
common/src/dev-container-cli.ts
Outdated
}); | ||
return exitCode === 0; | ||
const {exitCode, stdout} = await exec(getSpecCliInfo().command, ['--version'], {}); | ||
return exitCode === 0 && stdout === cliVersion; |
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.
Could stdout include a newline? Maybe use .trim()
on the string.
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.
Good point, I have addressed the change.
github-action/src/main.ts
Outdated
@@ -33,10 +33,18 @@ export async function runMain(): Promise<void> { | |||
); | |||
return; | |||
} | |||
const devContainerCliInstalled = await devcontainer.isCliInstalled(exec); | |||
const specifiedDevContainerCliVersion = | |||
core.getInput('cliVersion') ?? 'latest'; |
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.
Still use '0' as the default, so we can introduce breaking changes on the CLI by increasing its major version. Please use a constant, so we have it only once.
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.
I have introduced a constant to be referenced as the fallback version if no version is specified.
@@ -23,10 +23,18 @@ export async function runMain(): Promise<void> { | |||
); | |||
return; | |||
} | |||
const devContainerCliInstalled = await devcontainer.isCliInstalled(exec); | |||
const specifiedDevContainerCliVersion = | |||
task.getInput('cliVersion') ?? 'latest'; |
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.
Same as below: Still use '0' as the default, so we can introduce breaking changes on the CLI by increasing its major version. Please use a constant, so we have it only once.
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.
See above resolution.
"cacheFrom": "ghcr.io/devcontainers/ci-devcontainer:latest", | ||
"args": { | ||
// This is a temporary workaround when developing from host -> remote host -> devcontainer | ||
// see: https://github.com/microsoft/vscode-remote-release/issues/7958 |
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.
It was mentioned that updating Docker helped. Is this still needed?
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.
I was unable to get the devcontainer to build without this even after updating to the latest docker extension for vscode so I have left this as is.
This is in the context of devcontainers/cli#606.
I think this should be enough to allow for CLI version specification according to the other code I saw while reading through this.
The local build in the devcontainer is passing.