Merged
Conversation
2115537 to
33551f6
Compare
bwplotka
requested changes
Jul 12, 2021
Owner
bwplotka
left a comment
There was a problem hiding this comment.
I think it's .... too smart. Too smart for me 🙈
Some comments (: I think we talked about something different in 1:1.
But good direction! (:
| // GitHub repo token to avoid getting rate limited. | ||
| Token string `yaml:"token"` | ||
| // Validators to be used alongside githubPullsIssues. | ||
| NPIValidators []NonPullsIssuesValidator `yaml:"nonPullsIssuesValidators"` |
Owner
There was a problem hiding this comment.
hmmm, I am not fan of this approach...
Reasons:
- We are leaking GH special flow. It's actually quite surprise to guess what is the logic here
- If you regex only fo pulls or issues how other links even get there? In your example I would expect only pulls and issues being matched here so nonXYZ thing will never get called (at least that's my perception)
- regex: '(^http[s]?:\/\/)(www\.)?(gitlab\.com\/)thanos-io\/thanos(\/pull\/|\/issues\/)'
type: 'githubPullsIssues'
nonPullsIssuesValidators:
- regex: '(^http[s]?:\/\/)(www\.)?(github\.com\/)thanos-io\/thanos(\/releases\/tag\/)'
- regex: '(^http[s]?:\/\/)(www\.)?(github\.com\/)thanos-io\/thanos(\/blob\/)'
- regex: '(^http[s]?:\/\/)(www\.)?(github\.com\/)thanos-io\/thanos(\/commit\/)'```
Do we need this. Why not simple approach of regexing pull and issues only (and erroring out when user passes non issue or non PR) then use ignore type to ignore further stuff? 🤔
Collaborator
Author
There was a problem hiding this comment.
Yes, I was kind of mixing nested validators + pullsIssues which on second thought might make things super confusing 😅. ignore would be sufficient for the nonPullsIssues thing. Will remove this and just have githubPullsIssues. So example config would be,
- regex: '(^http[s]?:\/\/)(www\.)?(gitlab\.com\/)thanos-io\/thanos(\/pull\/|\/issues\/)'
type: 'githubPullsIssues'
- regex: '(^http[s]?:\/\/)(www\.)?(github\.com\/)thanos-io\/thanos(\/releases\/tag\/)'
type: 'ignore'
Signed-off-by: Saswata Mukherjee <saswataminsta@yahoo.com>
33551f6 to
de8f477
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR makes the special
githubvalidator smarter. This renamesgithubvalidator togithubPullsIssues. (As discussed in 1:1.)Configuration will now look like,
This also avoids surprises by asking users to provide the correct regex so that
mdoxdoes not have to create it.In case of faulty regex, below errors are shown,
For
githubPullsIssues,