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

Feature: Allow for cli version specification #253

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

Olgethorpe
Copy link

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.

azdo-task/README.md Outdated Show resolved Hide resolved
@Olgethorpe
Copy link
Author

@microsoft-github-policy-service agree company="M Science LLC"

Copy link
Collaborator

@chrmarti chrmarti left a 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!

});
return exitCode === 0;
const {exitCode, stdout} = await exec(getSpecCliInfo().command, ['--version'], {});
return exitCode === 0 && stdout === cliVersion;
Copy link
Collaborator

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.

Copy link
Author

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.

@@ -33,10 +33,18 @@ export async function runMain(): Promise<void> {
);
return;
}
const devContainerCliInstalled = await devcontainer.isCliInstalled(exec);
const specifiedDevContainerCliVersion =
core.getInput('cliVersion') ?? 'latest';
Copy link
Collaborator

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.

Copy link
Author

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';
Copy link
Collaborator

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.

Copy link
Author

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
Copy link
Collaborator

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?

Copy link
Author

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.

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.

None yet

3 participants