Skip to content

Commit 761a232

Browse files
authored
merge
2 parents 7be3288 + 66eec95 commit 761a232

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+1788
-421
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Test Plan Item Validator
2+
on:
3+
issues:
4+
types: [edited]
5+
6+
jobs:
7+
main:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout Actions
11+
if: contains(github.event.issue.labels.*.name, 'testplan-item') || contains(github.event.issue.labels.*.name, 'invalid-testplan-item')
12+
uses: actions/checkout@v2
13+
with:
14+
repository: 'microsoft/vscode-github-triage-actions'
15+
ref: stable
16+
- name: Install Actions
17+
if: contains(github.event.issue.labels.*.name, 'testplan-item') || contains(github.event.issue.labels.*.name, 'invalid-testplan-item')
18+
run: npm install --production
19+
- name: Run Test Plan Item Validator
20+
if: contains(github.event.issue.labels.*.name, 'testplan-item') || contains(github.event.issue.labels.*.name, 'invalid-testplan-item')
21+
uses: ./test-plan-item-validator
22+
with:
23+
label: testplan-item
24+
invalidLabel: invalid-testplan-item
25+
comment: Invalid test plan item. See errors below and the [test plan item spec](https://github.com/microsoft/vscode/wiki/Writing-Test-Plan-Items) for more information. This comment will go away when the issues are resolved.

.vscode/launch.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,13 @@
1010
"name": "Launch cli - up",
1111
"program": "${workspaceFolder}/src/spec-node/devContainersSpecCLI.ts",
1212
"cwd": "${workspaceFolder}",
13-
"args": ["up", "--workspace-folder", "../features-playground", "--log-level", "debug", ],
13+
"args": [
14+
"up",
15+
"--workspace-folder",
16+
"../devcontainers-features",
17+
"--log-level",
18+
"debug",
19+
],
1420
"console": "integratedTerminal",
1521
}
1622
]

CHANGELOG.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,30 @@
22

33
Notable changes.
44

5+
## June 2022
6+
7+
### [0.7.0]
8+
9+
- Multi-platform build support. (https://github.com/devcontainers/cli/pull/24)
10+
- User-scoped tmp folder on Linux. (https://github.com/microsoft/vscode-remote-release/issues/2347)
11+
512
## May 2022
613

14+
### [0.6.0]
15+
16+
- Handle undefined context. (https://github.com/microsoft/vscode-remote-release/issues/6815)
17+
- Avoid comment after ARG for Podman. (https://github.com/microsoft/vscode-remote-release/issues/6819)
18+
- Update to vscode-dev-containers 0.238.1.
19+
20+
### [0.5.0]
21+
22+
- Update to vscode-dev-containers 0.238.0.
23+
24+
### [0.4.0]
25+
26+
- Merge user and features Dockerfile to simplify cache and multi-platform handling.
27+
- Use PTY for `--log-format-json`.
28+
729
### [0.3.0]
830

931
- BuildKit version check for `--build-context`.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@devcontainers/cli",
33
"description": "Dev Containers CLI",
4-
"version": "0.3.0",
4+
"version": "0.7.0",
55
"bin": {
66
"devcontainer": "devcontainer.js"
77
},
@@ -78,7 +78,7 @@
7878
"shell-quote": "^1.7.3",
7979
"stream-to-pull-stream": "^1.7.3",
8080
"tar": "^6.1.11",
81-
"vscode-dev-containers": "https://github.com/microsoft/vscode-dev-containers/releases/download/v0.236.0/vscode-dev-containers-0.236.0.tgz",
81+
"vscode-dev-containers": "https://github.com/microsoft/vscode-dev-containers/releases/download/v0.241.1/vscode-dev-containers-0.241.1.tgz",
8282
"vscode-uri": "^3.0.3",
8383
"yargs": "~17.0.1"
8484
}

src/spec-common/cliHost.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ export interface CLIHost {
3535
mkdirp(dirpath: string): Promise<void>;
3636
readDir(dirpath: string): Promise<string[]>;
3737
readDirWithTypes?(dirpath: string): Promise<[string, FileTypeBitmask][]>;
38+
getUsername(): Promise<string>;
3839
getuid(): Promise<number>;
3940
getgid(): Promise<number>;
4041
toCommonURI(filePath: string): Promise<URI | undefined>;
@@ -78,6 +79,7 @@ function createLocalCLIHostFromExecFunctions(localCwd: string, exec: ExecFunctio
7879
await mkdirpLocal(dirpath);
7980
},
8081
readDir: readLocalDir,
82+
getUsername: async () => os.userInfo().username,
8183
getuid: async () => process.getuid(),
8284
getgid: async () => process.getgid(),
8385
toCommonURI: async (filePath) => URI.file(filePath),

src/spec-common/injectHeadless.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ export interface ResolverParameters {
5656
backgroundTasks: (Promise<void> | (() => Promise<void>))[];
5757
persistedFolder: string; // A path where config can be persisted and restored at a later time. Should default to tmpdir() folder if not provided.
5858
remoteEnv: Record<string, string>;
59+
buildxPlatform: string | undefined;
60+
buildxPush: boolean;
5961
}
6062

6163
export interface PostCreate {
@@ -105,18 +107,13 @@ export type DevContainerConfigCommand = 'initializeCommand' | 'onCreateCommand'
105107

106108
const defaultWaitFor: DevContainerConfigCommand = 'updateContentCommand';
107109

108-
export interface DevContainerFeature {
109-
id: string;
110-
options: boolean | string | Record<string, boolean | string | undefined>;
111-
}
112-
113110
export interface CommonDevContainerConfig {
114111
configFilePath?: URI;
115112
remoteEnv?: Record<string, string | null>;
116113
forwardPorts?: (number | string)[];
117114
portsAttributes?: Record<string, PortAttributes>;
118115
otherPortsAttributes?: PortAttributes;
119-
features?: DevContainerFeature[] | Record<string, string | boolean | Record<string, string | boolean>>;
116+
features?: Record<string, string | boolean | Record<string, string | boolean>>;
120117
onCreateCommand?: string | string[];
121118
updateContentCommand?: string | string[];
122119
postCreateCommand?: string | string[];

src/spec-configuration/configuration.ts

Lines changed: 30 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ export interface DevContainerFromImageConfig {
5959
remoteUser?: string;
6060
updateRemoteUserUID?: boolean;
6161
userEnvProbe?: UserEnvProbe;
62-
features?: DevContainerFeature[] | Record<string, string | boolean | Record<string, string | boolean>>;
62+
features?: Record<string, string | boolean | Record<string, string | boolean>>;
63+
overrideFeatureInstallOrder?: string[];
6364
hostRequirements?: HostRequirements;
6465
}
6566

@@ -90,7 +91,8 @@ export type DevContainerFromDockerfileConfig = {
9091
remoteUser?: string;
9192
updateRemoteUserUID?: boolean;
9293
userEnvProbe?: UserEnvProbe;
93-
features?: DevContainerFeature[] | Record<string, string | boolean | Record<string, string | boolean>>;
94+
features?: Record<string, string | boolean | Record<string, string | boolean>>;
95+
overrideFeatureInstallOrder?: string[];
9496
hostRequirements?: HostRequirements;
9597
} & (
9698
{
@@ -137,7 +139,8 @@ export interface DevContainerFromDockerComposeConfig {
137139
remoteUser?: string;
138140
updateRemoteUserUID?: boolean;
139141
userEnvProbe?: UserEnvProbe;
140-
features?: DevContainerFeature[] | Record<string, string | boolean | Record<string, string | boolean>>;
142+
features?: Record<string, string | boolean | Record<string, string | boolean>>;
143+
overrideFeatureInstallOrder?: string[];
141144
hostRequirements?: HostRequirements;
142145
}
143146

@@ -196,42 +199,40 @@ export function getDockerfile(config: DevContainerFromDockerfileConfig) {
196199
return 'dockerFile' in config ? config.dockerFile : config.build.dockerfile;
197200
}
198201

199-
export async function getDockerComposeFilePaths(cliHost: FileHost, config: DevContainerFromDockerComposeConfig, envForComposeFile?: NodeJS.ProcessEnv, cwdForDefaultFiles?: string) {
202+
export async function getDockerComposeFilePaths(cliHost: FileHost, config: DevContainerFromDockerComposeConfig, envForComposeFile: NodeJS.ProcessEnv, cwdForDefaultFiles: string) {
200203
if (Array.isArray(config.dockerComposeFile)) {
201204
if (config.dockerComposeFile.length) {
202205
return config.dockerComposeFile.map(composeFile => uriToFsPath(getConfigFilePath(cliHost, config, composeFile), cliHost.platform));
203206
}
204207
} else if (typeof config.dockerComposeFile === 'string') {
205208
return [uriToFsPath(getConfigFilePath(cliHost, config, config.dockerComposeFile), cliHost.platform)];
206209
}
207-
if (cwdForDefaultFiles) {
208-
const envComposeFile = envForComposeFile?.COMPOSE_FILE;
209-
if (envComposeFile) {
210-
return envComposeFile.split(cliHost.path.delimiter)
210+
211+
const envComposeFile = envForComposeFile?.COMPOSE_FILE;
212+
if (envComposeFile) {
213+
return envComposeFile.split(cliHost.path.delimiter)
214+
.map(composeFile => cliHost.path.resolve(cwdForDefaultFiles, composeFile));
215+
}
216+
217+
try {
218+
const envPath = cliHost.path.join(cwdForDefaultFiles, '.env');
219+
const buffer = await cliHost.readFile(envPath);
220+
const match = /^COMPOSE_FILE=(.+)$/m.exec(buffer.toString());
221+
const envFileComposeFile = match && match[1].trim();
222+
if (envFileComposeFile) {
223+
return envFileComposeFile.split(cliHost.path.delimiter)
211224
.map(composeFile => cliHost.path.resolve(cwdForDefaultFiles, composeFile));
212225
}
213-
214-
try {
215-
const envPath = cliHost.path.join(cwdForDefaultFiles, '.env');
216-
const buffer = await cliHost.readFile(envPath);
217-
const match = /^COMPOSE_FILE=(.+)$/m.exec(buffer.toString());
218-
const envFileComposeFile = match && match[1].trim();
219-
if (envFileComposeFile) {
220-
return envFileComposeFile.split(cliHost.path.delimiter)
221-
.map(composeFile => cliHost.path.resolve(cwdForDefaultFiles, composeFile));
222-
}
223-
} catch (err) {
224-
if (!(err && (err.code === 'ENOENT' || err.code === 'EISDIR'))) {
225-
throw err;
226-
}
226+
} catch (err) {
227+
if (!(err && (err.code === 'ENOENT' || err.code === 'EISDIR'))) {
228+
throw err;
227229
}
230+
}
228231

229-
const defaultFiles = [cliHost.path.resolve(cwdForDefaultFiles, 'docker-compose.yml')];
230-
const override = cliHost.path.resolve(cwdForDefaultFiles, 'docker-compose.override.yml');
231-
if (await cliHost.isFile(override)) {
232-
defaultFiles.push(override);
233-
}
234-
return defaultFiles;
232+
const defaultFiles = [cliHost.path.resolve(cwdForDefaultFiles, 'docker-compose.yml')];
233+
const override = cliHost.path.resolve(cwdForDefaultFiles, 'docker-compose.override.yml');
234+
if (await cliHost.isFile(override)) {
235+
defaultFiles.push(override);
235236
}
236-
return [];
237+
return defaultFiles;
237238
}

0 commit comments

Comments
 (0)