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

3591: list facet API fix #3630

Merged
merged 6 commits into from
Feb 22, 2017
Merged

3591: list facet API fix #3630

merged 6 commits into from
Feb 22, 2017

Conversation

pameyer
Copy link
Contributor

@pameyer pameyer commented Feb 10, 2017

RFI Checklist

Before submitting the pull request, fill out sections (1.) Related Issues and (2.) Pull Request Checklist.

1. Related Issues


2. Pull Request Checklist

  • Functionality completed as described in FRD
  • Dependencies, risks, assumptions in FRD addressed
  • Unit tests completed
  • Deployment requirements identified (e.g., SQL scripts, indexing)
  • Documentation completed
  • All code checkins completed

3. Review Checklist

After the pull request has been submitted, fill out this section.

  • Code review completed or waived
  • Testing requirements completed
  • Usability testing completed or waived
  • Support testing completed or waived
  • Merged with develop branch and resolved conflicts

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.0009%) to 9.601% when pulling 8151c9b on pameyer:exp-fix_facet_api into 7162f5a on IQSS:develop.

Copy link
Member

@pdurbin pdurbin left a comment

Choose a reason for hiding this comment

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

Thanks for taking a look at #3591 @pameyer!

public Response listFacets( @PathParam("identifier") String dvIdtf ) {
return allowCors(response( req -> ok(
execCommand(new ListFacetsCommand(req, findDataverseOrDie(dvIdtf)) )
Copy link
Member

Choose a reason for hiding this comment

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

The removal of the ListFacetsCommand makes me wonder if the permissions at https://github.com/IQSS/dataverse/blob/v4.6/src/main/java/edu/harvard/iq/dataverse/engine/command/impl/ListFacetsCommand.java#L37 should be included. It looks like they checked if the dataverse is published or not.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point - I'll switch it to ListFacetsCommand (assuming that's not the source of the problem).

* (not publicly documented) API endpoint for assigning facets to a dataverse.
* `curl -X POST -H "X-Dataverse-key: $ADMIN_KEY" http://localhost:8088/api/dataverses/$dv/facets --upload-file foo.json`; where foo.json contains a list of datasetField names,
* works as expected (judging by the UI).
* This triggers a 500 when '-d @foo.json' is used.
Copy link
Member

Choose a reason for hiding this comment

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

It's probably worth spending a few minutes looking into this 500 error.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This looks to me like the usual case where some API's expect form data, and some expect upload-file within the form data - it may make more sense note this for API consistency and defer until there's a systematic check of what endpoints should be getting.

@@ -342,15 +343,35 @@ public Response setMetadataRoot( @PathParam("identifier")String dvIdtf, String b

@GET
@Path("{identifier}/facets/")
/**
* return list of facets for the dataverse with alias `dvIdtf`
*/
public Response listFacets( @PathParam("identifier") String dvIdtf ) {
Copy link
Member

Choose a reason for hiding this comment

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

It would be nice to add at least one test to https://github.com/IQSS/dataverse/blob/v4.6/src/test/java/edu/harvard/iq/dataverse/api/DataversesIT.java to make sure this API doesn't stop working again. (I assume it worked once upon a time.)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree that it'd be good to have (I assume it worked once upon a time as well); but the logic of setting up those tests wasn't too clear to me on initial reading (I'm also not sure if those are RestAssured tests that I'm not setup to run locally or not).

Copy link
Member

Choose a reason for hiding this comment

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

You're off the hook on REST Assured tests until I document how to set up a dev environment to run them, which I'd like to to as part of #3431. The short of it is that you have to run setup-all.sh --insecure like in https://github.com/IQSS/dataverse/blob/v4.6/scripts/deploy/phoenix.dataverse.org/post#L3

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.001%) to 9.601% when pulling 4190f6b on pameyer:exp-fix_facet_api into 7162f5a on IQSS:develop.

@pameyer
Copy link
Contributor Author

pameyer commented Feb 13, 2017

switched back to using command pattern; and added some javadoc for the command (4190f6b is the latest).

@sekmiller
Copy link
Contributor

Ready for QA

@kcondon kcondon merged commit 5aeb54a into IQSS:develop Feb 22, 2017
@pdurbin pdurbin added this to the 4.6.1 - ORCID and File Replace milestone Mar 9, 2017
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