Make the task expiry message customizable#1156
Conversation
| # failure_msg: >- | ||
| # Task %q is used by pipeline task %q is or will be unsupported as of %s. | ||
| # solution: >- | ||
| # Upgrade to a newer version of the Task. |
There was a problem hiding this comment.
Not sure how important it is for the solution to be in solution rather than in failure_msg. I can look into making the solution template-able, but I would need some help with that
| test_expired_with_custom_message if { | ||
| attestation := _slsav1_attestations_with_tasks({}, [object.union( | ||
| _task("task"), | ||
| {"invocation": {"environment": {"annotations": { | ||
| tasks._expires_on_annotation: "2000-01-01T00:00:00Z", | ||
| tasks._expiry_msg_annotation: "The Task has been discontinued.", |
There was a problem hiding this comment.
I noticed the other test case is kinda quadrupled - [slsav0_2, slsav1] X [already expired, expires in the future]
It didn't seem necessary to cover the expiry message for all 4 cases, but LMK if that's incorrect
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1156 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 117 117
Lines 6042 6053 +11
=========================================
+ Hits 6042 6053 +11
|
|
Some linting failures. Add the comment |
8e81183 to
5b4cc49
Compare
|
Now it's saying there are uncommitted changes, but I'm not sure what they are |
|
Along with the expires-on annotation, Task authors can optionally define the expiry-message annotation to override the default expiry message. The default is still "Upgrade to a newer version of the Task." This required moving the 'solution' part of the rule into the 'failure_msg' instead, because 'solution' does not support templating. Signed-off-by: Adam Cmiel <acmiel@redhat.com>
5b4cc49 to
d341d72
Compare
Note: this came from an internal Slack conversation about how to distinguish between "task is deprecated because we only maintain the newer version" and "task is discontinued". Somewhat related to konflux-ci/build-definitions#1471 (comment)
Along with the expires-on annotation, Task authors can optionally define the expiry-message annotation to override the default expiry message. The default is still "Upgrade to a newer version of the Task."
This required moving the 'solution' part of the rule into the 'failure_msg' instead, because 'solution' does not support templating.