Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@kathy-t
Copy link
Contributor

@kathy-t kathy-t commented Jan 16, 2025

Description
UI PR: dockstore/dockstore-ui2#2055

This PR sets the lastModified and selected_concept_doi fields of the ElasticSearch object so we can display them in the new search cards.

Review Instructions
See dockstore/dockstore-ui2#2055

Issue
#5726
https://ucsc-cgl.atlassian.net/browse/DOCK-2482

Security and Privacy

If there are any concerns that require extra attention from the security team, highlight them here and check the box when complete.

  • Security and Privacy assessed

e.g. Does this change...

  • Any user data we collect, or data location?
  • Access control, authentication or authorization?
  • Encryption features?

Please make sure that you've checked the following before submitting your pull request. Thanks!

  • Check that you pass the basic style checks and unit tests by running mvn clean install
  • Ensure that the PR targets the correct branch. Check the milestone or fix version of the ticket.
  • Follow the existing JPA patterns for queries, using named parameters, to avoid SQL injection
  • If you are changing dependencies, check the Snyk status check or the dashboard to ensure you are not introducing new high/critical vulnerabilities
  • Assume that inputs to the API can be malicious, and sanitize and/or check for Denial of Service type values, e.g., massive sizes
  • Do not serve user-uploaded binary images through the Dockstore API
  • Ensure that endpoints that only allow privileged access enforce that with the @RolesAllowed annotation
  • Do not create cookies, although this may change in the future
  • If this PR is for a user-facing feature, create and link a documentation ticket for this feature (usually in the same milestone as the linked issue). Style points if you create a documentation PR directly and link that instead.

@kathy-t kathy-t self-assigned this Jan 16, 2025
@codecov
Copy link

codecov bot commented Jan 16, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 74.44%. Comparing base (43541a2) to head (2bf1c6c).
Report is 1 commits behind head on develop.

Additional details and impacted files
@@            Coverage Diff             @@
##             develop    #6071   +/-   ##
==========================================
  Coverage      74.43%   74.44%           
- Complexity      5636     5637    +1     
==========================================
  Files            386      386           
  Lines          20196    20201    +5     
  Branches        2086     2086           
==========================================
+ Hits           15033    15038    +5     
  Misses          4166     4166           
  Partials         997      997           
Flag Coverage Δ
bitbuckettests 26.15% <66.66%> (+0.01%) ⬆️
hoverflytests 27.60% <100.00%> (+0.02%) ⬆️
integrationtests 55.96% <66.66%> (+<0.01%) ⬆️
languageparsingtests 10.86% <66.66%> (+0.02%) ⬆️
localstacktests 21.28% <66.66%> (+0.01%) ⬆️
toolintegrationtests 29.91% <66.66%> (+0.01%) ⬆️
unit-tests_and_non-confidential-tests 26.40% <66.66%> (+0.01%) ⬆️
workflowintegrationtests 37.58% <66.66%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@kathy-t kathy-t changed the title Feature/5726/search cards Add lastModified and selected_concept_doi to elastic search object for search cards Jan 16, 2025
objectNode.set("all_authors", MAPPER.valueToTree(allAuthors));
objectNode.set("categories", MAPPER.valueToTree(convertCategories(entry.getCategories())));
objectNode.put("archived", entry.isArchived());
objectNode.put("selected_concept_doi", MAPPER.valueToTree(selectedConceptDoi));
Copy link
Contributor

Choose a reason for hiding this comment

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

This works, but it seems like the current intended use of the various ObjectNode.puts is to set a field to a particular non-JsonNode value. To that end, the above variety of put, which sets a field to a JsonNode value, appears to be deprecated:
https://www.javadoc.io/static/com.fasterxml.jackson.core/jackson-databind/2.18.2/com/fasterxml/jackson/databind/node/ObjectNode.html#put-java.lang.String-com.fasterxml.jackson.databind.JsonNode-
Probably better to use a set here.

return selectedDoi;
}
return null;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Could put this method in Entry instead, it seems like a helper ala Entry.getDefaultConceptDoi.

Copy link
Member

@denis-yuen denis-yuen left a comment

Choose a reason for hiding this comment

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

with above suggestions

@sonarqubecloud
Copy link

@kathy-t kathy-t merged commit 2d8c858 into develop Jan 27, 2025
20 checks passed
@kathy-t kathy-t deleted the feature/5726/search-cards branch January 27, 2025 16:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants