BulkTag via Community APIs #354

Manually merged
claudio.atzori merged 0 commits from bulkTag into master 2023-11-03 12:52:15 +01:00

This PR presents an implementation of the bulk tagging done exploiting the community apis instead of the IS.

The isLookupUrl parameter is no more needed.
One parameter is added: production of type boolean to switch between the API in production and in beta

This PR presents an implementation of the bulk tagging done exploiting the community apis instead of the IS. The isLookupUrl parameter is no more needed. One parameter is added: `production` of type boolean to switch between the API in production and in beta
miriam.baglioni added 15 commits 2023-10-23 12:19:44 +02:00
claudio.atzori was assigned by miriam.baglioni 2023-10-23 12:20:22 +02:00
claudio.atzori requested changes 2023-10-25 15:42:40 +02:00
claudio.atzori left a comment
Owner

I assume the procedure was tested by running the oozie workflow manually and verifying its output, so I'm not going to comment on that part but, although I understand the difficulties in automating the tests, we should try to do better in implementing the unit testing. I left some comments on this regard, so please let me know to what extent they can be addressed.

I assume the procedure was tested by running the oozie workflow manually and verifying its output, so I'm not going to comment on that part but, although I understand the difficulties in automating the tests, we should try to do better in implementing the unit testing. I left some comments on this regard, so please let me know to what extent they can be addressed.
@ -16,3 +16,3 @@
private final String URL_STRING = "https://sandbox.zenodo.org/api/deposit/depositions";
private final String ACCESS_TOKEN = "";
private final String ACCESS_TOKEN = "OzzOsyucEIHxCEfhlpsMo3myEiwpCza3trCRL7ddfGTAK9xXkIP2MbXd6Vg4";

I'm not sure it is a good idea to hardcode the access token in the project source files.

I'm not sure it is a good idea to hardcode the access token in the project source files.
Author
Member

It is of course not :)

It is of course not :)
@ -109,0 +113,4 @@
Assertions.assertEquals(201, client.newDeposition());
File file = new File("/Users/miriam.baglioni/Desktop/EOSC_DUMP/publication.tar");

avoid referring to your local filesystem

avoid referring to your local filesystem
@ -0,0 +13,4 @@
* @author miriam.baglioni
* @Date 06/10/23
*/
public class QueryCommunityAPI {

Unit tests should not interact with remote endpoints (see point 7 here). To test the new API consider to exploit the annotation

org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest

used in the CommunityApiControllerTest.

Unit tests should not interact with remote endpoints (see point 7 [here](https://brightsec.com/blog/unit-testing-best-practices/)). To test the new API consider to exploit the annotation ``` org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest ``` used in the [CommunityApiControllerTest](https://code-repo.d4science.org/D-Net/dnet-applications/src/branch/master/apps/dnet-exporter-api/src/test/java/eu/dnetlib/openaire/community/CommunityApiControllerTest.java).
Author
Member

Thanks for the suggestion. I will implement the testing following that trace

Thanks for the suggestion. I will implement the testing following that trace
Author
Member

Yes, I have run it on the cluster and verified only that the numbers are "more or less" the same. This is because with the API the configuration can change from a run to another, while what we have done and is on the graph is frozen at a given moment in time

The testing was done in a hurry, just to verify some functionalities. It was not intended to be left like that. I should have removed it before issuing the PR.

I have to remove from common the code related to the Zenodo APIs because I have model it on the dump project (It is used there alone)

Yes, I have run it on the cluster and verified only that the numbers are "more or less" the same. This is because with the API the configuration can change from a run to another, while what we have done and is on the graph is frozen at a given moment in time The testing was done in a hurry, just to verify some functionalities. It was not intended to be left like that. I should have removed it before issuing the PR. I have to remove from common the code related to the Zenodo APIs because I have model it on the dump project (It is used there alone)
miriam.baglioni added 1 commit 2023-10-26 09:38:22 +02:00
claudio.atzori added this to the OpenAIRE project 2023-10-26 09:40:44 +02:00
claudio.atzori modified the project from OpenAIRE to OpenAIRE - DNet 2023-10-26 09:58:28 +02:00
claudio.atzori manually merged commit 5f1ed61c1f into master 2023-11-03 12:52:15 +01:00

This PR presents an implementation of the bulk tagging done exploiting the community apis instead of the IS.

The isLookupUrl parameter is no more needed.
One parameter is added: production of type boolean to switch between the API in production and in beta

I realised now that base URL to the new API implementations available in the beta and prod environments are hardcoded and the production parameter allows to select among the two. Please consider to factor it out in a subsequent PR: having the possibility to define the API base URL fits well with the definition of a test case where the API server application is mocked locally.

> This PR presents an implementation of the bulk tagging done exploiting the community apis instead of the IS. > > The isLookupUrl parameter is no more needed. > One parameter is added: `production` of type boolean to switch between the API in production and in beta I realised now that base URL to the new API implementations available in the beta and prod environments are hardcoded and the `production` parameter allows to select among the two. Please consider to factor it out in a subsequent PR: having the possibility to define the API base URL fits well with the definition of a test case where the API server application is mocked locally.
Sign in to join this conversation.
No description provided.