-
Notifications
You must be signed in to change notification settings - Fork 48
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
Option to disable Check if a GitHub owner is in a given organization #73
Comments
Hi @Nuru I can add opt to disable that e.g. Sometimes, I see that people introduce With Example 1:Global option to document excluded/ignored rules. # config.yaml
# Option to ignore known and accepted issues that are detected by checks
issues:
# Excluding checks per-text
exclude-rules:
# Exclude per-text message. Exact match.
- text: 'Team "not-existing-team" does not exist in organization "gh-codeowners"'
checks:
- owner
# Exclude per-text message. Regex match. In that way u exclude organization check completely for any team
- regex: 'Team ".*" does not exist in organization "gh-codeowners"'
checks:
- owner Pros:
Cons:
Example 2:Check-scoped option to document excluded/ignored rules. # config.yaml
# all available settings of specific linters
checks-settings:
owner:
# The owner and repository name separated by slash. Used to check if GitHub owner is in the given organization.
# (required)
repository: "gh-codeowners/codeowners-samples"
# Excluding configuration
exclude-rules: # support excluded only for some users so outside collaborators are not check but the rest are validated
# excluded for all as no owners provided
- rule: valid-definition
- rule: has-github-account
- rule: team-exists
# excluded only for a given owners
- rule: is-in-organization
owners:
- @owner1
- @owner2
- @owner3 Pros:
Cons:
At the moment I am leaning towards the first option as it will be easier to implement and ootb it's more generic. Is it ok with you guys? /cc @Nuru @osterman @nitrocode |
I appreciate all the time you put into these examples. As for example 2, we currently ignore each individual using the If we're going with either solution, I'd favor example 1 as that will eliminate the need to maintain a list of ignored users. Like you mentioned, if the message changes, then the exception breaks. However, I'm not too concerned about that as 1) that message probably doesn't change often and 2) we would notice immediately if the PR failed for the updated text and would update the exclusion text accordingly. |
@mszostok You are right that people will want to disable other sub-checks. If you look at other "linters" you will see that in general they give some kind of name/label/key to every single check at the finest possible detail level (such that there is no such thing as a "sub-check") and then allow people to enable or disable them one by one. Usually you can say "run all except these" or "run only these". See mega-linter and rubocop for just 2 examples. These linters have been around a long time and have much guidance to offer about how to structure the configuration of a linter such as So I suggest you start there. You do not need to restructure the code that implements the tests, just expand the list of options to cover every test. |
Description
Please provide an option to disable only the "Check if a GitHub owner is in a given organization" part of the Valid Owner Checker.
Reasons
I frequently work in repos that have an outside collaborator as a Code Owner (sometimes it is me). I would like to be able to keep the other checks in the Valid Owner Checker active and disable only the "Check if a GitHub owner is in a given organization" part. It is excessive to completely disable all checks for outside collaborators.
The text was updated successfully, but these errors were encountered: