Skip to content

Commit 513ffc0

Browse files
authored
🐛 Update ci to support multiple vsix files (#38)
<!-- ## PR Title Prefix Every **PR Title** should be prefixed with :text: to indicate its type. - Breaking change: ⚠️ (`⚠️`) - Non-breaking feature: ✨ (`✨`) - Patch fix: 🐛 (`🐛`) - Docs: 📖 (`📖`) - Infra/Tests/Other: 🌱 (`🌱`) - No release note: 👻 (`👻`) For example, a pull request containing breaking changes might look like `⚠️ My pull request contains breaking changes`. Since GitHub supports emoji aliases (ie. `👻`), there is no need to include the emoji directly in the PR title -- **please use the alias**. It used to be the case that projects using emojis for PR typing had to include the emoji directly because GitHub didn't render the alias. Given that `⚠️` is easy enough to read as text, easy to parse in release tooling, and rendered in GitHub well, we prefer to standardize on the alias. For more information, please see the Konveyor [Versioning Doc](https://github.com/konveyor/release-tools/blob/main/VERSIONING.md). --> --------- Signed-off-by: Alejandro Brugarolas <abrugaro@redhat.com>
1 parent f5e3f77 commit 513ffc0

File tree

4 files changed

+84
-12
lines changed

4 files changed

+84
-12
lines changed

.github/workflows/ci.yml

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -405,20 +405,48 @@ jobs:
405405
echo "Found VSIX files:"
406406
find ./artifacts -name "*.vsix" -ls
407407
408+
# Find each extension VSIX based on MTA naming convention
409+
CORE_VSIX=$(ls ./artifacts/mta-core-*.vsix 2>/dev/null | head -n 1)
410+
JAVA_VSIX=$(ls ./artifacts/mta-java-*.vsix 2>/dev/null | head -n 1)
411+
JS_VSIX=$(ls ./artifacts/mta-javascript-*.vsix 2>/dev/null | head -n 1)
412+
GO_VSIX=$(ls ./artifacts/mta-go-*.vsix 2>/dev/null | head -n 1)
413+
CSHARP_VSIX=$(ls ./artifacts/mta-csharp-*.vsix 2>/dev/null | head -n 1)
414+
415+
# Verify and output
416+
for vsix in "$CORE_VSIX" "$JAVA_VSIX" "$JS_VSIX" "$GO_VSIX" "$CSHARP_VSIX"; do
417+
[ ! -f "$vsix" ] && echo "Error: VSIX not found: $vsix" && exit 1
418+
done
419+
420+
echo "core_vsix=${CORE_VSIX}" >> $GITHUB_OUTPUT
421+
echo "java_vsix=${JAVA_VSIX}" >> $GITHUB_OUTPUT
422+
echo "javascript_vsix=${JS_VSIX}" >> $GITHUB_OUTPUT
423+
echo "go_vsix=${GO_VSIX}" >> $GITHUB_OUTPUT
424+
echo "csharp_vsix=${CSHARP_VSIX}" >> $GITHUB_OUTPUT
425+
408426
- name: Run e2e tests (Linux)
409427
run: npx playwright test e2e/tests/base/configure-and-run-analysis.test.ts
410428
working-directory: ./.upstream-workspace/tests
411429
env:
430+
__TEST_EXTENSION_END_TO_END__: "true"
412431
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
413-
VSIX_FILE_PATH: ${{ github.workspace }}/artifacts
432+
CORE_VSIX_FILE_PATH: ${{ github.workspace }}/${{ steps.set_vsix_paths.outputs.core_vsix }}
433+
JAVA_VSIX_FILE_PATH: ${{ github.workspace }}/${{ steps.set_vsix_paths.outputs.java_vsix }}
434+
JAVASCRIPT_VSIX_FILE_PATH: ${{ github.workspace }}/${{ steps.set_vsix_paths.outputs.javascript_vsix }}
435+
GO_VSIX_FILE_PATH: ${{ github.workspace }}/${{ steps.set_vsix_paths.outputs.go_vsix }}
436+
CSHARP_VSIX_FILE_PATH: ${{ github.workspace }}/${{ steps.set_vsix_paths.outputs.csharp_vsix }}
414437

415438
# This is intentionally kept in a separate step to avoid passing in credentials
416439
- name: Run e2e tests (Linux - Offline)
417440
run: npx playwright test e2e/tests/agent_flow_coolstore.test.ts
418441
working-directory: ./.upstream-workspace/tests
419442
env:
420-
VSIX_FILE_PATH: ${{ github.workspace }}/artifacts
443+
__TEST_EXTENSION_END_TO_END__: "true"
421444
OPENAI_API_KEY: <dummy> # this only exists to pass provider validation
445+
CORE_VSIX_FILE_PATH: ${{ github.workspace }}/${{ steps.set_vsix_paths.outputs.core_vsix }}
446+
JAVA_VSIX_FILE_PATH: ${{ github.workspace }}/${{ steps.set_vsix_paths.outputs.java_vsix }}
447+
JAVASCRIPT_VSIX_FILE_PATH: ${{ github.workspace }}/${{ steps.set_vsix_paths.outputs.javascript_vsix }}
448+
GO_VSIX_FILE_PATH: ${{ github.workspace }}/${{ steps.set_vsix_paths.outputs.go_vsix }}
449+
CSHARP_VSIX_FILE_PATH: ${{ github.workspace }}/${{ steps.set_vsix_paths.outputs.csharp_vsix }}
422450

423451
publish-development:
424452
name: Publish Development Build

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
22
1+
v22.9.0

mta-build.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
upstream:
22
repository: konveyor/editor-extensions
3-
ref: a87decba30735b514cdaca456760460511d10b9c
3+
ref: f4ec9032b6187894c49442f06555c52163f47ff5
44
semanticRef: release-0.4

scripts/prebuild.js

Lines changed: 52 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,24 @@ async function generateFallbackAssets(pkg) {
377377
"win32-arm64": "windows-mta-analyzer-rpc",
378378
};
379379

380+
// Generate static fallback assets based on known URL patterns
381+
// Used when server is unreachable at build time (e.g., VPN required)
382+
// The extension will verify availability at runtime
383+
function generateStaticFallbackAssets() {
384+
// Extract base version from URL (e.g., "8.1.0" from "MTA-8.1.0.CR2")
385+
// The analyzer binaries use only the base version, not the release suffix
386+
const versionMatch = FALLBACK_ASSETS_URL.match(/MTA-(\d+\.\d+\.\d+)/);
387+
const version = versionMatch ? versionMatch[1] : "8.1.0";
388+
389+
const assets = {};
390+
for (const [vscodePlatform, mtaPlatform] of Object.entries(PLATFORM_MAPPING)) {
391+
const binaryName = PLATFORM_BINARY_NAMES[vscodePlatform];
392+
const file = `mta-${version}-analyzer-rpc-${mtaPlatform}.zip`;
393+
assets[vscodePlatform] = { file, binaryName };
394+
}
395+
return assets;
396+
}
397+
380398
try {
381399
console.log(` Fetching from: ${FALLBACK_ASSETS_URL}`);
382400

@@ -391,8 +409,16 @@ async function generateFallbackAssets(pkg) {
391409
} catch (sha256Error) {
392410
if (isPreRelease) {
393411
console.warn(` ⚠️ Failed to fetch SHA256SUM: ${sha256Error.message}`);
394-
console.warn(" ⚠️ Pre-release build: skipping fallback assets (server unreachable)");
395-
console.warn(" 📦 Assets are bundled, so runtime downloads are not required");
412+
console.warn(" ⚠️ Server unreachable (VPN required) - using static fallback config");
413+
414+
const assets = generateStaticFallbackAssets();
415+
pkg.fallbackAssets = {
416+
baseUrl: FALLBACK_ASSETS_URL,
417+
sha256sumFile: "SHA256SUM",
418+
assets,
419+
};
420+
console.log(` ✅ Generated static fallback assets for ${Object.keys(assets).length} platforms`);
421+
console.log(" 📦 Extension will attempt to download assets at runtime");
396422
return pkg;
397423
}
398424
console.error(` ❌ Failed to fetch SHA256SUM: ${sha256Error.message}`);
@@ -469,8 +495,16 @@ async function generateFallbackAssets(pkg) {
469495
} catch (error) {
470496
if (isPreRelease) {
471497
console.warn(` ⚠️ Failed to generate fallback assets: ${error.message}`);
472-
console.warn(" ⚠️ Pre-release build: skipping fallback assets (server unreachable)");
473-
console.warn(" 📦 Assets are bundled, so runtime downloads are not required");
498+
console.warn(" ⚠️ Server unreachable (VPN required) - using static fallback config");
499+
500+
const assets = generateStaticFallbackAssets();
501+
pkg.fallbackAssets = {
502+
baseUrl: FALLBACK_ASSETS_URL,
503+
sha256sumFile: "SHA256SUM",
504+
assets,
505+
};
506+
console.log(` ✅ Generated static fallback assets for ${Object.keys(assets).length} platforms`);
507+
console.log(" 📦 Extension will attempt to download assets at runtime");
474508
return pkg;
475509
}
476510
console.error(` ❌ Failed to generate fallback assets: ${error.message}`);
@@ -488,12 +522,22 @@ async function generateFallbackAssets(pkg) {
488522
function copyBrandingAssets() {
489523
console.log("🖼️ Copying branding assets...");
490524

491-
// 1. Sidebar icon → core extension
525+
// 1. Sidebar icon → all extensions
492526
const iconSource = path.join(__dirname, "..", "assets/branding/sidebar-icons/icon.png");
493-
const iconTarget = path.join(__dirname, "..", "vscode/core/resources/icon.png");
527+
const iconTargets = [
528+
"vscode/core/resources/icon.png",
529+
"vscode/java/resources/icon.png",
530+
"vscode/javascript/resources/icon.png",
531+
"vscode/go/resources/icon.png",
532+
"vscode/csharp/resources/icon.png",
533+
];
534+
494535
if (fs.existsSync(iconSource)) {
495-
fs.copyFileSync(iconSource, iconTarget);
496-
console.log(" ✅ VSCode sidebar icon copied to core extension");
536+
for (const target of iconTargets) {
537+
const iconTarget = path.join(__dirname, "..", target);
538+
fs.copyFileSync(iconSource, iconTarget);
539+
}
540+
console.log(` ✅ VSCode sidebar icon copied to ${iconTargets.length} extensions`);
497541
} else {
498542
console.warn(" ⚠️ No sidebar icon found at: assets/branding/sidebar-icons/icon.png");
499543
}

0 commit comments

Comments
 (0)