Skip to content

Handle required tasks data more consistently#1672

Draft
simonbaird wants to merge 1 commit intoconforma:mainfrom
simonbaird:top-level-rule-data
Draft

Handle required tasks data more consistently#1672
simonbaird wants to merge 1 commit intoconforma:mainfrom
simonbaird:top-level-rule-data

Conversation

@simonbaird
Copy link
Copy Markdown
Member

@simonbaird simonbaird commented Feb 23, 2026

I think we should move data["pipeline-required-tasks"] to data.rule_data["pipeline-required-tasks"], which means this won't be needed any more, but this change should make it easier to transition I guess.

@simonbaird simonbaird force-pushed the top-level-rule-data branch 3 times, most recently from 359adb1 to db3c358 Compare February 23, 2026 23:14
@codecov
Copy link
Copy Markdown

codecov bot commented Feb 23, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

Files with missing lines Coverage Δ
policy/lib/rule_data.rego 100.00% <100.00%> (ø)
policy/lib/rule_data_test.rego 100.00% <100.00%> (ø)
policy/lib/tekton/pipeline.rego 100.00% <100.00%> (ø)
policy/lib/tekton/task.rego 100.00% <100.00%> (ø)
policy/release/tasks/tasks.rego 100.00% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment on lines +167 to +170
# Special handling for "pipeline-required-tasks" and "required-tasks" since they
# were placed at the top level historically. Note that we can't use data[key_name]
# since it evaluates at run-time and we get a recursion error because `data`
# includes this (and all) code, which tries to evaluate `data`, and so on.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

IIUC this test case is for retrocompatibility, but the new policy configs have these keys under data.rule_data, correct?

Maybe we could add a deprecation warning so users can update their configs and we can clean this up sometime in the future?

@st3penta
Copy link
Copy Markdown
Contributor

(i didn't want to request any changes 😅 i just wanted to leave the comment)

@Acepresso
Copy link
Copy Markdown
Contributor

LGTM, and it also aligns with the spirit of the lib data top level cleanup (https://issues.redhat.com/browse/EC-1651)

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.

3 participants