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

Fix: publicationTitle filter only works for projects (#2764) #2792

Merged
merged 2 commits into from
Mar 10, 2021

Conversation

amarjandu
Copy link
Contributor

@amarjandu amarjandu commented Feb 12, 2021

Author

  • PR title references issue
  • Title of main commit references issue
  • PR is linked to Zenhub issue

Author (reindex)

  • Added r tag to commit title or this PR does not require reindexing
  • Added reindex label to PR or this PR does not require reindexing

Author (freebies & chains)

  • Freebies are blocked on this PR or there are no freebies in this PR
  • Freebies are referenced in commit titles or there are no freebies in this PR
  • This PR is blocked by previous PR in the chain or this PR is not chained to another PR
  • Added chain label to the blocking PR or this PR is not chained to another PR

Author (upgrading)

  • Documented upgrading of deployments in UPGRADING.rst or this PR does not require upgrading
  • Added u tag to commit title or this PR does not require upgrading
  • Added upgrade label to PR or this PR does not require upgrading

Author (requirements, before every review)

  • Ran make requirements_update or this PR leaves requirements*.txt, common.mk and Makefile untouched
  • Added R tag to commit title or this PR leaves requirements*.txt untouched
  • Added reqs label to PR or this PR leaves requirements*.txt untouched

Author (before every review)

  • make integration_test passes in personal deployment or this PR does not touch functionality that could break the IT
  • Rebased branch on develop, squashed old fixups

Primary reviewer (after approval)

  • Commented on demo expectations or labelled PR as no demo
  • Decided if PR can be labeled no sandbox
  • PR title is appropriate as title of merge commit
  • Moved ticket to Approved column
  • Assigned PR to an operator

Operator (before pushing merge the commit)

  • Checked reindex label and r commit title tag
  • Checked that Demo expectations are clear or PR is labeled as no demo
  • Rebased and squashed branch
  • Sanity-checked history
  • Pushed PR branch to Github
  • Branch pushed to Gitlab and build passes in sandbox or added no sandbox label
  • Started reindex in sandbox or this PR does not require reindexing sandbox
  • Checked for failures in sandbox or this PR does not require reindexing sandbox
  • Added PR reference to merge commit title
  • Collected commit title tags in merge commit title
  • Moved linked issue to Merged column
  • Pushed merge commit to Github

Operator (after pushing the merge commit)

  • Moved freebies to Merged column or there are no freebies in this PR
  • Shortened the PR chain or this PR is not the base of another PR
  • Verified that N reviews labelling is accurate
  • Pushed merge commit to Gitlab or this changes can be pushed later, together with another PR
  • Deleted PR branch from Github and Gitlab

Operator (reindex)

  • Purchased BQ slot committment in dev or this PR does not require reindexing dev
  • Started reindex in dev or this PR does not require reindexing dev
  • Deleted BQ slot committment in dev or this PR does not require reindexing dev
  • Checked for failures in dev or this PR does not require reindexing dev
  • Purchased BQ slot committment in prod or this PR does not require reindexing prod
  • Started reindex in prod or this PR does not require reindexing prod
  • Deleted BQ slot committment in prod or this PR does not require reindexing prod
  • Checked for failures in prod or this PR does not require reindexing prod

Operator

  • Unassigned PR

@github-actions github-actions bot added the orange [process] Done by the Azul team label Feb 12, 2021
@codecov
Copy link

codecov bot commented Feb 12, 2021

Codecov Report

Merging #2792 (f696bb0) into develop (905b700) will increase coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #2792      +/-   ##
===========================================
+ Coverage    83.42%   83.43%   +0.01%     
===========================================
  Files          127      127              
  Lines        13279    13291      +12     
===========================================
+ Hits         11078    11090      +12     
  Misses        2201     2201              
Impacted Files Coverage Δ
src/azul/plugins/metadata/hca/aggregate.py 97.70% <ø> (ø)
test/service/test_response.py 99.81% <100.00%> (+<0.01%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 905b700...f696bb0. Read the comment docs.

@coveralls
Copy link

coveralls commented Feb 12, 2021

Coverage Status

Coverage increased (+0.01%) to 83.393% when pulling f696bb0 on issues/amar/2764-publicationTitles into 905b700 on develop.

@hannes-ucsc
Copy link
Member

hannes-ucsc commented Feb 13, 2021

Title makes no sense, @amarjandu. The publication titles ARE present in the project aggregate. Where they are missing from is the OTHER aggregates.

@amarjandu amarjandu force-pushed the issues/amar/2764-publicationTitles branch 2 times, most recently from 52fc6a1 to c19ecd4 Compare February 17, 2021 00:43
@amarjandu amarjandu changed the title Include publication_titles within project aggregates (#2764) Accumulate publication_titles for aggregations (#2764) Feb 17, 2021
@amarjandu amarjandu force-pushed the issues/amar/2764-publicationTitles branch from c19ecd4 to 2e11d9b Compare February 17, 2021 00:44
Copy link
Contributor

@dsotirho-ucsc dsotirho-ucsc left a comment

Choose a reason for hiding this comment

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

@dsotirho-ucsc dsotirho-ucsc removed their assignment Feb 17, 2021
@amarjandu amarjandu force-pushed the issues/amar/2764-publicationTitles branch from a871442 to 600938d Compare February 17, 2021 22:59
Copy link
Contributor

@dsotirho-ucsc dsotirho-ucsc left a comment

Choose a reason for hiding this comment

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

Approved.
Travis reports an error however it is due to codecov failing and does not appear to be due to the PR itself.

@dsotirho-ucsc dsotirho-ucsc removed their assignment Feb 18, 2021
@amarjandu
Copy link
Contributor Author

Travis reports an error however it is due to codecov failing and does not appear to be due to the PR itself.

Thanks for the heads up, pipeline restarted.

@amarjandu amarjandu force-pushed the issues/amar/2764-publicationTitles branch 2 times, most recently from ced87fb to 7660e59 Compare February 18, 2021 19:32
@amarjandu amarjandu changed the title Accumulate publication_titles for aggregations (#2764) Fix: publicationTitle filter only works for projects (#2764) Feb 18, 2021
Copy link
Member

@hannes-ucsc hannes-ucsc left a comment

Choose a reason for hiding this comment

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

There should be a test, likely in TestResponse, that shows that we can filter a non-project index by publication title.

@hannes-ucsc hannes-ucsc removed their assignment Feb 23, 2021
@hannes-ucsc hannes-ucsc added the 1 review [process] Lead requested changes once label Feb 23, 2021
@amarjandu amarjandu force-pushed the issues/amar/2764-publicationTitles branch 3 times, most recently from 5e3a2c3 to 35bda73 Compare February 24, 2021 18:06
Copy link
Member

@hannes-ucsc hannes-ucsc 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 we've been over this a couple times. There's an affinity to overly verbose variable names. More verbose isn't always better. It's worse, in many cases, because it makes the code more noisy, more likely to be in need of wrapping.

Whenever you have test + fix you should do a split commit. I think the C guide stipulates this. Could you check, please?

@@ -1772,6 +1772,61 @@ def test_pagination_search_after_search_before(self):
self.assertEqual(second_page_previous['search_before'], 'null')
self.assertEqual(second_page_previous['search_before_uid'], 'doc#308eea51-d14b-4036-8cd1-cfd81d7532c3')

def test_filter_by_publicationTitle(self):
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
def test_filter_by_publicationTitle(self):
def test_filter_by_publication_title(self):

Copy link
Contributor Author

Choose a reason for hiding this comment

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

just a heads up there is precedent in this TestClass to have the facet name within the test definition. test_filter_by_projectId was the one that I saw.

@@ -1772,6 +1772,61 @@ def test_pagination_search_after_search_before(self):
self.assertEqual(second_page_previous['search_before'], 'null')
self.assertEqual(second_page_previous['search_before_uid'], 'doc#308eea51-d14b-4036-8cd1-cfd81d7532c3')

def test_filter_by_publicationTitle(self):
expected_filtered_results = [
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
expected_filtered_results = [
cases = [

small scope, short variable name

]
for publication_title, bundle_hits in expected_filtered_results:
with self.subTest(publication_title=publication_title):
url = furl(url=self.base_url, path='index/bundles').url
Copy link
Member

Choose a reason for hiding this comment

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

The ticket doesn't use bundles. It uses files I think. Ideally, the test resembles the repro in the ticket.

()
)
]
for publication_title, bundle_hits in expected_filtered_results:
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
for publication_title, bundle_hits in expected_filtered_results:
for title, bundles in expected_filtered_results:

for publication_title, bundle_hits in expected_filtered_results:
with self.subTest(publication_title=publication_title):
url = furl(url=self.base_url, path='index/bundles').url
filters_parameter = {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
filters_parameter = {
filters = {

'is': [publication_title]
}
}
publication_term_facet = {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
publication_term_facet = {
expected_terms = {

test/service/test_response.py Outdated Show resolved Hide resolved
test/service/test_response.py Outdated Show resolved Hide resolved
@hannes-ucsc hannes-ucsc removed their assignment Feb 24, 2021
@hannes-ucsc hannes-ucsc removed the 1 review [process] Lead requested changes once label Feb 24, 2021
@amarjandu amarjandu force-pushed the issues/amar/2764-publicationTitles branch from 3dd3748 to 69b4adf Compare February 26, 2021 17:39
@amarjandu amarjandu assigned amarjandu and hannes-ucsc and unassigned amarjandu Feb 26, 2021
Copy link
Member

@hannes-ucsc hannes-ucsc left a comment

Choose a reason for hiding this comment

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

Missed from previous review:

Whenever you have test + fix you should do a split commit. I think the C guide stipulates this. Could you check, please?

self.assertEqual(expected_terms,
response.json()['termFacets']['publicationTitle'])
actual_files = {
one(hit['files'])['uuid'] for hit in response.json()['hits']
Copy link
Member

Choose a reason for hiding this comment

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

@hannes-ucsc hannes-ucsc added 4+ reviews [process] Lead requested changes four times or more and removed 3 reviews [process] Lead requested changes thrice labels Feb 26, 2021
@hannes-ucsc hannes-ucsc removed their assignment Feb 26, 2021
@hannes-ucsc
Copy link
Member

And https://github.com/DataBiosphere/azul/blob/develop/CONTRIBUTING.rst#511review-comments

there are some open conversations that need 👍

@amarjandu
Copy link
Contributor Author

@hannes-ucsc

Whenever you have test + fix you should do a split commit. I think the C guide stipulates this. Could you check, please?

My apologies, I saw this, then missed addressing it. I'll add Double checking the top-level review comment to my checklist of things to do before requesting review, to avoid this happening again.

I was NOT able to locate the section that you mentioned above, I read through all sections that mentioned test and fix as well as the Split commits section specifically.
Perhaps we can add it to the Split commits section where there is a mention about the body being used to distinguish parts of a split commit.

  - ``[1/2] Reticulate them splines for good measure (#123)`` and
        Add tests for spline counting
  - ``[2/2] Reticulate them splines for good measure (#123)``
        Reticulate splines before execution

In the Testing section it might be worthwhile to add the expectation of having a commit that causes test failures, then a commit that fixes the failures (and the issue).

there are some open conversations that need 👍

I believe this has been done.

actual_files = {
one(hit['files'])['uuid']
for hit
in response.json()['hits']
Copy link
Member

Choose a reason for hiding this comment

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

set()
)
]
for title, files in cases:
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
for title, files in cases:
for title, expected_files in cases:

self.assertEqual(200, response.status_code)
self.assertEqual(expected_terms,
response.json()['termFacets']['publicationTitle'])
actual_files = {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
actual_files = {
files = {

Should be consistent with prefixing either actual or expected but not mixing both styles.

@hannes-ucsc hannes-ucsc removed their assignment Mar 8, 2021
@amarjandu amarjandu force-pushed the issues/amar/2764-publicationTitles branch from 4938a2a to e906d2b Compare March 8, 2021 21:16
@hannes-ucsc
Copy link
Member

For demo, attempt to reproduce the issue.

@amarjandu amarjandu force-pushed the issues/amar/2764-publicationTitles branch from e906d2b to f696bb0 Compare March 10, 2021 20:12
@amarjandu amarjandu added the reindex:dev [process] PR requires reindexing dev label Mar 10, 2021
@amarjandu amarjandu merged commit 8f15f20 into develop Mar 10, 2021
@amarjandu amarjandu deleted the issues/amar/2764-publicationTitles branch March 10, 2021 22:52
@amarjandu
Copy link
Contributor Author

5 failed notifications found the failed notification queue, they are already noted in:
#2870
#2873
Output:
azul-notifications_fail-dev.json.txt

@amarjandu amarjandu removed their assignment Mar 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4+ reviews [process] Lead requested changes four times or more orange [process] Done by the Azul team reindex:dev [process] PR requires reindexing dev
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants