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.
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
Assigns labels based on branch names #203
Assigns labels based on branch names #203
Changes from 21 commits
2bf42e4
ad73546
6c50d09
ee0e0eb
a01b9ae
bce88a9
765934f
827e118
8aa7614
cb5f448
2ced1f3
d9ed3e8
79c0cc7
27a1d89
7624214
2d63815
ab49f7a
2246b66
89f6b77
7aadc17
71fc664
818399d
6e27606
0ad789c
0861fa5
4c74e84
7f8d8e4
c54c5a2
7b1327b
8c59ecc
f2b2513
2343710
cd3a8df
0b6e68d
2daf35a
231de6b
922ffdf
7a5c525
969899d
7d17531
b071d82
0eb9d49
09f0853
ed31b27
da83a18
56347d5
8943ca2
e5b1bdd
2e10ffb
2a5bc55
394a01b
5e6bdf6
84e83a9
f40b387
90ef370
3eec5d8
fc5eb71
e4486e9
e939550
51b763c
c08f5fa
9f259ee
1ce9b35
ef108a9
a988f4e
3af9a47
c31ee1f
17694aa
e9a1777
65b7640
7741e57
64ce5e9
cc1e025
d0d3628
92990c0
d31255f
b25e3a8
1c9c27e
8e6367d
9bfc999
5d0a66e
e51b118
a9e07ce
3bec922
432b275
4967646
4554c0d
5ac9519
ef6ab1b
62f22bd
0b2cfb0
29382eb
fa7f98c
210043e
938f9c9
3ddce51
4be192c
67604ee
b1a2f85
2f1dfd1
7f169bc
d4d4a10
2637d23
c1b0ca7
2a3422a
13e75b4
68a2598
11812c3
9488def
3aa0d43
9cfddd0
51cc5e0
09645fd
34a5bf6
4ac1764
a5bed11
a256a58
57d3407
3352df1
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At the moment, the new field name in the yaml config file (
branch
) is not specific. We should make it more concrete so that there is no confusion and users can understand what type of branch is meant. How aboutheadBranch
?There is a feature request in the repository to add similar functionality, but for base branches. It would be great if you could add this in scope of your PR. I think we can reuse some logic that was introduced by you.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At the moment, the new field (
branch
) is on the same level as the patterns for changed files. The current structure of the configuration file looks like this:Potentially, more new fields will be added in the future and such a structure will become non-obvious, non-intuitive. I think we should introduce a new field for changed files as well:
This will be a breaking change, but we're going to release a new major version anyway to fix the bug related to the
sync-labels
input. We can include both changes in the new major release.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting so to follow up from your previous comment the we would actually wanna change this to the following:
So that we could add another level for
base-branch
in the future?🤔 Or in the way that
changed-files
can haveany
andall
we keep that level calledbranch
as you suggest here and then addhead
andbase
options to that. So the config might end up looking like this:I like that idea 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small follow up question to that - what would we want the defaults to be in the case that these nested options are not provided?
eg.
Currently it defaults to match
any
file that has changed, would we still want to keep that as it is or adjust it? Based on how things are currently I guess it might be something like this:There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In my understanding, the final structure should look like this:
We may want to expand branch settings, for example the base and/or head branches can have
include
orexclude
options, so I expect them to be separate fields so that we can avoid deep nesting:Regarding your question about omitting nested options - I think we should adhere the following approach:
label 1
- throw an error, because it is not obvious what these patterns are related to, what exactly the user meant.label 2
- matches any file that has changed, as you mentionedlabel 3
- Separating the branches, as I suggested, would simplify the logic:There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would having include and exclude options more not come from the pattern that you pass? Regardless avoiding deeply nested objects makes sense for now so I'll start on adding that functionality 👍