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

[r] Rename SourceName to SourceSpec (#2843) #3047

Merged
merged 5 commits into from
Jun 18, 2021

Conversation

amarjandu
Copy link
Contributor

@amarjandu amarjandu commented May 10, 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 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 May 10, 2021
@amarjandu amarjandu force-pushed the issues/amar/2843-mv-spec branch 3 times, most recently from ed15c81 to 511a32b Compare May 11, 2021 02:11
@codecov
Copy link

codecov bot commented May 11, 2021

Codecov Report

Merging #3047 (b586d03) into develop (6dd27c7) will decrease coverage by 0.14%.
The diff coverage is 79.48%.

❗ Current head b586d03 differs from pull request most recent head 5c8e396. Consider uploading reports for the commit 5c8e396 to get more accurate results
Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #3047      +/-   ##
===========================================
- Coverage    82.41%   82.26%   -0.15%     
===========================================
  Files          118      119       +1     
  Lines        13288    13149     -139     
===========================================
- Hits         10951    10817     -134     
+ Misses        2337     2332       -5     
Impacted Files Coverage Δ
src/azul/azulclient.py 37.98% <0.00%> (ø)
src/azul/plugins/metadata/hca/__init__.py 100.00% <ø> (ø)
src/azul/plugins/repository/canned/__init__.py 0.00% <0.00%> (ø)
src/azul/service/hca_response_v5.py 91.91% <ø> (ø)
test/service/test_manifest.py 99.51% <ø> (-0.01%) ⬇️
test/service/test_response.py 99.83% <ø> (ø)
src/azul/plugins/__init__.py 88.42% <40.00%> (-1.49%) ⬇️
src/azul/plugins/repository/dss/__init__.py 80.30% <77.77%> (+0.15%) ⬆️
src/azul/plugins/repository/tdr/__init__.py 82.72% <92.30%> (-6.32%) ⬇️
src/azul/indexer/__init__.py 98.71% <100.00%> (+0.10%) ⬆️
... and 22 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 6dd27c7...5c8e396. Read the comment docs.

@coveralls
Copy link

coveralls commented May 11, 2021

Coverage Status

Coverage increased (+0.002%) to 82.66% when pulling 5c8e396 on issues/amar/2843-mv-spec into 6dd27c7 on develop.

@amarjandu amarjandu force-pushed the issues/amar/2843-mv-spec branch 3 times, most recently from ac36646 to 4353199 Compare May 11, 2021 19:31
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.

Found a couple more spots.

diff --git a/scripts/recan_bundle_tdr.py b/scripts/recan_bundle_tdr.py
index 6ca3fead..9c616e7a 100644
--- a/scripts/recan_bundle_tdr.py
+++ b/scripts/recan_bundle_tdr.py
@@ -388,7 +388,7 @@ def main(argv):
 
     dss_source = DSSSourceRef(id='',
                               spec=SimpleSourceSpec(prefix='',
-                                                    name=config.dss_endpoint))
+                                                    spec=config.dss_endpoint))
     dss_bundle = DSSBundle(fqid=SourcedBundleFQID(source=dss_source,
                                                   uuid=args.bundle_uuid,
                                                   version=''),
@@ -396,7 +396,7 @@ def main(argv):
                            metadata_files=metadata)
 
     tdr_source = TDRSourceRef(id=args.source_id,
-                              name=TDRSourceSpec(project='test_project',
+                              spec=TDRSourceSpec(project='test_project',
                                                  name='test_name',
                                                  is_snapshot=True))
     tdr_bundle = dss_bundle_to_tdr(dss_bundle, tdr_source)
diff --git a/src/azul/azulclient.py b/src/azul/azulclient.py
index ed64b55a..efd1c3af 100644
--- a/src/azul/azulclient.py
+++ b/src/azul/azulclient.py
@@ -293,7 +293,7 @@ class AzulClient(object):
         >>> AzulClient.filter_obsolete_bundle_versions([])
         []
         >>> from azul.indexer import SimpleSourceSpec, SourceRef
-        >>> s = SourceRef(id='i', spec=SimpleSourceSpec(prefix='42', name='n'))
+        >>> s = SourceRef(id='i', spec=SimpleSourceSpec(prefix='42', spec='n'))
         >>> def b(u, v):
         ...     return SourcedBundleFQID(source=s, uuid=u, version=v)
         >>> AzulClient.filter_obsolete_bundle_versions([
@@ -303,32 +303,32 @@ class AzulClient(object):
         ... ]) # doctest: +NORMALIZE_WHITESPACE
         [SourcedBundleFQID(uuid='c',
                            version='0',
-                           source=SourceRef(id='i', spec=SimpleSourceSpec(prefix='42', name='n'))),
+                           source=SourceRef(id='i', spec=SimpleSourceSpec(prefix='42', spec='n'))),
         SourcedBundleFQID(uuid='b',
                           version='3',
-                          source=SourceRef(id='i', spec=SimpleSourceSpec(prefix='42', name='n'))),
+                          source=SourceRef(id='i', spec=SimpleSourceSpec(prefix='42', spec='n'))),
         SourcedBundleFQID(uuid='a',
                           version='1',
-                          source=SourceRef(id='i', spec=SimpleSourceSpec(prefix='42', name='n')))]
+                          source=SourceRef(id='i', spec=SimpleSourceSpec(prefix='42', spec='n')))]
         >>> AzulClient.filter_obsolete_bundle_versions([
         ...     b('C', '0'), b('a', '1'), b('a', '0'),
         ...     b('a', '2'), b('b', '1'), b('c', '2')
         ... ]) # doctest: +NORMALIZE_WHITESPACE
         [SourcedBundleFQID(uuid='c',
                            version='2',
-                           source=SourceRef(id='i', spec=SimpleSourceSpec(prefix='42', name='n'))),
+                           source=SourceRef(id='i', spec=SimpleSourceSpec(prefix='42', spec='n'))),
         SourcedBundleFQID(uuid='b',
                            version='1',
-                           source=SourceRef(id='i', spec=SimpleSourceSpec(prefix='42', name='n'))),
+                           source=SourceRef(id='i', spec=SimpleSourceSpec(prefix='42', spec='n'))),
         SourcedBundleFQID(uuid='a',
                            version='2',
-                           source=SourceRef(id='i', spec=SimpleSourceSpec(prefix='42', name='n')))]
+                           source=SourceRef(id='i', spec=SimpleSourceSpec(prefix='42', spec='n')))]
         >>> AzulClient.filter_obsolete_bundle_versions([
         ...     b('a', '0'), b('A', '1')
         ... ]) # doctest: +NORMALIZE_WHITESPACE
         [SourcedBundleFQID(uuid='A',
                            version='1',
-                           source=SourceRef(id='i', spec=SimpleSourceSpec(prefix='42', name='n')))]
+                           source=SourceRef(id='i', spec=SimpleSourceSpec(prefix='42', spec='n')))]
         """
 
         # Sort lexicographically by source and FQID. I've observed the DSS
diff --git a/src/azul/indexer/__init__.py b/src/azul/indexer/__init__.py
index 8753d157..1e9aedbe 100644
--- a/src/azul/indexer/__init__.py
+++ b/src/azul/indexer/__init__.py
@@ -59,14 +59,14 @@ class SourceSpec(ABC, Generic[SOURCE_SPEC]):
     The name of a repository source containing bundles to index. A repository
     has at least one source. Repository plugins whose repository source names
     are structured might want to implement this abstract class. Plugins that
-    have simple unstructured names may want to use :class:`StringSourceName`.
+    have simple unstructured names may want to use :class:`SimpleSourceSpec`.
     """
 
     prefix: Optional[str] = ''
 
     @classmethod
     @abstractmethod
-    def parse(cls, name: str) -> SOURCE_SPEC:
+    def parse(cls, source: str) -> SOURCE_SPEC:
         raise NotImplementedError
 
     @abstractmethod
@@ -79,14 +79,14 @@ class SimpleSourceSpec(SourceSpec['SimpleSourceSpec']):
     """
     Default implementation for unstructured source names.
     """
-    name: str
+    spec: str
 
     @classmethod
-    def parse(cls, name: str) -> 'SimpleSourceSpec':
-        return cls(name=name)
+    def parse(cls, spec: str) -> 'SimpleSourceSpec':
+        return cls(spec=spec)
 
     def __str__(self) -> str:
-        return self.name
+        return self.spec
 
 
 SOURCE_REF = TypeVar('SOURCE_REF', bound='SourceRef')
@@ -133,8 +133,8 @@ class SourceRef(Generic[SOURCE_SPEC, SOURCE_REF]):
         Traceback (most recent call last):
         ...
         azul.RequirementError: ('Ambiguous source names for same ID.',
-                                SimpleSourceSpec(prefix='', name='a'),
-                                SimpleSourceSpec(prefix='', name='b'),
+                                SimpleSourceSpec(prefix='', spec='a'),
+                                SimpleSourceSpec(prefix='', v='b'),
                                 '1')
 
         Interning is done per class:
@@ -162,7 +162,7 @@ class SourceRef(Generic[SOURCE_SPEC, SOURCE_REF]):
             return self
 
     def to_json(self):
-        return dict(id=self.id, name=str(self.spec))
+        return dict(id=self.id, spec=str(self.spec))
 
 
 @attr.s(auto_attribs=True, frozen=True, kw_only=True, order=True)
diff --git a/src/azul/indexer/document.py b/src/azul/indexer/document.py
index 246fc2cb..9b2cc5ee 100644
--- a/src/azul/indexer/document.py
+++ b/src/azul/indexer/document.py
@@ -604,7 +604,7 @@ class DocumentSource(SourceRef[SimpleSourceSpec, SourceRef]):
 
     @classmethod
     def from_json(cls, source: JSON) -> 'DocumentSource':
-        return cls(id=source['id'], spec=SimpleSourceSpec(name=source['name']))
+        return cls(id=source['id'], spec=SimpleSourceSpec(spec=source['spec']))
 
 
 @dataclass
@@ -687,7 +687,7 @@ class Aggregate(Document[AggregateCoordinates]):
             'num_contributions': pass_thru_int,
             'sources': {
                 'id': pass_thru_str,
-                'name': pass_thru_str
+                'spec': pass_thru_str
             },
             'bundles': {
                 'uuid': pass_thru_str,
@@ -707,7 +707,7 @@ class Aggregate(Document[AggregateCoordinates]):
         return super().mandatory_source_fields() + [
             'num_contributions',
             'sources.id',
-            'sources.name',
+            'sources.spec',
         ]
 
     def to_json(self) -> JSON:
diff --git a/src/azul/indexer/index_controller.py b/src/azul/indexer/index_controller.py
index e728465c..ad9314e2 100644
--- a/src/azul/indexer/index_controller.py
+++ b/src/azul/indexer/index_controller.py
@@ -168,7 +168,7 @@ class IndexController:
         """
         match, source = notification['match'], notification['source']
         plugin = self.repository_plugin(catalog)
-        source = plugin.resolve_source(spec=source['name'], id=source['id'])
+        source = plugin.resolve_source(spec=source['spec'], id=source['id'])
         bundle_fqid = SourcedBundleFQID(source=source,
                                         uuid=match['bundle_uuid'],
                                         version=match['bundle_version'])
diff --git a/src/azul/plugins/metadata/hca/__init__.py b/src/azul/plugins/metadata/hca/__init__.py
index bfd85457..0ee0b547 100644
--- a/src/azul/plugins/metadata/hca/__init__.py
+++ b/src/azul/plugins/metadata/hca/__init__.py
@@ -200,7 +200,7 @@ class Plugin(MetadataPlugin):
             manifest={
                 "sources": {
                     "source_id": "id",
-                    "source_name": "name",
+                    "source_spec": "spec",
                 },
                 "bundles": {
                     "bundle_uuid": "uuid",
diff --git a/src/azul/plugins/repository/dss/__init__.py b/src/azul/plugins/repository/dss/__init__.py
index 815695b5..ed3c137d 100644
--- a/src/azul/plugins/repository/dss/__init__.py
+++ b/src/azul/plugins/repository/dss/__init__.py
@@ -80,7 +80,7 @@ class DSSSourceRef(SourceRef[SimpleSourceSpec, 'DSSSourceRef']):
         # within a document, which is helpful for testing.
         return cls(id=cls.id_from_name(endpoint),
                    spec=SimpleSourceSpec(prefix=config.dss_query_prefix,
-                                         name=endpoint))
+                                         spec=endpoint))
 
     @classmethod
     def id_from_name(cls, name: str) -> str:
diff --git a/src/azul/service/hca_response_v5.py b/src/azul/service/hca_response_v5.py
index a02d57c4..1d615274 100644
--- a/src/azul/service/hca_response_v5.py
+++ b/src/azul/service/hca_response_v5.py
@@ -259,7 +259,7 @@ class KeywordSearchResponse(AbstractResponse, EntryFetcher):
 
     def make_sources(self, entry):
         return [
-            {'sourceId': s['id'], 'sourceName': s['name']}
+            {'sourceId': s['id'], 'sourceName': s['spec']}
             for s in entry['sources']
         ]
 
diff --git a/src/azul/terra.py b/src/azul/terra.py
index 3c5f8770..4ae50895 100644
--- a/src/azul/terra.py
+++ b/src/azul/terra.py
@@ -84,7 +84,7 @@ class TDRSourceSpec(SourceSpec):
     _type_snapshot = 'snapshot'
 
     @classmethod
-    def parse(cls, source: str) -> 'TDRSourceSpec':
+    def parse(cls, spec: str) -> 'TDRSourceSpec':
         """
         Construct an instance from its string representation, using the syntax
         'tdr:{project}:{type}/{name}:{prefix}'.
@@ -121,7 +121,7 @@ class TDRSourceSpec(SourceSpec):
         azul.uuids.InvalidUUIDPrefixError: 'n32' is not a valid UUID prefix.
         """
         # BigQuery (and by extension the TDR) does not allow : or / in dataset names
-        service, project, name, prefix = source.split(':')
+        service, project, name, prefix = spec.split(':')
         type, name = name.split('/')
         assert service == 'tdr', service
         if type == cls._type_snapshot:
@@ -132,7 +132,7 @@ class TDRSourceSpec(SourceSpec):
             assert False, type
         validate_uuid_prefix(prefix)
         self = cls(prefix=prefix, project=project, name=name, is_snapshot=is_snapshot)
-        assert source == str(self), (source, self)
+        assert spec == str(self), (spec, self)
         return self
 
     @property
diff --git a/test/indexer/data/aaa96233-bf27-44c7-82df-b4dc15ad4d9d.2018-11-02T113344.698028Z.results.json b/test/indexer/data/aaa96233-bf27-44c7-82df-b4dc15ad4d9d.2018-11-02T113344.698028Z.results.json
index a8d9cf2d..bc3dbe7c 100644
--- a/test/indexer/data/aaa96233-bf27-44c7-82df-b4dc15ad4d9d.2018-11-02T113344.698028Z.results.json
+++ b/test/indexer/data/aaa96233-bf27-44c7-82df-b4dc15ad4d9d.2018-11-02T113344.698028Z.results.json
@@ -8,7 +8,7 @@
             "entity_id": "aaa96233-bf27-44c7-82df-b4dc15ad4d9d",
             "source": {
                 "id": "4b737739-4dc9-5d4b-9989-a4942047c91c",
-                "name": "test"
+                "spec": "test"
             },
             "contents": {
                 "samples": [
@@ -463,7 +463,7 @@
             "entity_id": "0c5ac7c0-817e-40d4-b1b1-34c3d5cfecdb",
             "source": {
                 "id": "4b737739-4dc9-5d4b-9989-a4942047c91c",
-                "name": "test"
+                "spec": "test"
             },
             "bundle_uuid": "aaa96233-bf27-44c7-82df-b4dc15ad4d9d",
             "bundle_version": "2018-11-02T113344.698028Z",
@@ -696,7 +696,7 @@
             "entity_id": "70d1af4a-82c8-478a-8960-e9028b3616ca",
             "source": {
                 "id": "4b737739-4dc9-5d4b-9989-a4942047c91c",
-                "name": "test"
+                "spec": "test"
             },
             "bundle_uuid": "aaa96233-bf27-44c7-82df-b4dc15ad4d9d",
             "bundle_version": "2018-11-02T113344.698028Z",
@@ -929,7 +929,7 @@
             "entity_id": "a21dc760-a500-4236-bcff-da34a0e873d2",
             "source": {
                 "id": "4b737739-4dc9-5d4b-9989-a4942047c91c",
-                "name": "test"
+                "spec": "test"
             },
             "bundle_uuid": "aaa96233-bf27-44c7-82df-b4dc15ad4d9d",
             "bundle_version": "2018-11-02T113344.698028Z",
@@ -1186,7 +1186,7 @@
             "entity_id": "e8642221-4c2c-4fd7-b926-a68bce363c88",
             "source": {
                 "id": "4b737739-4dc9-5d4b-9989-a4942047c91c",
-                "name": "test"
+                "spec": "test"
             },
             "bundle_uuid": "aaa96233-bf27-44c7-82df-b4dc15ad4d9d",
             "bundle_version": "2018-11-02T113344.698028Z",
@@ -1446,7 +1446,7 @@
             "sources": [
                 {
                     "id": "4b737739-4dc9-5d4b-9989-a4942047c91c",
-                    "name": "test"
+                    "spec": "test"
                 }
             ],
             "contents": {
@@ -1960,7 +1960,7 @@
             "sources": [
                 {
                     "id": "4b737739-4dc9-5d4b-9989-a4942047c91c",
-                    "name": "test"
+                    "spec": "test"
                 }
             ],
             "contents": {
@@ -2252,7 +2252,7 @@
             "sources": [
                 {
                     "id": "4b737739-4dc9-5d4b-9989-a4942047c91c",
-                    "name": "test"
+                    "spec": "test"
                 }
             ],
             "contents": {
@@ -2544,7 +2544,7 @@
             "sources": [
                 {
                     "id": "4b737739-4dc9-5d4b-9989-a4942047c91c",
-                    "name": "test"
+                    "spec": "test"
                 }
             ],
             "contents": {
@@ -2794,7 +2794,7 @@
             "sources": [
                 {
                     "id": "4b737739-4dc9-5d4b-9989-a4942047c91c",
-                    "name": "test"
+                    "spec": "test"
                 }
             ],
             "contents": {
@@ -3105,7 +3105,7 @@
             "entity_id": "412898c5-5b9b-4907-b07c-e9b89666e204",
             "source": {
                 "id": "4b737739-4dc9-5d4b-9989-a4942047c91c",
-                "name": "test"
+                "spec": "test"
             },
             "contents": {
                 "samples": [
@@ -3363,7 +3363,7 @@
             "sources": [
                 {
                     "id": "4b737739-4dc9-5d4b-9989-a4942047c91c",
-                    "name": "test"
+                    "spec": "test"
                 }
             ],
             "contents": {
diff --git a/test/service/test_manifest.py b/test/service/test_manifest.py
index 1d4ad36d..4c3f7a1e 100644
--- a/test/service/test_manifest.py
+++ b/test/service/test_manifest.py
@@ -185,7 +185,7 @@ class TestManifestEndpoints(ManifestTestCase, DSSUnitTestCase):
     def test_manifest(self):
         expected = [
             ('source_id', '4b737739-4dc9-5d4b-9989-a4942047c91c', '4b737739-4dc9-5d4b-9989-a4942047c91c'),
-            ('source_name', 'test', 'test'),
+            ('source_spec', 'test', 'test'),
             ('bundle_uuid', 'f79257a7-dfc6-46d6-ae00-ba4b25313c10', 'f79257a7-dfc6-46d6-ae00-ba4b25313c10'),
             ('bundle_version', '2018-09-14T133314.453337Z', '2018-09-14T133314.453337Z'),
             ('file_document_id', '89e313db-4423-4d53-b17e-164949acfa8f', '6c946b6c-040e-45cc-9114-a8b1454c8d20'),
@@ -518,7 +518,7 @@ class TestManifestEndpoints(ManifestTestCase, DSSUnitTestCase):
                 'bundle_uuid': '587d74b4-1075-4bbf-b96a-4d1ede0481b2',
                 'bundle_version': '2018-09-14T133314.453337Z',
                 'source_id': '4b737739-4dc9-5d4b-9989-a4942047c91c',
-                'source_name': 'test',
+                'source_spec': 'test',
                 'cell_suspension__provenance__document_id': '377f2f5a-4a45-4c62-8fb0-db9ef33f5cf0',
                 'cell_suspension__biomaterial_core__biomaterial_id': 'Q4_DEMO-cellsus_SAMN02797092',
                 'cell_suspension__estimated_cell_count': '',
@@ -615,7 +615,7 @@ class TestManifestEndpoints(ManifestTestCase, DSSUnitTestCase):
                 'bundle_uuid': 'aaa96233-bf27-44c7-82df-b4dc15ad4d9d',
                 'bundle_version': '2018-11-02T113344.698028Z',
                 'source_id': '4b737739-4dc9-5d4b-9989-a4942047c91c',
-                'source_name': 'test',
+                'source_spec': 'test',
                 'cell_suspension__provenance__document_id': '412898c5-5b9b-4907-b07c-e9b89666e204',
                 'cell_suspension__biomaterial_core__biomaterial_id': 'GSM2172585 1',
                 'cell_suspension__estimated_cell_count': '1',
@@ -729,7 +729,7 @@ class TestManifestEndpoints(ManifestTestCase, DSSUnitTestCase):
             'bundle_uuid',
             'bundle_version',
             'source_id',
-            'source_name',
+            'source_spec',
             'cell_suspension__provenance__document_id',
             'cell_suspension__biomaterial_core__biomaterial_id',
             'cell_suspension__estimated_cell_count',

@dsotirho-ucsc dsotirho-ucsc removed their assignment May 13, 2021
@amarjandu
Copy link
Contributor Author

amarjandu commented May 14, 2021

@hannes-ucsc from your original patch #2650 (comment) you requested that .name be changed to .spec, Was that modification to take place within SourceRef? or within SourceName/SourceSpec?

If changing the attribute of SourceName/SourceSpec access would look like; source.spec.spec which is a little weird. Just want to clarify this before moving forward with the patch from @danielsotirhos

@hannes-ucsc
Copy link
Member

hannes-ucsc commented May 17, 2021

When a variable or attribute references a value that is an instance of SourceSpec, that variable or attribute should be called spec or something derived from that, like foo_spec or bar_spec. When a variable or attribute references a value that is NOT an instance of SourceSpec (or something that wholly represents such an instance, like the JSON representation of such an instance), that variable or attribute should NOT be called spec or something derived from that, like foo_spec or bar_spec.

We're doing this to move away from source.name.name and source.spec.spec is just another incarnation of the same problem.

@amarjandu amarjandu force-pushed the issues/amar/2843-mv-spec branch 3 times, most recently from 3a755be to 0608a72 Compare May 18, 2021 22:42
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.

LGTM.
Has this been deployed to you personal deployment and reindexed to confirm things still work?

"""
The name of a repository source containing bundles to index. A repository
has at least one source. Repository plugins whose repository source names
are structured might want to implement this abstract class. Plugins that
have simple unstructured names may want to use :class:`StringSourceName`.
have simple unstructured names may want to use :class:`StringSourceSpec`.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
have simple unstructured names may want to use :class:`StringSourceSpec`.
have simple unstructured names may want to use :class:`SimpleSourceSpec`.

There is no StringSourceSpec.

@dsotirho-ucsc dsotirho-ucsc removed their assignment May 19, 2021
@amarjandu
Copy link
Contributor Author

amarjandu commented May 19, 2021

LGTM.
Has this been deployed to you personal deployment and reindexed to confirm things still work?

Been testing things out this morning, so far we look good... shall confirm before requesting primary review.

edit*
make reindex and make integration_test both pass :)

@amarjandu amarjandu added the reindex:dev [process] PR requires reindexing dev label May 19, 2021
@amarjandu
Copy link
Contributor Author

@hannes-ucsc
There was a failure in the unittests for the sandbox see https://gitlab.dev.singlecell.gi.ucsc.edu/ucsc/azul/-/jobs/21920#L5967.

The sandbox still has AZUL_DSS_QUERY_PREFIX being set https://github.com/DataBiosphere/azul/blob/develop/deployments/sandbox/environment.py#L99 which causes the ES index to use it when creating the SourceSpec for the test catalog.
Screen Shot 2021-06-10 at 4 26 41 PM

We can also patch/modify the results of the canned bundled to match the SourceSpec of each deployment.

Might be a good time to bring up #2667, with a parent deployment being shared with the sandbox, this might have been caught earlier.

@amarjandu
Copy link
Contributor Author

Pulling this, need to update to include CannedStagingArea plugin as well...

@amarjandu
Copy link
Contributor Author

@hannes-ucsc please note the additional changes to the canned repository plugin.

@@ -821,7 +821,7 @@ def test_projects_key_search_response(self):
],
"sources": [{
"sourceId": "4b737739-4dc9-5d4b-9989-a4942047c91c",
"sourceName": "test"
"sourceSpec": "test:"
Copy link
Member

Choose a reason for hiding this comment

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

@jessebrennan jessebrennan added the sandbox [process] Resolution is being verified in sandbox deployment label Jun 17, 2021
@jessebrennan jessebrennan merged commit 3cddef4 into develop Jun 18, 2021
@jessebrennan jessebrennan deleted the issues/amar/2843-mv-spec branch June 18, 2021 17:14
@jessebrennan jessebrennan restored the issues/amar/2843-mv-spec branch June 18, 2021 19:19
@jessebrennan
Copy link
Contributor

Failures after reindexing dev:

40733888-3b9f-500e-84fd-1a18a64aadbe
94565940-7b2f-5fd7-beb1-dc309687fe09
9d0f5cd1-0ef6-5eed-8dd7-f15d36a34185
ae338c4e-650f-545b-8631-3c8d755aa2f9
c12a6ca2-3234-5182-ad0b-f8c2fb881ab5

Which match the expected failures from #2870 and #2873.

@jessebrennan jessebrennan removed their assignment Jun 21, 2021
@hannes-ucsc hannes-ucsc deleted the issues/amar/2843-mv-spec branch January 6, 2022 02:10
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.

6 participants