Skip to content
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

Re-fix honoring of 'except' when used with 'comment_required' #425

Open
wants to merge 19 commits into
base: main
Choose a base branch
from

Conversation

jeffdill2
Copy link
Contributor

This was originally fixed here: #419

But it was inadvertently broken when this was merged in: #420

Copy link
Collaborator

@tbrisker tbrisker left a comment

Choose a reason for hiding this comment

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

Could you please add a test to make sure this doesn't break again? Thanks!

end
end

def comment_required_state?
auditing_enabled &&
Copy link
Collaborator

Choose a reason for hiding this comment

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

Wouldn't it be simpler to add here audited_changes.peresent?

@tbrisker
Copy link
Collaborator

ping @jeffdill2, any updates on this?

@jeffdill2
Copy link
Contributor Author

@tbrisker Sorry, been a busy couple of weeks. I'll get this addressed today.

@jeffdill2
Copy link
Contributor Author

@tbrisker OK, I've got a test in place now to ensure this doesn't break again in the future. 😄

@jeffdill2
Copy link
Contributor Author

@tbrisker Just following up with this one as well. Tests are in place now, so it's ready for review. Thanks!

Copy link
Collaborator

@tbrisker tbrisker left a comment

Choose a reason for hiding this comment

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

I think you missed my previous comment, so I added another one to try and explain what I meant. Additionally, look like the changelog entry is now conflicting with other changes, can you please rebase?

then
false
else
true
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is quite a confusing check, returning the opposite result to the condition - perhaps you can just reuse the comment_required_state? function and add the additional condition instead of flipping the entire logic around?

Copy link
Contributor Author

@jeffdill2 jeffdill2 Jul 9, 2018

Choose a reason for hiding this comment

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

@tbrisker I think it was mainly just the name comment_required_state? that I wasn't a fan of. To me it seems to indicate whether or not comment_required is enabled, but what it's really doing is adding additional checks for whether or not audit_comment should be validated for presence when comment_required is enabled. I felt that eligible_for_comment_validation? was clearer about what it's actually checking.

And my though process for flipping the logic around a bit was just so that the conditions would fail earlier – meaning that if auditing isn't enabled, we can immediately return false instead of having to test any more conditions. But I can definitely understand how it's a bit confusing. And now that I think about it, my logic was complete non-sense anyways – if !auditing_enabled || and auditing_enabled && will both return false immediately if auditing isn't enabled. So that was just a big derp on my part. 😬

I'll get this fixed today.

@jeffdill2
Copy link
Contributor Author

@tbrisker OK, should be better now. 😄

@jeffdill2 jeffdill2 force-pushed the re-fix-honoring-of-except-with-comment-required branch from 6599f04 to 34ee9a9 Compare July 9, 2018 19:55
@jeffdill2
Copy link
Contributor Author

@tbrisker merge conflict resolved now.

…hub.com:jeffdill2/audited into re-fix-honoring-of-except-with-comment-required
@jeffdill2
Copy link
Contributor Author

@tbrisker I've got master merged in now so checks are passing. This should be ready for review/merge whenever you get a chance. 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants