-
Notifications
You must be signed in to change notification settings - Fork 2
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: No replicas for donors in HCA (#6582) #6584
Fix: No replicas for donors in HCA (#6582) #6584
Conversation
0aa044e
to
b7c9cc2
Compare
5aaa1d1
to
4b7a516
Compare
e5bc356
to
43c8989
Compare
9205a80
to
a451386
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #6584 +/- ##
===========================================
- Coverage 85.38% 85.36% -0.02%
===========================================
Files 155 155
Lines 20788 20765 -23
===========================================
- Hits 17749 17726 -23
Misses 3039 3039 ☔ View full report in Codecov by Sentry. |
9270cfd
to
40cf855
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
Just spotted some minor nits to fix.
super().__init__(entity.address + | ||
' cannot ' + ('reference ' if forward else 'be referenced by ') + | ||
other_entity.address) | ||
super().__init__(f'{entity.ref} cannot {"reference" if forward else "be referenced by"} ' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
L
src/azul/indexer/transform.py
Outdated
@@ -87,7 +85,7 @@ def estimate(self, partition: BundlePartition) -> int: | |||
""" | |||
|
|||
@abstractmethod | |||
def transform(self, partition: BundlePartition) -> Iterable[Transform]: | |||
def transform(self, partition: BundlePartition) -> Iterable[Contribution | Replica]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
L
for entity in self._list_entities() | ||
if self._contains(partition, entity) | ||
) | ||
def transform(self, partition: BundlePartition) -> Iterable[Contribution | Replica]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
L
@@ -1418,7 +1406,7 @@ def _entities_in(self, partition: BundlePartition) -> Iterator[ENTITY]: | |||
def estimate(self, partition: BundlePartition) -> int: | |||
return ilen(self._entities_in(partition)) | |||
|
|||
def transform(self, partition: BundlePartition) -> Iterable[Transform]: | |||
def transform(self, partition: BundlePartition) -> Iterable[Contribution | Replica]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
L
@@ -619,7 +597,7 @@ class DonorTransformer(BaseTransformer): | |||
def entity_type(cls) -> str: | |||
return 'donors' | |||
|
|||
def _transform(self, entity: EntityReference) -> Transform: | |||
def _transform(self, entity: EntityReference) -> Iterable[Contribution | Replica]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
L
@@ -1431,7 +1419,7 @@ def entity_type(cls) -> str: | |||
def _entities(self) -> Iterable[api.File]: | |||
return self.api_bundle.not_stitched(self.api_bundle.files) | |||
|
|||
def _transform(self, files: Iterable[api.File]) -> Iterable[Contribution]: | |||
def _transform(self, files: Iterable[api.File]) -> Iterable[Contribution | Replica]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
L
@@ -1649,11 +1643,11 @@ def _dated_entities(self) -> Iterable[DatedEntity]: | |||
def estimate(self, partition: BundlePartition) -> int: | |||
return int(partition.contains(self._singleton_id)) | |||
|
|||
def transform(self, partition: BundlePartition) -> Iterable[Transform]: | |||
def transform(self, partition: BundlePartition) -> Iterable[Contribution | Replica]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
L
# The other hubs will be added when the indexer consolidates duplicate replicas. | ||
[file_id]) | ||
yield self._replica(one(self.api_bundle.projects.values()).ref, | ||
# Projects are linked to every file in their snapshot, making an explicit list | ||
# of hub IDs for the project both redundant and impractically large. Therefore, | ||
# we leave the hub IDs field empty for projects and rely on the tenet that every | ||
# file is an implicit hub of its parent project. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
L, https://github.com/DataBiosphere/azul/blob/develop/CONTRIBUTING.rst#12line-length
diff --git a/src/azul/plugins/metadata/hca/indexer/transform.py b/src/azul/plugins/metadata/hca/indexer/transform.py
index d263e7c2..f1942292 100644
--- a/src/azul/plugins/metadata/hca/indexer/transform.py
+++ b/src/azul/plugins/metadata/hca/indexer/transform.py
@@ -1469,13 +1469,19 @@ class FileTransformer(PartitionedTransformer[api.File]):
yield self._contribution(contents, file_id)
if config.enable_replicas:
yield self._replica(self.api_bundle.ref,
- # The other hubs will be added when the indexer consolidates duplicate replicas.
+ # The other hubs will be added when the
+ # indexer consolidates duplicate
+ # replicas.
[file_id])
yield self._replica(one(self.api_bundle.projects.values()).ref,
- # Projects are linked to every file in their snapshot, making an explicit list
- # of hub IDs for the project both redundant and impractically large. Therefore,
- # we leave the hub IDs field empty for projects and rely on the tenet that every
- # file is an implicit hub of its parent project.
+ # Projects are linked to every file in
+ # their snapshot, making an explicit
+ # list of hub IDs for the project both
+ # redundant and impractically large.
+ # Therefore, we leave the hub IDs field
+ # empty for projects and rely on the
+ # tenet that every file is an implicit
+ # hub of its parent project.
[])
for linked_entity in visitor.entities:
yield self._replica(linked_entity, [file_id])
# The other hubs will be added when the indexer consolidates duplicate replicas. | ||
yield self._replica(entity, [entity.entity_id]) | ||
for linked_entity in linked: | ||
# Datasets are linked to every file in their snapshot, making an explicit list | ||
# of hub IDs for the dataset both redundant and impractically large. Therefore, | ||
# we leave the hub IDs field empty for datasets and rely on the tenet that every | ||
# file is an implicit hub of its parent dataset. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
L
diff --git a/src/azul/plugins/metadata/anvil/indexer/transform.py b/src/azul/plugins/metadata/anvil/indexer/transform.py
index 06464c9a..5e004beb 100644
--- a/src/azul/plugins/metadata/anvil/indexer/transform.py
+++ b/src/azul/plugins/metadata/anvil/indexer/transform.py
@@ -610,12 +610,14 @@ class FileTransformer(BaseTransformer):
)
yield self._contribution(contents, entity.entity_id)
if config.enable_replicas:
- # The other hubs will be added when the indexer consolidates duplicate replicas.
+ # The other hubs will be added when the indexer consolidates
+ # duplicate replicas.
yield self._replica(entity, [entity.entity_id])
for linked_entity in linked:
- # Datasets are linked to every file in their snapshot, making an explicit list
- # of hub IDs for the dataset both redundant and impractically large. Therefore,
- # we leave the hub IDs field empty for datasets and rely on the tenet that every
- # file is an implicit hub of its parent dataset.
+ # Datasets are linked to every file in their snapshot, making an
+ # explicit list of hub IDs for the dataset both redundant and
+ # impractically large. Therefore, we leave the hub IDs field
+ # empty for datasets and rely on the tenet that every file is an
+ # implicit hub of its parent dataset.
yield self._replica(linked_entity,
hub_ids=[] if linked_entity.entity_type == 'dataset' else [entity.entity_id])
|
||
ENTITY = TypeVar('ENTITY', bound=api.Entity) | ||
|
||
|
||
class PartitionedTransformer(BaseTransformer, Generic[ENTITY]): | ||
|
||
@abstractmethod | ||
def _transform(self, entities: Iterable[ENTITY]) -> Iterable[Transform]: | ||
def _transform(self, entities: Iterable[ENTITY]) -> Iterable[Contribution | Replica]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
L
ac4f8b0
to
16bb687
Compare
I added the |
Security design review
|
e895bd1
to
db175f9
Compare
db175f9
to
da77107
Compare
|
Connected issues: #6582
Checklist
Author
develop
issues/<GitHub handle of author>/<issue#>-<slug>
1 when the issue title describes a problem, the corresponding PR
title is
Fix:
followed by the issue titleAuthor (partiality)
p
tag to titles of partial commitspartial
or completely resolves all connected issuespartial
labelAuthor (chains)
base
or this PR is not chained to another PRchained
or is not chained to another PRAuthor (reindex, API changes)
r
tag to commit title or the changes introduced by this PR will not require reindexing of any deploymentreindex:dev
or the changes introduced by it will not require reindexing ofdev
reindex:anvildev
or the changes introduced by it will not require reindexing ofanvildev
reindex:anvilprod
or the changes introduced by it will not require reindexing ofanvilprod
reindex:prod
or the changes introduced by it will not require reindexing ofprod
reindex:partial
and its description documents the specific reindexing procedure fordev
,anvildev
,anvilprod
andprod
or requires a full reindex or carries none of the labelsreindex:dev
,reindex:anvildev
,reindex:anvilprod
andreindex:prod
API
or this PR does not modify a REST APIa
(A
) tag to commit title for backwards (in)compatible changes or this PR does not modify a REST APIapp.py
or this PR does not modify a REST APIAuthor (upgrading deployments)
make docker_images.json
and committed the resulting changes or this PR does not modifyazul_docker_images
, or any other variables referenced in the definition of that variableu
tag to commit title or this PR does not require upgrading deploymentsupgrade
or does not require upgrading deploymentsdeploy:shared
or does not modifydocker_images.json
, and does not require deploying theshared
component for any other reasondeploy:gitlab
or does not require deploying thegitlab
componentdeploy:runner
or does not require deploying therunner
imageAuthor (hotfixes)
F
tag to main commit title or this PR does not include permanent fix for a temporary hotfixanvilprod
andprod
) have temporary hotfixes for any of the issues connected to this PRAuthor (before every review)
develop
, squashed old fixupsmake requirements_update
or this PR does not modifyrequirements*.txt
,common.mk
,Makefile
andDockerfile
R
tag to commit title or this PR does not modifyrequirements*.txt
reqs
or does not modifyrequirements*.txt
make integration_test
passes in personal deployment or this PR does not modify functionality that could affect the IT outcomePeer reviewer (after approval)
System administrator (after approval)
demo
orno demo
no demo
no sandbox
N reviews
label is accurateOperator (before pushing merge the commit)
reindex:…
labels andr
commit title tagno demo
develop
_select dev.shared && CI_COMMIT_REF_NAME=develop make -C terraform/shared apply_keep_unused
or this PR is not labeleddeploy:shared
_select dev.gitlab && CI_COMMIT_REF_NAME=develop make -C terraform/gitlab apply
or this PR is not labeleddeploy:gitlab
_select anvildev.shared && CI_COMMIT_REF_NAME=develop make -C terraform/shared apply_keep_unused
or this PR is not labeleddeploy:shared
_select anvildev.gitlab && CI_COMMIT_REF_NAME=develop make -C terraform/gitlab apply
or this PR is not labeleddeploy:gitlab
deploy:gitlab
deploy:gitlab
System administrator
dev.gitlab
are complete or this PR is not labeleddeploy:gitlab
anvildev.gitlab
are complete or this PR is not labeleddeploy:gitlab
Operator (before pushing merge the commit)
_select dev.gitlab && make -C terraform/gitlab/runner
or this PR is not labeleddeploy:runner
_select anvildev.gitlab && make -C terraform/gitlab/runner
or this PR is not labeleddeploy:runner
sandbox
label or PR is labeledno sandbox
dev
or PR is labeledno sandbox
anvildev
or PR is labeledno sandbox
sandbox
deployment or PR is labeledno sandbox
anvilbox
deployment or PR is labeledno sandbox
sandbox
deployment or PR is labeledno sandbox
anvilbox
deployment or PR is labeledno sandbox
sandbox
or this PR does not remove catalogs or otherwise causes unreferenced indices indev
anvilbox
or this PR does not remove catalogs or otherwise causes unreferenced indices inanvildev
sandbox
or this PR is not labeledreindex:dev
anvilbox
or this PR is not labeledreindex:anvildev
sandbox
or this PR is not labeledreindex:dev
anvilbox
or this PR is not labeledreindex:anvildev
p
if the PR is also labeledpartial
Operator (chain shortening)
develop
or this PR is not labeledbase
chained
label from the blocked PR or this PR is not labeledbase
base
base
label from this PR or this PR is not labeledbase
Operator (after pushing the merge commit)
dev
anvildev
dev
dev
anvildev
anvildev
_select dev.shared && make -C terraform/shared apply
or this PR is not labeleddeploy:shared
_select anvildev.shared && make -C terraform/shared apply
or this PR is not labeleddeploy:shared
dev
anvildev
Operator (reindex)
dev
or this PR is neither labeledreindex:partial
norreindex:dev
anvildev
or this PR is neither labeledreindex:partial
norreindex:anvildev
dev
or this PR is neither labeledreindex:partial
norreindex:dev
anvildev
or this PR is neither labeledreindex:partial
norreindex:anvildev
dev
or this PR is neither labeledreindex:partial
norreindex:dev
anvildev
or this PR is neither labeledreindex:partial
norreindex:anvildev
dev
or this PR does not require reindexingdev
anvildev
or this PR does not require reindexinganvildev
dev
or this PR does not require reindexingdev
anvildev
or this PR does not require reindexinganvildev
dev
or this PR does not require reindexingdev
anvildev
or this PR does not require reindexinganvildev
Operator
deploy:shared
,deploy:gitlab
,deploy:runner
,API
,reindex:partial
,reindex:anvilprod
andreindex:prod
labels to the next promotion PRs or this PR carries none of these labelsdeploy:shared
,deploy:gitlab
,deploy:runner
,API
,reindex:partial
,reindex:anvilprod
andreindex:prod
labels, from the description of this PR to that of the next promotion PRs or this PR carries none of these labelsShorthand for review comments
L
line is too longW
line wrapping is wrongQ
bad quotesF
other formatting problem