Skip to content

Conversation

@dastultz
Copy link

No description provided.

Daryl Stultz added 2 commits April 17, 2019 14:19
Differentiate find with boolean AND with OR.
@aheritier
Copy link
Contributor

@dastultz Could you try to add some integration tests please ?
See RealSmokeTest.java
Just tell us what to configure in our sandbox to have them passing

@dastultz
Copy link
Author

dastultz commented Aug 5, 2019

Sorry for the delay, I plan to do this, please don't close the issue. Thanks.

Unit tests.
@dastultz
Copy link
Author

dastultz commented Sep 7, 2019

Added unit tests. I did not run them! Documented article contents needed in sandbox.

stephenc
stephenc previously approved these changes Sep 7, 2019
Copy link
Contributor

@stephenc stephenc left a comment

Choose a reason for hiding this comment

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

LGTM but i’ll leave it to @aheritier

Copy link
Contributor

@aheritier aheritier left a comment

Choose a reason for hiding this comment

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

it's a good PR @dastultz
I created the documents based on your scenario but found an issue (we should/could probably automate it)

.set("query", searchTerm).set("section", sectionId), handleList(Article.class, "results"));
}

public Iterable<Article> getArticleFromSomeLabels(List<String> labels) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Naming seems a little off to me, especially with the fact singular is used for returning a collection. How about something like..

getArticlesWithAllLabels
searchArticlesWithLabels

Copy link
Author

Choose a reason for hiding this comment

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

I don't understand what is meant by "get" vs "search" if anything. The part I was looking to make clear was that one method requires at least one label to be found, the other requires all labels to be found. IMO, "WithAll" is good, but the idea of "with at least one" is not captured in the name "searchArticlesWithLabels". Not sure if "search" implies such behavior. You objected to the use of singular for returning a collection, I agree with that, I followed the existing pattern established by the getArticleFromSearch method. I think getArticlesFromSomeLabels and getArticlesFromAllLabels best captures the concerns, though I don't like the apparent API inconsistency with the singular Article vs Articles.

Copy link
Contributor

Choose a reason for hiding this comment

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

How about getArticlesFromAllLabels and getArticlesFromAnyLabels

Copy link
Author

Choose a reason for hiding this comment

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

Works for me, as long as everyone doesn't mind the inconsistency of Article plurality with getArticleFromSearch. Should I make the change, or will someone else do it?

Copy link
Contributor

Choose a reason for hiding this comment

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

Or introduce corrected method with deprecated annotation on the singular.

Copy link
Author

Choose a reason for hiding this comment

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

Who is the "gatekeeper" of the public-facing API? I'm trying to add functionality but not dictate API design in general. I feel like someone more qualified should handle the naming issue. I'm happy with getArticlesFromAllLabels and getArticlesFromAnyLabels. I'm going to make that change and hope it goes through.

Copy link
Contributor

@johnou johnou left a comment

Choose a reason for hiding this comment

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

See inline comments.

aheritier
aheritier previously approved these changes Sep 10, 2019
Copy link
Contributor

@aheritier aheritier left a comment

Choose a reason for hiding this comment

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

I confirm that the tests are passing now

Copy link
Contributor

@johnou johnou left a comment

Choose a reason for hiding this comment

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

Please see inline comments wrt naming.

Rename API methods as per code review.
@duemir duemir removed their request for review September 11, 2019 05:35
@aheritier aheritier added this to the 0.11.0 milestone Nov 28, 2019
@aheritier aheritier merged commit a2ed724 into cloudbees-oss:master Nov 28, 2019
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.

4 participants