Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

MMT-3559: As a user, I can see how many tags are associated to published collection #99

Merged
merged 6 commits into from
Mar 7, 2024

Conversation

dmistry1
Copy link
Contributor

@dmistry1 dmistry1 commented Mar 4, 2024

Overview

In MMT, we need to know the number of tags that are associated to a given collection. In the current GraphQL implementation we can get the tag keys using the CollectionList query but in MMT we also need to know the tag description and originator id.

What is the Solution?

Added a new tagDefinitions type that will call the /tag endpoint in CMR to retrieve the tag information for a given tag key/keys. https://cmr.sit.earthdata.nasa.gov/search/site/docs/search/api.html#searching-for-tags.

What areas of the application does this impact?

List impacted areas.

Testing

Reproduction steps

Single tagDefinition

query TagDefinitions($params: TagDefinitionsInput) {
  tagDefinitions(params: $params) {
    items {
      conceptId
      description
      tagKey
      originatorId
    }
  }
}

Variables

{
  "params": {
    "tagKey":[
      "edsc.extra.serverless.collection_capabilities"
    ]
  }
}

Collections with tagDefintions

query Collections($params: CollectionsInput) {
  collections(params: $params) {
    items {
      tags,
      tagDefinitions {
        items {
          conceptId
          tagKey
          revisionId
          originatorId
          description
        }
      }
    }
  }
}

Variables

{
  "params": {
    "includeTags": "*",
    "conceptId": "C1200459781-MMT_1"
  }
}

Attachments

image
image

Checklist

  • I have added automated tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings

Copy link

codecov bot commented Mar 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (ea4de5c) to head (57e9294).

Additional details and impacted files
@@            Coverage Diff            @@
##              main       #99   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           73        77    +4     
  Lines         1627      1690   +63     
  Branches       215       219    +4     
=========================================
+ Hits          1627      1690   +63     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@dmistry1 dmistry1 merged commit 1b9c482 into main Mar 7, 2024
8 checks passed
@dmistry1 dmistry1 deleted the MMT-3559 branch March 7, 2024 19:38
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants