← Back to Pull requests

feat: add Software Catalog deploy-to-fleet E2E test #28

Merged
talhil-rh merged 5 files (237 lines) on Jun 15, 2026 14:21 UTC
View on GitHub
talhil-rh talhil-rh commented on Jun 12, 2026 01:45 UTC
Author

Adds a new softwareCatalogPage.cy.js spec that:

  • Spins up 5 simulated devices on scale-fleet-01 via the device simulator

  • Navigates to the Software Catalog, selects the catalog item published by the build-image test, and deploys it to the simulator fleet through the 3-step wizard (Specifications → Select fleet → Review and deploy)

  • Verifies the "Update configuration successful" message and confirms the deployed catalog item appears under "Deployed Software" in the fleet's Catalog tab
  • Also extends scaleFleetSimulatorStart to accept optional count/label/ initialDeviceIndex params (non-breaking; existing tests pass no args), adds a buildName cypress env var, and introduces the softwareCatalogPage page object.

    Diff: 237 lines (+232 / -5) across 5 files Reviewer: talhil-rh Review duration: 5076m
    All Vouch review confidence checks passed
    Residual risk 0.14 = Change Risk (0.79) × (1 − Review Confidence (0.83)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.79 · 237 lines diff across 5 files
    0.79
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.92 · 3 substantive comment(s)
    0.92
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    82%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.327
    Self Review self_review
    0.140
    Sensitive Paths sensitive_paths
    0.079
    Real PR Conversation Timeline
    5 items
    talhil-rh talhil-rh commented on code on Jun 12, 2026 01:48 UTC
    Code Review
    cypress/cypress.config.js:1
    @@ -43,6 +43,10 @@ module.exports = defineConfig({
         yaml: process.env.YAML || '/demos/basic-nginx-demo/deployment/fleet.yaml',
         newyaml: process.env.NEWYAML || '/demos/quadlet-wordpress-demo/deployment/fleet.yaml',
         repositoryname: process.env.REPOSITORYNAME || 'test-repository',
    +    buildName: process.env.BUILD_NAME || 'new-build-flightctl',
    +    // Set to true (CYPRESS_SKIP_SIMULATOR=true) when running the device simulator manually.
    +    // Skips all simulator start/stop/wait/cleanup tasks in softwareCatalogPage.cy.js.
    +    skipSimulator: process.env.CYPRESS_SKIP_SIMULATOR === 'true' || false,

    LOW: The || false is redundant — === 'true' already evaluates to a boolean (true or false). Not a bug, just unnecessary noise.

        skipSimulator: process.env.CYPRESS_SKIP_SIMULATOR === 'true',
    

    talhil-rh talhil-rh commented on code on Jun 12, 2026 01:48 UTC
    Code Review
    cypress/plugins/scaleFleetSimulatorTasks.js:1
    @@ -82,7 +82,7 @@ function registerScaleFleetSimulatorTasks(on) {
          * Spawns the device simulator with fixed scale-demo arguments (50 devices, fleet label, concurrency 1).

    LOW: This JSDoc is now stale — the function accepts configurable count, label, and initialDeviceIndex params (no longer "fixed").

         * Spawns the device simulator. Accepts optional count (default 50), label, and initialDeviceIndex parameters.
         * If a simulator child is already running, returns `{ alreadyRunning: true }` instead of starting another.
    

    talhil-rh talhil-rh commented on code on Jun 12, 2026 01:48 UTC
    Code Review
    cypress/views/softwareCatalogPage.js:1
    @@ -0,0 +1,96 @@
    +import { common } from './common'
    +
    +/** Fleet used by the software-catalog simulator run */
    +export const CATALOG_FLEET_NAME = 'simulator-disk-monitoring'
    +export const CATALOG_FLEET_LABEL_TEXT = `fleet=${CATALOG_FLEET_NAME}`
    +
    +/**
    + * Resolves the catalog item name created by the build-image test.
    + * Matches the convention in buildImagePage.cy.js: `${BUILD_NAME}-cin`.
    + */
    +export const getCatalogItemName = () => {
    +  const buildName = Cypress.env('buildName') || 'new-build-flightctl'

    MEDIUM (follow-up item): buildImagePage.cy.js hardcodes const BUILD_NAME = 'new-build-flightctl' instead of reading Cypress.env('buildName'). If someone overrides BUILD_NAME=custom, this function will look for custom-cin but the build test will have created new-build-flightctl-cin. Consider aligning buildImagePage.cy.js to also use the env var in a follow-up PR.

    talhil-rh talhil-rh commented on Jun 12, 2026 01:48 UTC
    Reviewer

    🤖 AI Code Review — PR #28

    Verdict: ✅ APPROVE (with minor suggestions)

    _Note: Cannot submit as formal GitHub approval since the PR author and reviewer token belong to the same user. Verdict is APPROVE._

    | Severity | Count |
    |----------|-------|
    | Critical | 0 |
    | High | 0 |
    | Medium | 1 |
    | Low | 2 |

    Gate Checks


    ✅ PR Description — thorough, explains what the test does and documents all changes
    ✅ CI Status — no CI checks configured on this repo
    ✅ Single Concern — adds one new E2E test with supporting page object and a non-breaking helper extension
    ✅ Reasonable Scope — 231 additions across 4 files, well within limits
    ✅ No Secrets — clean
    ✅ Not a Draft

    Medium Issues

  • Cross-test buildName config gap — The new buildName env var (cypress.config.js:46) is used in softwareCatalogPage.js:12 via Cypress.env('buildName'), but buildImagePage.cy.js:4 still hardcodes const BUILD_NAME = 'new-build-flightctl'. If someone overrides BUILD_NAME=custom, the catalog test will look for custom-cin while the build test created new-build-flightctl-cin. Consider updating buildImagePage.cy.js to also use Cypress.env('buildName') in a follow-up.
  • Low Issues

  • cypress/cypress.config.js:49 — || false is redundant since === 'true' already returns a boolean. Harmless but unnecessary.

  • cypress/plugins/scaleFleetSimulatorTasks.js:82 — JSDoc still says "fixed scale-demo arguments (50 devices, fleet label, concurrency 1)" but the function now accepts configurable count, label, and initialDeviceIndex parameters. Update the comment to reflect the new signature.
  • What's Good

  • Clean page-object pattern consistent with existing buildImagePage.js, fleetsPage.js, etc.

  • Good JSDoc comments explaining PatternFly DOM structure and selector rationale

  • skipSimulator toggle is well-designed — allows manual simulator runs during development

  • Non-breaking scaleFleetSimulatorStart parameter extension with sensible defaults

  • Appropriate timeouts (330s Cypress task timeout to cover 300s device wait + settle)

  • Single commit, clear description, single concern — easy to review
  • Recommendation

    Good to merge as-is. The buildName config gap is a minor follow-up item and doesn't affect the default flow.

    Reviewers
    Assignees
    talhil-rh talhil-rh
    Labels
    risk: low confidence: 82.8% reviewed sensitive_module
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 78.8% (HIGH) · Higher = larger blast radius
    78.8%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 82.8% · Lower = rushed or shallow review
    82.8%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 13.6% · Safe to merge
    13.6%