Skip to content

🌱 prove we can use labels to enable extra testing#984

Closed
djzager wants to merge 1 commit intokonveyor:mainfrom
djzager:mo-tests-mo-problems
Closed

🌱 prove we can use labels to enable extra testing#984
djzager wants to merge 1 commit intokonveyor:mainfrom
djzager:mo-tests-mo-problems

Conversation

@djzager
Copy link
Copy Markdown
Member

@djzager djzager commented Nov 5, 2025

Demonstrate that we can make certain tests run when the PR is labelled a certain way.

Summary by CodeRabbit

  • New Features
    • Added an optional PR-triggered E2E test job for custom-binary scenarios, runnable when labeled and using generated packages and environment inputs.
  • Chores
    • Introduced reusable E2E setup and artifact-collection actions to centralize environment provisioning and artifact handling.
    • CI now consumes setup outputs for extension package paths, removed many inline scripts, consolidated test steps, and set artifact retention to 7 days.

@djzager djzager requested a review from a team as a code owner November 5, 2025 21:28
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Nov 5, 2025

Walkthrough

Adds two composite GitHub Actions and refactors CI to use them. .github/actions/setup-e2e/action.yml prepares an E2E environment (Node.js, Java, VSCode, X11/D-Bus), locates VSIX artifacts, and exposes core-vsix, java-vsix, and javascript-vsix outputs. .github/actions/collect-e2e-artifacts/action.yml collects test artifacts and extension logs and uploads them. .github/workflows/ci-repo.yml is updated to invoke these actions, replace inline VSIX discovery and artifact steps, and consolidate artifact collection. A new workflow .github/workflows/optional-tests.yml adds a conditional PR-labeled job to run optional E2E tests for a custom binary and uses the new actions for setup and artifact upload.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

  • Heterogeneous changes: new composite actions with multi-step environment setup and outputs, workflow refactors, and a new conditional workflow/job.
  • Review focus:
    • .github/actions/setup-e2e/action.yml — Node/Java/VSCode install steps, X11/D-Bus setup, VSIX discovery patterns, output exports and error paths.
    • .github/workflows/ci-repo.yml and .github/workflows/optional-tests.yml — correct consumption of action outputs, job conditions, environment variables and secrets, and artifact/job dependencies.
    • .github/actions/collect-e2e-artifacts/action.yml — artifact collection paths, log handling, existence checks, and always() usage.

Possibly related PRs

Suggested reviewers

  • pranavgaikwad
  • sshveta

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main objective of the PR: introducing label-based conditional testing via the new optional-tests workflow.
Description check ✅ Passed The description is brief but directly conveys the PR's purpose. While minimal, it adequately explains the feature being demonstrated without requiring more detail.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 281e3b9 and 0c72c4e.

📒 Files selected for processing (4)
  • .github/actions/collect-e2e-artifacts/action.yml (1 hunks)
  • .github/actions/setup-e2e/action.yml (1 hunks)
  • .github/workflows/ci-repo.yml (1 hunks)
  • .github/workflows/optional-tests.yml (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/actions/collect-e2e-artifacts/action.yml
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2025-07-16T14:40:48.171Z
Learnt from: abrugaro
Repo: konveyor/editor-extensions PR: 591
File: .github/workflows/test/windows-nightly-ci.yml:0-0
Timestamp: 2025-07-16T14:40:48.171Z
Learning: When security issues are flagged in GitHub Actions workflows, the user abrugaro prefers to remove problematic workflows entirely rather than refactoring them in-place, especially as a temporary measure.

Applied to files:

  • .github/workflows/ci-repo.yml
📚 Learning: 2025-07-21T15:15:59.771Z
Learnt from: abrugaro
Repo: konveyor/editor-extensions PR: 591
File: tests/e2e/pages/vscode.pages.ts:169-174
Timestamp: 2025-07-21T15:15:59.771Z
Learning: In tests/e2e/pages/vscode.pages.ts, the hardcoded 15-second wait in the runAnalysis() method and the 600000ms (10-minute) timeout for the "Run Analysis" button are intentionally set to accommodate performance differences between Linux and Windows environments where tests run slower. These timeouts should not be reduced or replaced with element-based waits without understanding the cross-platform testing requirements.

Applied to files:

  • .github/workflows/ci-repo.yml
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: Build (macos)
  • GitHub Check: Build (windows)
  • GitHub Check: Build (linux)
  • GitHub Check: Test E2E - Custom Binary
🔇 Additional comments (14)
.github/workflows/ci-repo.yml (3)

218-220: Good consolidation of E2E setup into reusable action.

Using a composite action here reduces duplication and makes the setup logic reusable across workflows.


228-229: Proper consumption of Setup E2E action outputs.

Both test steps consistently reference the outputs from the setup action with correctly constructed absolute paths.

Also applies to: 237-238


241-245: Artifact collection properly consolidated into composite action.

The if: always() condition ensures test artifacts are collected even when tests fail, and the action-based approach is cleaner than the previous inline steps.

.github/workflows/optional-tests.yml (5)

1-16: Trigger configuration correctly enables label-based execution.

The inclusion of the 'labeled' event type is essential for the workflow to activate when the test/custom-binary label is added to a PR. Per-PR concurrency prevents redundant runs.


19-23: Label-based job execution correctly implemented.

The condition properly restricts this job to PRs with the test/custom-binary label, fulfilling the PR objective of conditional test execution.


34-61: Build and packaging steps follow established patterns.

Build, versioning, and packaging steps are consistent with ci-repo.yml, with appropriate development version generation for non-release builds.


63-74: E2E setup and test execution properly configured.

The setup action is correctly invoked before test execution, and VSIX paths are properly consumed from its outputs.


76-80: Artifact handling ensures test evidence is preserved.

The always() condition and distinct artifact naming prevent loss of test data while avoiding collision with the main workflow.

.github/actions/setup-e2e/action.yml (6)

1-31: Action interface well-designed with sensible defaults.

Inputs provide flexibility while outputs expose the VSIX paths that dependent workflows require.


36-50: Standard setup actions properly configured.

Node.js and Java setup steps use best-practice caching and reasonable defaults.


52-61: VSCode installation follows secure, official process.

Uses Microsoft's official repository with GPG key verification for package integrity.


79-95: Display and D-Bus configuration appropriate for headless E2E testing.

The virtual display, D-Bus daemon, and hardware acceleration settings are correctly configured for reliable VSCode execution in CI environments.


97-103: VSCode verification and cleanup steps are sound.

Verification confirms installation, and the cleanup step safely terminates any existing instances to prevent conflicts in subsequent test runs.


105-154: VSIX discovery logic is robust and well-validated.

Package names are dynamically discovered from source package.json files, VSIX files are validated to exist, and informative errors include directory listings for debugging. This approach is resilient and maintainable.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
.github/actions/collect-e2e-artifacts/action.yml (1)

1-48: Clean, focused artifact collection action with good error resilience. The implementation correctly uses always() guards to ensure artifacts are collected and uploaded regardless of test outcomes. Conditional directory checks are safe and the extension logs fallback provides diagnostic clarity.

For future flexibility, consider parameterizing the retention period as an optional input (defaulting to 7 days).

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 59d49a2 and d44d6e9.

📒 Files selected for processing (3)
  • .github/actions/collect-e2e-artifacts/action.yml (1 hunks)
  • .github/actions/setup-e2e/action.yml (1 hunks)
  • .github/workflows/ci-repo.yml (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Build (linux)
  • GitHub Check: Build (windows)
  • GitHub Check: Build (macos)
🔇 Additional comments (6)
.github/workflows/ci-repo.yml (4)

218-230: Setup action properly integrated with output consumption. The setup-e2e action is correctly invoked with an id, and downstream steps consume its outputs for VSIX paths. The environment variables are properly passed to E2E test steps.


241-245: Good refactoring to use dedicated artifact action. Replacing inline artifact collection with the composite action improves consistency and maintainability. The always() guard is preserved.


287-289: Publish job dependency correctly scoped to required test only. The publish job depends only on test-e2e, not test-custom-binary. This allows publishing to proceed even when the optional custom-binary test is skipped (correct for optional testing model).

Confirm this is the intended behavior: should custom-binary test failures block publishing? Currently, a passing test-e2e can publish even if test-custom-binary fails (when label is present). If custom-binary test should gate publishing, update line 287 to needs: [test-e2e, test-custom-binary] and adjust the job condition accordingly.


247-282: Label-based conditional test job correctly implemented and verified. The test-custom-binary job properly triggers on PR label test/custom-binary, the test file exists at the referenced path, and the GitHub Actions conditional syntax is valid. The job mirrors the standard E2E test structure while maintaining its own artifact namespace.

.github/actions/setup-e2e/action.yml (2)

36-109: E2E environment setup is comprehensive and well-structured. Node.js, Java, VSCode, X11, and D-Bus configuration follows best practices for headless testing infrastructure.


116-155: I need to verify the vsce naming behavior and check for any custom configuration:

Based on my verification of the codebase and vsce behavior:

VSIX discovery is sound—no changes needed.

The default vsce output format is {name}-{version}.vsix (e.g., konveyor-0.4.0.vsix), which matches the glob patterns used in the action. The extension names from package.json (konveyor, konveyor-java, konveyor-javascript) combined with head -n 1 reliably selects the correct VSIX file, and the error handling with if [ ! -f "$CORE_VSIX" ] properly validates file existence and provides helpful debugging output. The approach is well-suited for CI/CD workflows.

Comment thread .github/actions/setup-e2e/action.yml
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

♻️ Duplicate comments (1)
.github/actions/setup-e2e/action.yml (1)

63-77: Questionable packages in X11 dependencies (duplicate of prior review).

Lines 76 includes nickle cairo-5c, which appear unrelated to VSCode E2E testing. See prior review feedback to remove unless there's a specific upstream dependency chain requiring them.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d44d6e9 and 6c4c2fa.

📒 Files selected for processing (3)
  • .github/actions/collect-e2e-artifacts/action.yml (1 hunks)
  • .github/actions/setup-e2e/action.yml (1 hunks)
  • .github/workflows/ci-repo.yml (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/actions/collect-e2e-artifacts/action.yml
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Build (windows)
  • GitHub Check: Build (linux)
  • GitHub Check: Build (macos)
🔇 Additional comments (6)
.github/workflows/ci-repo.yml (2)

218-245: Refactor to composite actions improves modularity and maintainability. The centralization of E2E setup logic and artifact collection into reusable actions is a solid improvement for code organization.


247-282: Label-driven conditional E2E test job is well-structured. The test-custom-binary job properly uses the conditional label check and integrates correctly with the setup-e2e action outputs for VSIX paths.

.github/actions/setup-e2e/action.yml (4)

1-31: Action metadata is well-structured with appropriate input/output definitions.


33-61: VSCode and Java setup steps are correct and follow best practices.


97-115: Verification and artifact setup logic is sound.


116-155: VSIX discovery and validation logic is sound, with appropriate error handling.

The glob pattern approach works well for this context. The explicit validation and detailed error messages (including directory listing on failure) make debugging straightforward.

@djzager djzager force-pushed the mo-tests-mo-problems branch from 6c4c2fa to 281e3b9 Compare November 6, 2025 18:46
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6c4c2fa and 281e3b9.

📒 Files selected for processing (3)
  • .github/actions/collect-e2e-artifacts/action.yml (1 hunks)
  • .github/actions/setup-e2e/action.yml (1 hunks)
  • .github/workflows/ci-repo.yml (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • .github/actions/collect-e2e-artifacts/action.yml
  • .github/actions/setup-e2e/action.yml
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Lint
🔇 Additional comments (2)
.github/workflows/ci-repo.yml (2)

218-246: Approve test-e2e job refactoring to use composite actions.

The refactoring to use the setup-e2e composite action and the new artifact collection action is clean. Output references (steps.setup.outputs.core-vsix, steps.setup.outputs.java-vsix) are consistent across steps, and the artifact collection maintains the if: always() pattern for reliability.


247-283: Approve test-custom-binary job structure and conditional logic.

The new job is well-structured:

  • The condition on line 253 correctly gates execution to labeled PRs: if: github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'test/custom-binary')
  • Reuses the established setup and artifact collection actions for consistency
  • The additional asset collection step (lines 262-268) for custom binary test dependencies is appropriately isolated

Comment thread .github/workflows/ci-repo.yml Outdated
Separate files makes it cleaner

Signed-off-by: David Zager <[email protected]>
@djzager djzager force-pushed the mo-tests-mo-problems branch from 281e3b9 to 0c72c4e Compare November 6, 2025 19:20
@djzager
Copy link
Copy Markdown
Member Author

djzager commented Dec 18, 2025

Never worked quite how I had in mind.

@djzager djzager closed this Dec 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant