-
-
Notifications
You must be signed in to change notification settings - Fork 849
Fix unlabeled, mixed labels, and unmapped labels handling #618
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
Fix unlabeled, mixed labels, and unmapped labels handling #618
Conversation
hunner
commented
Jan 27, 2018
•
edited
Loading
edited
- Issues/PRs filtered by --exclude-labels/--include-labels should never be added to sections.
- Issues/PRs with labels mapping to multiple sections should map to default sections order of breaking, then enhancement, then fix.
- Issues/PRs with labels mapping to multiple sections should map to default sections then the first-matching section in --add-sections.
- Issues/PRs with labels mapping to multiple sections should map to the first-matching section in --configure-sections.
- Issues/PRs with some mapped labels and some unmapped labels should respect the mapping rather than behaving like unmapped issues.
- Issues/PRs with only unmapped labels should be added to the --merge-prefix/--issue-prefix section.
- Issues/PRs with no labels should be added to the --merge-prefix/--issue-prefix section unless --add-pr-wo-labels/--add-issues-wo-labels is false.
- Filter both PRs and issues equally.
Good work! Fine analysis and useful in-code “why comments” in tricky places. Thank you for bringing this to the project! I’ll watch this closely. |
1ca4fa4
to
aa3744c
Compare
d0cb917
to
9fe947b
Compare
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.
\o/
github_site = @options[:github_site] || "https://github.com" | ||
project_url = "#{github_site}/#{@options[:user]}/#{@options[:project]}" | ||
|
||
set_sections_and_maps | ||
create_sections |
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.
is it worth changing this method name to generate_sections
? it would match better with everything around it.
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.
Reading the code, my personal take is “create_” reads easier.
We could move to that naming instead? But to me, that’s not a merge blocker for this change.
Thanks for keeping sharp eyes on This developing PR, @eputnam!
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.
This method is about filling the @sections
array with the Section.new
objects to be filled out later on. I tried to make any generate_*
methods be ones that return generated string content for the changelog.
body += merged_section_to_log(pull_requests) if @options[:pulls] && @options[:add_pr_wo_labels] | ||
body | ||
sort_into_sections(pull_requests, issues) | ||
@sections.map(&:generate_content).join |
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.
i just learned what Array.map(&:foo)
does. slick!
9fe947b
to
91157bb
Compare
I think this is ready to go. It'd be nice if there were rubocop rules to catch missing |
There is a little gem called yard-junk you can run to check your work. It has that goal.
The output it makes is more helpful in finding wrong docblocks, though. Perhaps not the exact tool you asked for.
…
|
Thanks! I'll check it out. |
@hunner If there are any YARD improvements to be made, they're not a blocker to merging, if you feel this is ready for merge. |
- Issues/PRs filtered by --exclude-labels/--include-labels should never be added to sections. - Issues/PRs with labels mapping to multiple sections should map to default sections order of breaking, then enhancement, then fix. - Issues/PRs with labels mapping to multiple sections should map to default sections then the first-matching section in --add-sections. - Issues/PRs with labels mapping to multiple sections should map to the first-matching section in --configure-sections. - Issues/PRs with some mapped labels and some unmapped labels should respect the mapping rather than behaving like unmapped issues. - Issues/PRs with only unmapped labels should be added to the --merge-prefix/--issue-prefix section. - Issues/PRs with no labels should be added to the --merge-prefix/--issue-prefix section unless --add-pr-wo-labels/--add-issues-wo-labels is false. - Filter both PRs and issues equally.
91157bb
to
1c4ef5e
Compare
I added a few yard fixes pointed out by yard-junk just now, though not all of them were from these changes. I'm not sure this is an enhancement. The command line arguments affected ( This change could be compared to v1.14.3 since 1.15.0 hasn't been finalized yet. It seems that #530 ( You could could call this a feature if the handling of unlabeled PRs and PRs with unmapped labels is the feature that this implements, perhaps? Though without adding any arguments to do so it's arguable that this behavior was just undefined and is now being defined (which is a bugfix). |
One change that I see this PR makes is that if Since |
That behavior should be configured by --add-issues-wo-labels and --add-pr-wo-labels
0a0d975
to
69ca16b
Compare
I think this is good to go! |
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.
LGTM!
@hunner Thank you! |