Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add path based rules and pester tests #3182

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

hallipr
Copy link
Member

@hallipr hallipr commented Apr 16, 2024

fixes #3181

eng/common/pipelines/ci.yml Show resolved Hide resolved
foreach ($rule in $pathBasedRules.Keys) {
foreach ($rulePath in $pathBasedRules[$rule]) {
if ($runAll -or $root.PathExists($rulePath)) {
$variables += $rule
Copy link
Member

Choose a reason for hiding this comment

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

what happens if you have 2 paths for the same variable? Would we set that variable twice?

Copy link
Member Author

Choose a reason for hiding this comment

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

The break; below pops us out of the "path" forEach back into the "rule" forEach. So we should only add a rule name once after we find the first matching path for the rule

Copy link
Member Author

Choose a reason for hiding this comment

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

The rule name is the variable name, so we wouldn't have 2 rules with the same variable name

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add execution of unit tests if they get changed
3 participants