Skip to content

Commit 805e7cb

Browse files
committed
Exclude runtime package documentation from staging
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 3f5c3c30-0cf7-4b9a-9a3b-2b01ca073015
1 parent 7404f37 commit 805e7cb

11 files changed

Lines changed: 31 additions & 5 deletions

File tree

‎dotnet/src/build/GitHub.Copilot.SDK.targets‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@
152152
<Delete Files="$(_CopilotRuntimeAssetManifest)" />
153153
<ItemGroup Condition="Exists('$(_CopilotRuntimeWrapperPath)') And Exists('$(_CopilotRuntimeNodePath)')">
154154
<_CopilotRuntimeRootAsset Include="$(_CopilotCacheDir)\**\*"
155-
Exclude="$(_CopilotCacheDir)\app.js;$(_CopilotCacheDir)\assets\**\*;$(_CopilotCacheDir)\changelog.json;$(_CopilotCacheDir)\copilot;$(_CopilotCacheDir)\copilot.exe;$(_CopilotCacheDir)\copilot-sdk\**\*;$(_CopilotCacheDir)\copilot.tgz;$(_CopilotCacheDir)\foundry-local-sdk\**\*;$(_CopilotCacheDir)\index.js;$(_CopilotCacheDir)\napi-oop-runtime\**\*;$(_CopilotCacheDir)\npm-loader.js;$(_CopilotCacheDir)\package.json;$(_CopilotCacheDir)\prebuilds\**\*;$(_CopilotCacheDir)\preloads\**\*;$(_CopilotCacheDir)\pvrecorder\**\*;$(_CopilotCacheDir)\queries\**\*;$(_CopilotCacheDir)\sdk\**\*;$(_CopilotCacheDir)\sea-loader.js;$(_CopilotCacheDir)\tree-sitter*.wasm;$(_CopilotCacheDir)\voice-*.js;$(_CopilotCacheDir)\webview\**\*" />
155+
Exclude="$(_CopilotCacheDir)\app.js;$(_CopilotCacheDir)\assets\**\*;$(_CopilotCacheDir)\changelog.json;$(_CopilotCacheDir)\copilot;$(_CopilotCacheDir)\copilot.exe;$(_CopilotCacheDir)\copilot-sdk\**\*;$(_CopilotCacheDir)\copilot.tgz;$(_CopilotCacheDir)\foundry-local-sdk\**\*;$(_CopilotCacheDir)\index.js;$(_CopilotCacheDir)\LICENSE.md;$(_CopilotCacheDir)\napi-oop-runtime\**\*;$(_CopilotCacheDir)\npm-loader.js;$(_CopilotCacheDir)\package.json;$(_CopilotCacheDir)\prebuilds\**\*;$(_CopilotCacheDir)\preloads\**\*;$(_CopilotCacheDir)\pvrecorder\**\*;$(_CopilotCacheDir)\queries\**\*;$(_CopilotCacheDir)\README.md;$(_CopilotCacheDir)\sdk\**\*;$(_CopilotCacheDir)\sea-loader.js;$(_CopilotCacheDir)\tree-sitter*.wasm;$(_CopilotCacheDir)\voice-*.js;$(_CopilotCacheDir)\webview\**\*" />
156156
<_CopilotRuntimePrebuildAsset Include="$(_CopilotCacheDir)\prebuilds\$(_CopilotPlatform)\**\*"
157157
Exclude="$(_CopilotCacheDir)\prebuilds\$(_CopilotPlatform)\cli-native.node;$(_CopilotCacheDir)\prebuilds\$(_CopilotPlatform)\mediaremote-adapter\**\*;$(_CopilotCacheDir)\prebuilds\$(_CopilotPlatform)\copilot-runtime-bin*" />
158158
</ItemGroup>
@@ -185,7 +185,7 @@
185185
<Error Condition="Exists('$(_CopilotRuntimeWrapperPath)') != Exists('$(_CopilotRuntimeNodePath)')" Text="Incomplete Copilot runtime bundle in '$(_CopilotCacheDir)\prebuilds\$(_CopilotPlatform)': $(_CopilotRuntimeWrapper) and runtime.node are both required." />
186186
<ItemGroup>
187187
<_CopilotRuntimeRootAsset Include="$(_CopilotCacheDir)\**\*"
188-
Exclude="$(_CopilotCacheDir)\app.js;$(_CopilotCacheDir)\assets\**\*;$(_CopilotCacheDir)\changelog.json;$(_CopilotCacheDir)\copilot;$(_CopilotCacheDir)\copilot.exe;$(_CopilotCacheDir)\copilot-sdk\**\*;$(_CopilotCacheDir)\copilot.tgz;$(_CopilotCacheDir)\foundry-local-sdk\**\*;$(_CopilotCacheDir)\index.js;$(_CopilotCacheDir)\napi-oop-runtime\**\*;$(_CopilotCacheDir)\npm-loader.js;$(_CopilotCacheDir)\package.json;$(_CopilotCacheDir)\prebuilds\**\*;$(_CopilotCacheDir)\preloads\**\*;$(_CopilotCacheDir)\pvrecorder\**\*;$(_CopilotCacheDir)\queries\**\*;$(_CopilotCacheDir)\sdk\**\*;$(_CopilotCacheDir)\sea-loader.js;$(_CopilotCacheDir)\tree-sitter*.wasm;$(_CopilotCacheDir)\voice-*.js;$(_CopilotCacheDir)\webview\**\*"
188+
Exclude="$(_CopilotCacheDir)\app.js;$(_CopilotCacheDir)\assets\**\*;$(_CopilotCacheDir)\changelog.json;$(_CopilotCacheDir)\copilot;$(_CopilotCacheDir)\copilot.exe;$(_CopilotCacheDir)\copilot-sdk\**\*;$(_CopilotCacheDir)\copilot.tgz;$(_CopilotCacheDir)\foundry-local-sdk\**\*;$(_CopilotCacheDir)\index.js;$(_CopilotCacheDir)\LICENSE.md;$(_CopilotCacheDir)\napi-oop-runtime\**\*;$(_CopilotCacheDir)\npm-loader.js;$(_CopilotCacheDir)\package.json;$(_CopilotCacheDir)\prebuilds\**\*;$(_CopilotCacheDir)\preloads\**\*;$(_CopilotCacheDir)\pvrecorder\**\*;$(_CopilotCacheDir)\queries\**\*;$(_CopilotCacheDir)\README.md;$(_CopilotCacheDir)\sdk\**\*;$(_CopilotCacheDir)\sea-loader.js;$(_CopilotCacheDir)\tree-sitter*.wasm;$(_CopilotCacheDir)\voice-*.js;$(_CopilotCacheDir)\webview\**\*"
189189
Condition="Exists('$(_CopilotRuntimeWrapperPath)') And Exists('$(_CopilotRuntimeNodePath)')" />
190190
<_CopilotRuntimePrebuildAsset Include="$(_CopilotCacheDir)\prebuilds\$(_CopilotPlatform)\**\*"
191191
Exclude="$(_CopilotCacheDir)\prebuilds\$(_CopilotPlatform)\cli-native.node;$(_CopilotCacheDir)\prebuilds\$(_CopilotPlatform)\mediaremote-adapter\**\*;$(_CopilotCacheDir)\prebuilds\$(_CopilotPlatform)\copilot-runtime-bin*"

‎dotnet/test/Unit/MSBuildTargetsTests.cs‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,8 @@ public async Task RuntimePackageAssets_AreFilteredAndCopiedToOutput()
116116
sandbox.WriteRuntimeCacheAsset("ripgrep", "bin", GetNpmPlatform(), "rg", "ripgrep");
117117
sandbox.WriteRuntimeCacheAsset("definitions", "future.json", "{}");
118118
sandbox.WriteRuntimeCacheAsset("app.js", "excluded");
119+
sandbox.WriteRuntimeCacheAsset("LICENSE.md", "excluded");
120+
sandbox.WriteRuntimeCacheAsset("README.md", "excluded");
119121
sandbox.WriteStaleOutputRuntimeAsset("obsolete", "tool", "stale");
120122

121123
var result = await sandbox.BuildAsync(new Dictionary<string, string>
@@ -127,6 +129,8 @@ public async Task RuntimePackageAssets_AreFilteredAndCopiedToOutput()
127129
Assert.Equal("ripgrep", File.ReadAllText(sandbox.ExpectedRuntimeAsset("ripgrep", "bin", GetNpmPlatform(), "rg")));
128130
Assert.Equal("{}", File.ReadAllText(sandbox.ExpectedRuntimeAsset("definitions", "future.json")));
129131
Assert.False(File.Exists(sandbox.ExpectedRuntimeAsset("app.js")));
132+
Assert.False(File.Exists(sandbox.ExpectedRuntimeAsset("LICENSE.md")));
133+
Assert.False(File.Exists(sandbox.ExpectedRuntimeAsset("README.md")));
130134
Assert.False(File.Exists(sandbox.ExpectedRuntimeAsset("obsolete", "tool")));
131135
}
132136

‎go/cmd/bundler/main.go‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -449,8 +449,8 @@ func runtimeWrapperName(binaryName string) string {
449449
var hostlessExcludedTopLevel = map[string]bool{
450450
"app.js": true, "assets": true, "changelog.json": true, "copilot": true, "copilot.exe": true,
451451
"copilot-sdk": true, "foundry-local-sdk": true, "index.js": true, "napi-oop-runtime": true,
452-
"npm-loader.js": true, "package.json": true, "preloads": true, "pvrecorder": true,
453-
"queries": true, "sdk": true, "sea-loader.js": true, "webview": true,
452+
"LICENSE.md": true, "npm-loader.js": true, "package.json": true, "preloads": true, "pvrecorder": true,
453+
"queries": true, "README.md": true, "sdk": true, "sea-loader.js": true, "webview": true,
454454
}
455455

456456
func hostlessRuntimePath(name, npmPlatform, wrapperName string) (string, bool) {

‎go/cmd/bundler/main_test.go‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ func TestCreateRuntimeAssetsArchiveRetainsUnknownAssetsAndFiltersCLIContent(t *t
2323
"package/ripgrep/bin/linux-x64/rg": "ripgrep",
2424
"package/definitions/future.json": "{}",
2525
"package/app.js": "excluded",
26+
"package/LICENSE.md": "excluded",
27+
"package/README.md": "excluded",
2628
})
2729

2830
if err := createRuntimeAssetsArchive(source, output, platformInfo{
@@ -36,7 +38,9 @@ func TestCreateRuntimeAssetsArchiveRetainsUnknownAssetsAndFiltersCLIContent(t *t
3638
if files["ripgrep/bin/linux-x64/rg"] != "ripgrep" || files["definitions/future.json"] != "{}" {
3739
t.Fatalf("retained assets = %#v", files)
3840
}
39-
for _, excluded := range []string{"runtime.node", "copilot-runtime", "app.js"} {
41+
for _, excluded := range []string{
42+
"runtime.node", "copilot-runtime", "app.js", "LICENSE.md", "README.md",
43+
} {
4044
if _, ok := files[excluded]; ok {
4145
t.Fatalf("excluded asset %q was retained", excluded)
4246
}

‎java/copilot-native/scripts/fetch-native.mjs‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,14 @@ const excludedTopLevel = new Set([
3030
'copilot-sdk',
3131
'foundry-local-sdk',
3232
'index.js',
33+
'LICENSE.md',
3334
'napi-oop-runtime',
3435
'npm-loader.js',
3536
'package.json',
3637
'preloads',
3738
'pvrecorder',
3839
'queries',
40+
'README.md',
3941
'sdk',
4042
'sea-loader.js',
4143
'webview',

‎java/copilot-native/scripts/fetch-native.test.mjs‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,8 @@ test('stages retained package assets and excludes CLI-only content', (t) => {
8787
fs.chmodSync(path.join(packageRoot, 'ripgrep', 'bin', classifier, 'rg'), 0o755);
8888
fs.writeFileSync(path.join(packageRoot, 'definitions', 'future.json'), '{}');
8989
fs.writeFileSync(path.join(packageRoot, 'app.js'), 'excluded');
90+
fs.writeFileSync(path.join(packageRoot, 'LICENSE.md'), 'excluded');
91+
fs.writeFileSync(path.join(packageRoot, 'README.md'), 'excluded');
9092
const tarball = path.join(fixture.repoRoot, 'fixture.tgz');
9193
execFileSync('tar', ['-czf', tarball, '-C', path.dirname(packageRoot), 'package']);
9294
const packageIntegrity = digest(fs.readFileSync(tarball));
@@ -112,6 +114,8 @@ test('stages retained package assets and excludes CLI-only content', (t) => {
112114
assert.equal(fs.readFileSync(path.join(resourceDir, 'ripgrep', 'bin', classifier, 'rg'), 'utf8'), 'ripgrep content');
113115
assert.equal(fs.readFileSync(path.join(resourceDir, 'definitions', 'future.json'), 'utf8'), '{}');
114116
assert.equal(fs.existsSync(path.join(resourceDir, 'app.js')), false);
117+
assert.equal(fs.existsSync(path.join(resourceDir, 'LICENSE.md')), false);
118+
assert.equal(fs.existsSync(path.join(resourceDir, 'README.md')), false);
115119
assert.match(fs.readFileSync(path.join(resourceDir, 'runtime-assets.list'), 'utf8'), /ripgrep\/bin\/linux-x64\/rg/);
116120
});
117121

‎nodejs/src/runtimeArtifacts.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,14 @@ const EXCLUDED_TOP_LEVEL = new Set([
2626
"copilot-sdk",
2727
"foundry-local-sdk",
2828
"index.js",
29+
"LICENSE.md",
2930
"napi-oop-runtime",
3031
"npm-loader.js",
3132
"package.json",
3233
"preloads",
3334
"pvrecorder",
3435
"queries",
36+
"README.md",
3537
"sdk",
3638
"sea-loader.js",
3739
"webview",

‎nodejs/test/runtimeArtifacts.test.ts‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ describe("materializeRuntimeBundle", () => {
2626
mkdirSync(join(sourceDir, "definitions"), { recursive: true });
2727
writeFileSync(join(sourceDir, "definitions", "future.json"), "{}");
2828
writeFileSync(join(sourceDir, "app.js"), "excluded");
29+
writeFileSync(join(sourceDir, "LICENSE.md"), "excluded");
30+
writeFileSync(join(sourceDir, "README.md"), "excluded");
2931

3032
vi.stubEnv("PATH", emptyPath);
3133
vi.stubEnv("COPILOT_CLI_PATH", undefined);
@@ -48,6 +50,8 @@ describe("materializeRuntimeBundle", () => {
4850
"ripgrep"
4951
);
5052
expect(existsSync(join(installDir, "app.js"))).toBe(false);
53+
expect(existsSync(join(installDir, "LICENSE.md"))).toBe(false);
54+
expect(existsSync(join(installDir, "README.md"))).toBe(false);
5155
if (process.platform !== "win32") {
5256
expect(statSync(installedWrapper).mode & 0o111).not.toBe(0);
5357
}

‎python/copilot/_cli_download.py‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -394,12 +394,14 @@ def _extract_runtime_wrapper(data: bytes, npm_platform: str) -> bytes:
394394
"copilot-sdk",
395395
"foundry-local-sdk",
396396
"index.js",
397+
"LICENSE.md",
397398
"napi-oop-runtime",
398399
"npm-loader.js",
399400
"package.json",
400401
"preloads",
401402
"pvrecorder",
402403
"queries",
404+
"README.md",
403405
"sdk",
404406
"sea-loader.js",
405407
"webview",

‎python/test_cli_download.py‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ def _runtime_package(npm_platform: str) -> bytes:
2727
f"package/ripgrep/bin/{npm_platform}/rg": b"ripgrep",
2828
"package/definitions/future.json": b"{}",
2929
"package/app.js": b"excluded",
30+
"package/LICENSE.md": b"excluded",
31+
"package/README.md": b"excluded",
3032
}
3133
buffer = io.BytesIO()
3234
with tarfile.open(fileobj=buffer, mode="w:gz") as archive:

0 commit comments

Comments
 (0)