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

Expose 'submission_date' and 'update_date' (#2562, #3310) #3026

Conversation

dsotirho-ucsc
Copy link
Contributor

@dsotirho-ucsc dsotirho-ucsc commented Apr 29, 2021

#2562
#3310

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 or PR is labeled no sandbox
  • Build passes in sandbox and added sandbox label or PR is labeled no sandbox
  • 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)

  • Started reindex in dev or this PR does not require reindexing or does not target dev
  • Checked for failures in dev or this PR does not require reindexing or does not target dev
  • Started reindex in prod or this PR does not require reindexing or does not target prod
  • Checked for failures in prod or this PR does not require reindexing or does not target prod

Operator

  • Unassigned PR

@github-actions github-actions bot added the orange [process] Done by the Azul team label Apr 29, 2021
@dsotirho-ucsc dsotirho-ucsc added the reindex:dev [process] PR requires reindexing dev label Apr 29, 2021
@dsotirho-ucsc dsotirho-ucsc force-pushed the issues/danielsotirhos/2562-expose-projects-submission-date-and-update-date branch 3 times, most recently from f802ed7 to d8c6459 Compare April 29, 2021 18:17
@codecov
Copy link

codecov bot commented Apr 29, 2021

Codecov Report

Merging #3026 (6a8498d) into develop (4520816) will increase coverage by 0.13%.
The diff coverage is 97.95%.

❗ Current head 6a8498d differs from pull request most recent head 54f948d. Consider uploading reports for the commit 54f948d to get more accurate results
Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #3026      +/-   ##
===========================================
+ Coverage    82.36%   82.50%   +0.13%     
===========================================
  Files          123      123              
  Lines        13998    14035      +37     
===========================================
+ Hits         11529    11579      +50     
+ Misses        2469     2456      -13     
Impacted Files Coverage Δ
src/azul/__init__.py 81.17% <ø> (ø)
test/indexer/test_hca_indexer.py 99.30% <ø> (ø)
test/service/test_repository_projects.py 100.00% <ø> (ø)
test/service/test_manifest.py 99.56% <75.00%> (-0.01%) ⬇️
src/azul/plugins/metadata/hca/aggregate.py 97.77% <94.11%> (+0.05%) ⬆️
src/azul/indexer/aggregate.py 90.28% <100.00%> (+2.71%) ⬆️
src/azul/indexer/document.py 95.90% <100.00%> (+0.17%) ⬆️
src/azul/plugins/metadata/hca/transform.py 98.78% <100.00%> (-0.15%) ⬇️
src/azul/plugins/repository/tdr/__init__.py 90.63% <100.00%> (+0.03%) ⬆️
src/azul/service/avro_pfb.py 96.18% <100.00%> (+0.42%) ⬆️
... and 13 more

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 4520816...54f948d. Read the comment docs.

@coveralls
Copy link

coveralls commented Apr 29, 2021

Coverage Status

Coverage increased (+0.1%) to 82.716% when pulling 54f948d on issues/danielsotirhos/2562-expose-projects-submission-date-and-update-date into 4520816 on develop.

@dsotirho-ucsc dsotirho-ucsc force-pushed the issues/danielsotirhos/2562-expose-projects-submission-date-and-update-date branch from d8c6459 to e374041 Compare April 29, 2021 22:06
@dsotirho-ucsc dsotirho-ucsc force-pushed the issues/danielsotirhos/2562-expose-projects-submission-date-and-update-date branch from e374041 to 3cf1af4 Compare April 30, 2021 20:34
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.

So far so good. Could you spend two hours investigating what it would entail to have these two properties exposed for every inner entity? This would allow us to expose not only when the project itself was updated but also entities that contribute to it. I think this would imply that we need to aggregate over the properties, I think using min for submission_date and max for update_date.

@hannes-ucsc hannes-ucsc added the 0 reviews [process] Lead didn't request any changes label May 3, 2021
@hannes-ucsc hannes-ucsc removed their assignment May 3, 2021
@dsotirho-ucsc dsotirho-ucsc force-pushed the issues/danielsotirhos/2562-expose-projects-submission-date-and-update-date branch 2 times, most recently from adef2d9 to 2e8b35f Compare May 5, 2021 18:04
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.

Whenever you copy and paste the same code multiple times, an alarm bell needs to go off.

elif field == 'update_date':
return MaxAccumulator()
else:
return SetAccumulator(max_size=10)
Copy link
Member

Choose a reason for hiding this comment

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

Why 10 and not 100?

Comment on lines 131 to 136
elif field == 'submission_date':
return MinAccumulator()
elif field == 'update_date':
return MaxAccumulator()
else:
return SetAccumulator(max_size=100)
Copy link
Member

Choose a reason for hiding this comment

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

This is all painfully duplicative. We should adjust the default implementation so we can write

Suggested change
elif field == 'submission_date':
return MinAccumulator()
elif field == 'update_date':
return MaxAccumulator()
else:
return SetAccumulator(max_size=100)
else:
return super()._get_accumulator()

without affecting the semantics.

Comment on lines 91 to 92
else:
return None
Copy link
Member

Choose a reason for hiding this comment

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

This is different to the other implementations of this method. We should create a new _get_default_accumulator() method in the base class and override that here to return None instead of SetAccumulator(max_size=100).

Comment on lines 656 to 657
'document_id': str(cell_line.document_id),
'biomaterial_id': cell_line.biomaterial_id,
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
'document_id': str(cell_line.document_id),
'biomaterial_id': cell_line.biomaterial_id,
**_biomaterial(cell_line),

_biomaterial calls _entity and adds and adds an entry for biomaterial_id

Copy link
Member

Choose a reason for hiding this comment

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

Similar structure for the _foo_types methods.

Comment on lines 660 to 661
'submission_date': cell_line.submission_date,
'update_date': cell_line.update_date,
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
'submission_date': cell_line.submission_date,
'update_date': cell_line.update_date,

@@ -782,74 +815,96 @@ def _related_file(self, file: api.File) -> MutableJSON:
'uuid': file.manifest_entry.uuid,
'drs_path': self.bundle.drs_path(file.manifest_entry.json),
'version': file.manifest_entry.version,
'submission_date': file.submission_date,
'update_date': file.update_date,
}

@classmethod
def _analysis_protocol_types(cls) -> FieldTypes:
return {
'document_id': null_str,
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
'document_id': null_str,
**_entity(file),

Comment on lines 827 to 828
'submission_date': null_str,
'update_date': null_str,
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
'submission_date': null_str,
'update_date': null_str,

Comment on lines 271 to 272
'submissionDate': p['submission_date'],
'updateDate': p['update_date'],
Copy link
Member

Choose a reason for hiding this comment

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

Same refactoring here.

@hannes-ucsc hannes-ucsc added 1 review [process] Lead requested changes once and removed 0 reviews [process] Lead didn't request any changes labels May 8, 2021
@hannes-ucsc hannes-ucsc removed their assignment May 8, 2021
@dsotirho-ucsc dsotirho-ucsc force-pushed the issues/danielsotirhos/2562-expose-projects-submission-date-and-update-date branch 3 times, most recently from 7a3a01a to d6f5901 Compare May 12, 2021 17:15
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.

Commit title Add "Assert Messaging" to Contributing document is bad. Neither the section name nor the file name matches.

This PR is connected to #3310 but there is no commit referencing that issue. The ticket references in commit titles are EXTREMELY important because when done right, the commit shows up in the ticket which is INVALUABLE when trying to make sense of things later.

I think we may want to commit the workaround for the Python bug as a separate commit.

CONTRIBUTING.rst Outdated
@@ -478,6 +478,38 @@ Static methods
higher order concerns than the one about whether a method's body currently
references self or not.

Error Messages
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
Error Messages
Error messages

CONTRIBUTING.rst Outdated
Comment on lines 481 to 482
Error Messages
----------------
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
Error Messages
----------------
Error Messages
--------------

@hannes-ucsc hannes-ucsc removed their assignment Aug 19, 2021
@dsotirho-ucsc dsotirho-ucsc force-pushed the issues/danielsotirhos/2562-expose-projects-submission-date-and-update-date branch 2 times, most recently from d408410 to 6a8498d Compare August 19, 2021 22:53
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 renamed one of the tickets. Could you update the commit title accordingly?

No bump.

@hannes-ucsc hannes-ucsc removed their assignment Aug 20, 2021
@dsotirho-ucsc dsotirho-ucsc force-pushed the issues/danielsotirhos/2562-expose-projects-submission-date-and-update-date branch from 6a8498d to 99785e5 Compare August 20, 2021 05:54
@jessebrennan jessebrennan changed the title Expose 'submission_date' and 'update_date' (#2562) [r] Expose 'submission_date' and 'update_date' (#2562) Aug 24, 2021
@jessebrennan jessebrennan changed the title [r] Expose 'submission_date' and 'update_date' (#2562) Expose 'submission_date' and 'update_date' (#2562) Aug 24, 2021
@jessebrennan jessebrennan force-pushed the issues/danielsotirhos/2562-expose-projects-submission-date-and-update-date branch from 99785e5 to 54f948d Compare August 24, 2021 01:22
@jessebrennan jessebrennan added the sandbox [process] Resolution is being verified in sandbox deployment label Aug 24, 2021
@jessebrennan jessebrennan removed their assignment Aug 24, 2021
@jessebrennan jessebrennan merged this pull request into develop Aug 24, 2021
@jessebrennan jessebrennan changed the title Expose 'submission_date' and 'update_date' (#2562) Expose 'submission_date' and 'update_date' (#2562, #3310) Aug 24, 2021
@jessebrennan
Copy link
Contributor

@danielsotirhos the PR title only referenced on of the commits addressed here. I've updated it, but this is how I messed up the merge commit on develop

@jessebrennan jessebrennan deleted the issues/danielsotirhos/2562-expose-projects-submission-date-and-update-date branch August 24, 2021 23:30
@jessebrennan
Copy link
Contributor

Failures on dev matched expected tickets:

There were no unexpected failures.

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 sandbox [process] Resolution is being verified in sandbox deployment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants