fix: Standardize RunOnLinuxOnly attribute usage in build modules#1734
Conversation
Fixed inconsistent attribute naming where ChangedFilesInPullRequestModule used
[RunOnLinux] while all other build modules used [RunOnLinuxOnly]. Since the
module should only run on Linux (mandatory condition), updated to use
RunOnLinuxOnly for consistency and correct semantics.
Also updated documentation to clarify the difference between:
- RunOn{OS} (OR logic - any matching condition allows run)
- RunOn{OS}Only (AND/mandatory logic - condition must be met)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
SummaryThis PR fixes inconsistent run condition attribute usage by changing Critical IssuesNone found ✅ SuggestionsDocumentation Enhancement: The new documentation section correctly explains the In docs/docs/how-to/run-conditions.md:47-57, consider adding a brief note explaining that Example addition after line 46: **Note**: The `*Only` variants use mandatory condition logic (AND) - if you combine `[RunOnLinuxOnly]` with other mandatory conditions, ALL must return true. This differs from the non-`Only` variants which use OR logic.This is optional but would strengthen the conceptual link between the two sections of the documentation. Verification✅ Consistency verified: All other build modules use
✅ Semantic correctness: The module calls ✅ Implementation verified: Confirmed that:
Verdict✅ APPROVE - No critical issues. The change improves consistency and the documentation addition is helpful. |
There was a problem hiding this comment.
Pull request overview
This PR standardizes the usage of the RunOnLinuxOnly attribute across build modules to ensure consistency. The PR addresses an inconsistency where ChangedFilesInPullRequestModule was using [RunOnLinux] (OR logic) instead of [RunOnLinuxOnly] (AND logic/mandatory) like all other build modules.
Key changes:
- Updated
ChangedFilesInPullRequestModuleto use[RunOnLinuxOnly]instead of[RunOnLinux] - Added documentation for the
*Onlyvariants of OS condition attributes (RunOnLinuxOnly, RunOnWindowsOnly, RunOnMacOSOnly)
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/ModularPipelines.Build/Modules/ChangedFilesInPullRequestModule.cs | Changed attribute from [RunOnLinux] to [RunOnLinuxOnly] for consistency with other build modules |
| docs/docs/how-to/run-conditions.md | Added documentation explaining the *Only variants for mandatory OS-specific run conditions with examples |
Summary
Fixes #1528 - Inconsistent naming RunOnLinux vs RunOnLinuxOnly attributes
Investigation findings:
RunOnLinuxandRunOnLinuxOnlyare different attributes with different semantics:RunOnLinuxinherits fromRunConditionAttribute(OR logic - module runs if ANY condition is met)RunOnLinuxOnlyinherits fromMandatoryRunConditionAttribute(AND logic - ALL conditions must be met)Issue:
ChangedFilesInPullRequestModuleused[RunOnLinux]while all other build modules used[RunOnLinuxOnly]Changes:
ChangedFilesInPullRequestModuleto use[RunOnLinuxOnly]for consistency*Onlyvariants in the run-conditions documentationTest plan
🤖 Generated with Claude Code