Skip to content

feat: support multiple build task types in pipeline label selector - #182

Closed
robnester-rh wants to merge 6 commits into
mainfrom
EC-1763
Closed

feat: support multiple build task types in pipeline label selector#182
robnester-rh wants to merge 6 commits into
mainfrom
EC-1763

Conversation

@robnester-rh

Copy link
Copy Markdown
Owner

Summary

  • Renames pipeline_label_selector to pipeline_label_selectors, returning a set of build type strings instead of a single string
  • Adds _merged_required_task_list helper that resolves time-based entries independently per build type, unions the task sets, and uses max(effective_on) across types
  • Adapts required_task_list for backward compatibility with downstream boolean existence checks
  • Silently skips build types that don't exist in pipeline-required-tasks data

Fixes EC-1763: The pipeline_label_selector function failed when a pipeline had multiple build tasks with different build_type labels (e.g. docker and tkn-bundle), causing required task validation to be silently skipped.

The max(effective_on) across types is a known conservative approximation — EC-1798 tracks the follow-up to migrate to per-task effective_on resolution.

Test plan

  • All 825 existing tests pass (including downstream consumers in tasks.rego and required_tasks.rego)
  • 100% line coverage on changed file
  • New test: multi-build-type selector returns set of all types
  • New test: required task union deduplicates across types with max(effective_on)
  • New test: missing build type in data is silently skipped
  • New test: all build types missing → required_task_list undefined (falls through to defaults)
  • New test: current_required_pipeline_tasks with most_current mode excludes future entries
  • New test: single-type backward compatibility through new code path
  • New test: multiple time entries per type resolved independently
  • New test: required_task_list raw concatenation for boolean existence check
  • make quiet-test opa-check fmt-check all pass

🤖 Generated with Claude Code

robnester-rh and others added 6 commits May 1, 2026 12:41
Rename pipeline_label_selector to pipeline_label_selectors returning a
set of build types. Add _merged_required_task_list helper that resolves
time-based entries independently per build type, then unions the task
lists with max(effective_on).

Fixes: EC-1763
Covers multi-type selector, required task union, missing type
in data (silently skipped), and all types missing.
Part of EC-1763.
The refactored pipeline_label_selectors uses set comprehensions
directly instead of sets.to_set(), making the import unnecessary.

Part of EC-1763.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Fix inaccurate "unions" comment to "concatenates"
- Restore inline FBC comment on not is_fbc guards
- Add test for current_required_pipeline_tasks (most_current mode)
- Add test for required_task_list multi-type concatenation
- Add test for single-type backward compatibility
- Add test for multiple time entries per type
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The merged task list should deduplicate tasks that appear in multiple
build types (e.g. clair-scan required by both docker and tkn-bundle).
Changed _merged_required_task_list to use a set comprehension for
all_tasks instead of an array comprehension.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant