-
Notifications
You must be signed in to change notification settings - Fork 53
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
Changed files includes excluded paths #1465
Comments
@BernieWhite wanted to search for related issues before posting this, then I saw this issue is marked for v3. So, just curious if this is modified in the anticipated v3?: I am trying to implement input.ignoreUnchangedPath and repository.baseRef The goal is to get fast PRs, that are not blocked due to "irrelevant" changes, but still keep up to date on changes to our baselines. I have tried setting ps-rule.yaml as per my description above, but also tried setting ignoreUnchangedPath as an env var, but that still caused all files to be scanned. I did not set the baseRef as I suspect you pick it up based on variables as per the docs mentioning it (docs doesnt mention which variable it look for though which would be great). So all in all: Am I trying to do something that is not supported? am I getting something wrong? Are there bugs relating to inheritence of values based on env vars and .yaml files? (We are seeing problems merging hashtables and yaml files, but that is a separate issue(. There seems to be a lot of modifications coming with v3, so I am hesitant to spend time fixing on v2 (ETA on v3?) :-) |
Thanks @ReneRebsdorf. It's not planned for v3.0.0, which we're trying to finalize. The issue don't have any priority currently, however we can look to slot it in for v3.1.0 or v3.2.0 if it's customer impacting. To help clarify this issue, only changed files are processed by PSRule as expected but the bug is: files that have changes but would normally be excluded by For your issue a key thing to check would be to make sure the full git history is fetched (noticing that this is not in the docs and the example in the docs is omits this). It's required to compare branches, because shallow fetching is the default. For ADO you need to use the # Checkout the repository
- checkout: self
fetchDepth: 0 Let me know if that doesn't solve the issue, and we can raise a separate issue, but I'll add an item to fix that omission in the docs. Thanks. |
@BernieWhite We use fetch depth in other stages, so not sure why I didn't think of using 0 here, which is obviously required 😊 Just to see clarification: would I get full scanning on main and only change file scanning on Prs, if I set both options in the yaml file directly, or should I use environment variables? And are yaml+env vars supported simultaneously? |
@ReneRebsdorf PSRule supports environment variables and YAML together (for almost all options). The environment variable overrides the YAML setting if the settings conflict. So, you should use the For full builds you should not set this option or set the option to An easy option for most cases like you have suggested is to omit the option from the But if you wanted developers to be able to run checks against their branch locally with only changes files then it might be better to do the reverse, since PSRule in VSCode will use ps-rule.yaml and setting local environment variables on a dev machine is additional setup. |
Thanks! Yeah I think I will setup local files to assume to only test pr changes, and then use a variable in the Ci pipeline to control overwriting with an env var. |
Description of the issue
Changes files (with
Input.IgnoreUnchangedPath
) does not seem to be honouringInput.PathIgnore
.The text was updated successfully, but these errors were encountered: