Cake Frosting WithCriteria Description
- Dominant language
- C#
- Stars
- 4.2k
- Forks
- 778
- Avg merge
- 1h 15m
- Merged PRs (30d)
- 19
Description
### Prerequisites
- [x] I have written a descriptive issue title
- [x] I have searched [issues](https://github.com/cake-build/cake/issues) to ensure it has not already been reported
### Cake runner
Cake Frosting
### Cake version
5.0
### Operating system
Windows
### Operating system architecture
x64
### CI Server
_No response_
### What are you seeing?
The fix implemented in #4027 does not seem to work as implemented. The SkippedMessage property was added to IFrostingTask and it was also implemented there to return an empty string. IFrostingTask is implemented in FrostingTask but it has nothing in there to allow you to change the SkippedMessage property. This is the only level where you can change the SkippedMessage property and have it picked up when trying to reference it using IFrostingTask. I added a SkippedMessage property to my CleanTask I was creating and the message was not used when the following is called in FrostingEngine
```
// Is the criteria method overridden?
if (task.IsShouldRunOverridden(_context))
{
cakeTask.WithCriteria(task.ShouldRun, task.SkippedMessage);
}
```
I made a small test project to verify this. Unless I am missing something I think this needs changed.
### What is expected?
Want to be able to set the skipped message for the WithCriteria like you can when using Cake Tool.
### Steps to Reproduce
Just try to set the SkippedMessage so it can be used when using the ShouldRun override.
### Output log
No error log to show the message does not show up.
Contributor guide
Research direction
Trace SkippedMessage from IFrostingTask through FrostingTask and into FrostingEngine, focusing on the WithCriteria call shown in the issue. Reproduce the behavior with a Cake Frosting task that overrides ShouldRun and sets SkippedMessage, then verify that the configured message is used rather than an empty value.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- build-system, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100