-
Notifications
You must be signed in to change notification settings - Fork 0
Closed
Labels
P1-highHigh priorityHigh priorityarea/ci-cdCI/CD workflow generationCI/CD workflow generationbugSomething isn't workingSomething isn't working
Description
Overview
Two bugs in platform resolution in WorkflowGenerator._buildContext():
Bug 1: Duplicate platforms produce duplicate runner labels
File: lib/src/cli/utils/workflow_generator.dart line 101
platforms: ["macos", "macos-arm64"] both map to macos-latest in _platformRunners, producing ["macos-latest","macos-latest"] in the matrix JSON. GitHub Actions runs both, wasting CI minutes on identical jobs.
Fix: Deduplicate after runner resolution:
final resolvedRunners = platforms.map((p) => _platformRunners[p]!).toSet().toList();Bug 2: cast<String>() throws TypeError on non-string elements
File: lib/src/cli/utils/workflow_generator.dart line 101
final platforms = platformsRaw.cast<String>().where(...).toList();cast<String>() returns a lazy view that throws TypeError during iteration if a non-string element exists (e.g., [123, "ubuntu"]). The sub_packages handling on line 124-125 already uses whereType correctly — this is inconsistent.
Fix: Replace cast<String>() with whereType<String>():
final platforms = platformsRaw.whereType<String>().where((p) => _platformRunners.containsKey(p)).toList();Acceptance Criteria
- Runner labels are deduplicated after platform → runner mapping
-
validate()warns when duplicate effective runners would result - Non-string platform values are safely filtered (not crash)
- Tests added covering both edge cases
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
P1-highHigh priorityHigh priorityarea/ci-cdCI/CD workflow generationCI/CD workflow generationbugSomething isn't workingSomething isn't working