Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fixing bug when filtering pull requests without labels#771

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation

douglasmiller
Copy link
Contributor

Thefilter_wo_labels method is excluding pull requests that do not have labels even though the:add_pr_wo_labels/pr-wo-labels option is set to true.

This is due to an incorrect key being used to identify that the object being considered is a pull request.

bhelx reacted with thumbs up emoji
@ferrarimarco
Copy link
Contributor

Hi@douglasmiller ! Can you please add a test case? Thanks!

@douglasmiller
Copy link
ContributorAuthor

Working on tests already

issues
else
issues.select { |issue| issue["labels"].map { |l| l["name"] }.any? }
def filter_wo_labels(items)
Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I had to change the internals of this method beyond the initial issue ofpull_request being incorrectly plural.

The original implementation, with the corrected value, would return all pull requests even when:add_pr_wo_labels was false when:add_issues_wo_labels was true. This was exposed when writing tests.

@@ -27,6 +27,10 @@ Metrics/ClassLength:
Metrics/MethodLength:
Enabled: false

Metrics/ModuleLength:
Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I disabled this cop for all specs instead of the per-spec solution that was used previously. Let me know if this is not desirable.

Copy link
Collaborator

@olleolleolleolleolleolle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Thanks for taking the time to improve the tests - while also fixing the defect!

This looks just right,@douglasmiller - thanks, again!

LGTM!

@ferrarimarcoferrarimarco merged commit7bd94fc intogithub-changelog-generator:masterApr 11, 2020
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@olleolleolleolleolleolleolleolleolle approved these changes

@hunnerhunnerAwaiting requested review from hunner

@ferrarimarcoferrarimarcoAwaiting requested review from ferrarimarco

@skywinderskywinderAwaiting requested review from skywinder

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

3 participants
@douglasmiller@ferrarimarco@olleolleolle

[8]ページ先頭

©2009-2025 Movatter.jp