diff --git a/.github/workflows/checkstyle.yml b/.github/workflows/checkstyle.yml deleted file mode 100644 index 0b5bc6a..0000000 --- a/.github/workflows/checkstyle.yml +++ /dev/null @@ -1,18 +0,0 @@ -# SPDX-FileCopyrightText: 2024 PNED G.I.E. -# -# SPDX-License-Identifier: Apache-2.0 - -name: reviewdog -on: [pull_request] -jobs: - checkstyle: - name: runner / checkstyle - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: dbelyaev/action-checkstyle@master - with: - github_token: ${{ secrets.github_token }} - reporter: github-pr-review - level: warning - checkstyle_config: eclipse-java-google-style.xml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4a03f5a..3d227f5 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -18,7 +18,7 @@ jobs: with: java-version: '21' - name: Run the Maven - run: mvn --batch-mode --update-snapshots verify + run: mvn --batch-mode --update-snapshots verify checkstyle:check reuse: runs-on: ubuntu-latest permissions: diff --git a/CHANGELOG.md b/CHANGELOG.md index 9accd60..0f5e0a3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added +- Dynamic API source-code generation, with openapi-generator-maven-plugin (v7.2.0). +- Default Quarkus (v3.7.2) configuration. +- Static API docs following OpenAPI specification, v3.0.3. + ### Changed ### Deprecated diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d0f15ea..fb415bc 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -37,7 +37,7 @@ All types of contributions are encouraged and valued. See the [Table of Contents ## Code of Conduct This project and everyone participating in it is governed by the -[GDI User Portal Front-end Code of Conduct](https://github.com/GenomicDataInfrastructure/oss-project-template/blob/master/CODE_OF_CONDUCT.md). +[GDI User Portal Front-end Code of Conduct](https://github.com/GenomicDataInfrastructure/gdi-userportal-access-management-service/blob/master/CODE_OF_CONDUCT.md). By participating, you are expected to uphold this code. Please report unacceptable behavior to <>. @@ -45,31 +45,16 @@ to <>. > If you want to ask a question, we assume that you have read the available [Documentation](https://genomicdatainfrastructure.github.io/gdi-userportal-docs/). -Before you ask a question, it is best to search for existing [Issues](https://github.com/GenomicDataInfrastructure/oss-project-template/issues) that might help you. In case you have found a suitable issue and still need clarification, you can write your question in this issue. It is also advisable to search the internet for answers first. +Before you ask a question, it is best to search for existing [Issues](https://github.com/GenomicDataInfrastructure/gdi-userportal-access-management-service/issues) that might help you. In case you have found a suitable issue and still need clarification, you can write your question in this issue. It is also advisable to search the internet for answers first. If you then still feel the need to ask a question and need clarification, we recommend the following: -- Open an [Issue](https://github.com/GenomicDataInfrastructure/oss-project-template/issues/new). +- Open an [Issue](https://github.com/GenomicDataInfrastructure/gdi-userportal-access-management-service/issues/new). - Provide as much context as you can about what you're running into. - Provide project and platform versions (nodejs, npm, etc), depending on what seems relevant. We will then take care of the issue as soon as possible. - - ## I Want To Contribute > ### Legal Notice @@ -86,7 +71,7 @@ A good bug report shouldn't leave others needing to chase you up for more inform - Make sure that you are using the latest version. - Determine if your bug is really a bug and not an error on your side e.g. using incompatible environment components/versions (Make sure that you have read the [documentation](https://genomicdatainfrastructure.github.io/gdi-userportal-docs/). If you are looking for support, you might want to check [this section](#i-have-a-question)). -- To see if other users have experienced (and potentially already solved) the same issue you are having, check if there is not already a bug report existing for your bug or error in the [bug tracker](https://github.com/GenomicDataInfrastructure/oss-project-template/labels/bug) +- To see if other users have experienced (and potentially already solved) the same issue you are having, check if there is not already a bug report existing for your bug or error in the [bug tracker](https://github.com/GenomicDataInfrastructure/gdi-userportal-access-management-service/labels/bug) - Also make sure to search the internet (including Stack Overflow) to see if users outside of the GitHub community have discussed the issue. - Collect information about the bug: - Stack trace (Traceback) @@ -105,7 +90,7 @@ A good bug report shouldn't leave others needing to chase you up for more inform We use GitHub issues to track bugs and errors. If you run into an issue with the project: -- Open an [Issue](https://github.com/GenomicDataInfrastructure/oss-project-template/issues/new). (Since we can't be sure at this point whether it is a bug or not, we ask you not to talk about a bug yet and not to label the issue.) +- Open an [Issue](https://github.com/GenomicDataInfrastructure/gdi-userportal-access-management-service/issues/new). (Since we can't be sure at this point whether it is a bug or not, we ask you not to talk about a bug yet and not to label the issue.) - Explain the behavior you would expect and the actual behavior. - Please provide as much context as possible and describe the _reproduction steps_ that someone else can follow to recreate the issue on their own. This usually includes your code. For good bug reports you should isolate the problem and create a reduced test case. - Provide the information you collected in the previous section. @@ -116,8 +101,6 @@ Once it's filed: - A team member will try to reproduce the issue with your provided steps. If there are no reproduction steps or no obvious way to reproduce the issue, the team will ask you for those steps and mark the issue as `needs-repro`. Bugs with the `needs-repro` tag will not be addressed until they are reproduced. - If the team is able to reproduce the issue, it will be marked `needs-fix`, as well as possibly other tags (such as `critical`), and the issue will be left to be [implemented by someone](#your-first-code-contribution). - - ### Suggesting Enhancements This section guides you through submitting an enhancement suggestion for GDI User Portal Front-end, **including completely new features and minor improvements to existing functionality**. Following these guidelines will help maintainers and the community to understand your suggestion and find related suggestions. @@ -127,51 +110,108 @@ This section guides you through submitting an enhancement suggestion for GDI Use #### Before Submitting an Enhancement - Make sure that you are using the latest version. -- Read the [documentation](https://TODO/) carefully and find out if the functionality is already covered, maybe by an individual configuration. -- Perform a [search](https://github.com/GenomicDataInfrastructure/oss-project-template/issues) to see if the enhancement has already been suggested. If it has, add a comment to the existing issue instead of opening a new one. +- Read the [documentation](https://genomicdatainfrastructure.github.io/gdi-userportal-docs/) carefully and find out if the functionality is already covered, maybe by an individual configuration. +- Perform a [search](https://github.com/GenomicDataInfrastructure/gdi-userportal-access-management-service/issues) to see if the enhancement has already been suggested. If it has, add a comment to the existing issue instead of opening a new one. - Find out whether your idea fits with the scope and aims of the project. It's up to you to make a strong case to convince the project's developers of the merits of this feature. Keep in mind that we want features that will be useful to the majority of our users and not just a small subset. If you're just targeting a minority of users, consider writing an add-on/plugin library. #### How Do I Submit a Good Enhancement Suggestion? -Enhancement suggestions are tracked as [GitHub issues](https://github.com/GenomicDataInfrastructure/oss-project-template/issues). +Enhancement suggestions are tracked as [GitHub issues](https://github.com/GenomicDataInfrastructure/gdi-userportal-access-management-service/issues). - Use a **clear and descriptive title** for the issue to identify the suggestion. - Provide a **step-by-step description of the suggested enhancement** in as many details as possible. - **Describe the current behavior** and **explain which behavior you expected to see instead** and why. At this point you can also tell which alternatives do not work for you. -- You may want to **include screenshots and animated GIFs** which help you demonstrate the steps or point out the part which the suggestion is related to. You can use [this tool](https://www.cockos.com/licecap/) to record GIFs on macOS and Windows, and [this tool](https://github.com/colinkeenan/silentcast) or [this tool](https://github.com/GNOME/byzanz) on Linux. - **Explain why this enhancement would be useful** to most GDI User Portal Front-end users. You may also want to point out the other projects that solved it better and which could serve as inspiration. - - ### Your First Code Contribution - +To contribute to this project, you will need to set up your development environment. Here are the steps to get started: -### Improving The Documentation +1. **Clone the repository**: Start by cloning the project repository to your local machine using the following command: - +2. **Install dependencies**: Navigate to the project directory and install the required dependencies using npm. Run the following command: + +```bash +% cd gdi-userportal-access-management-service +% mvn clean package +``` + +3. **Configure environment variables**: The project may require certain environment variables to be set. Check the project documentation or ask the project team for the required variables and their values. + +4. **Set up your IDE**: Open the project in your preferred Integrated Development Environment (IDE). We are using VSCode with the following extensions: +- Extension Pack for Java +- OpenAPI (Swagger) Editor +- REST Client +- Quarkus +- Java Google Format + +5. **Start the development server**: Once your environment is set up, you can start the development server to preview and test your changes. Run the following command: + +```bash +mvn compile quarkus:dev +``` + +This will start the development server. + +#### Getting Started + +To get started with contributing to this project, follow these steps: + +1. **Familiarize yourself with the project**: Read the project documentation and familiarize yourself with the project structure, code conventions, and existing features. + +2. **Choose an issue to work on**: Browse the project's issue tracker and choose an issue that you would like to work on. Make sure to check if the issue is already assigned to someone else or if it has been marked as "help wanted" or "good first issue" for new contributors. + +3. **Create a new branch**: Create a new branch for your changes based on the latest `main` branch. Use a descriptive branch name that reflects the issue you are working on. For example: + +```bash +git checkout -b fix-bug-123 +``` + +4. **Make your changes**: Implement the necessary changes to address the issue you have chosen. Follow the project's coding conventions and styleguides. + +5. **Test your changes**: Before submitting your changes, make sure to test them thoroughly. Run the project's test suite and verify that all existing tests pass. If necessary, write new tests to cover your changes. + +6. **Commit and push your changes**: Once you are satisfied with your changes, commit them to your branch and push them to the remote repository. Use a clear and descriptive commit message to explain your changes. + +```bash +git add . +git commit -m "Fix bug #123: Description of the fix" +git push origin fix-bug-123 +``` + +7. **Create a pull request**: Go to the project's repository on GitHub and create a new pull request. Provide a clear and detailed description of your changes, including any relevant context or screenshots. + +8. **Review and address feedback**: The project team will review your pull request and provide feedback or suggestions for improvement. Make the necessary changes based on the feedback received. + +9. **Merge your changes**: Once your pull request has been approved, it will be merged into the main branch. Congratulations on your contribution! + +Please note that these instructions are general guidelines and may vary depending on the specific project. Make sure to consult the project's documentation and communicate with the project team for any project-specific instructions or requirements. ## Styleguides ### Commit Messages - +### Java Styleguide -## Join The Project Team +All Java code is following [Google checkstyle](./eclipse-java-google-style.xml). - +### License and Copyrights - +We are [REUSE](https://reuse.software/) compliant. All files must contain copyrights and license on the header. ## Attribution diff --git a/README.md b/README.md index 4bef7d2..94423bf 100644 --- a/README.md +++ b/README.md @@ -11,11 +11,29 @@ SPDX-License-Identifier: CC-BY-4.0 [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=GenomicDataInfrastructure_gdi-userportal-access-management-service&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=GenomicDataInfrastructure_gdi-userportal-access-management-service) [![GitHub contributors](https://img.shields.io/github/contributors/GenomicDataInfrastructure/gdi-userportal-access-management-service)](https://github.com/GenomicDataInfrastructure/gdi-userportal-access-management-service/graphs/contributors) [![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg)](code_of_conduct.md) -# gdi-userportal-access-management-service -This project uses Quarkus, the Supersonic Subatomic Java Framework. +
+ Genomic Data Infrastructure Logo +
-If you want to learn more about Quarkus, please visit its website: https://quarkus.io/ . +# GDI User Portal - Access Management Service + +The GDI User Portal Access Request Service is a crucial component of the Genomic Data Infrastructure (GDI) project, which aims to facilitate access to genomic, phenotypic, and clinical data across Europe. The GDI project is committed to establishing a federated, sustainable, and secure infrastructure to enable seamless data access. Leveraging the outcomes of the Beyond 1 Million Genomes (B1MG) project, the GDI project is actively realizing the ambitious goals set forth by the 1+Million Genomes (1+MG) initiative. + +The GDI User Portal Access Request Service serves as an interface between User Portal and the data authorities. It is developed using [Quarkus](https://quarkus.io/) version 3.7.2 and [GraalVM](https://www.graalvm.org/) for Java 21. This application plays a crucial role in enabling access request integration between the Data User and different Data Authorities. + +- **Status**: 0.0.0 +- **Related Project**: [1+ Million Genomes Project](https://gdi.onemilliongenomes.eu/) + +## Installation + +Ensure you have [Maven](https://maven.apache.org/) and [GraalVM](https://www.graalvm.org/) installed in your machine. We recommend to use [SDKMAN!](https://sdkman.io/). + +```shell script +sdk install java 21.0.2-graal +sdk install maven 3.9.6 +echo -e "\nexport GRAALVM_HOME="$HOME/.sdkman/candidates/java/21.0.2-graal/" >> $HOME/.zprofile +``` ## Running the application in dev mode @@ -51,19 +69,16 @@ You can create a native executable using: mvn package -Dnative ``` -Or, if you don't have GraalVM installed, you can run the native executable build in a container using: -```shell script -mvn package -Dnative -Dquarkus.native.container-build=true -``` - -You can then execute your native executable with: `./target/code-with-quarkus-1.0.0-SNAPSHOT-runner` +You can then execute your native executable with: `./target/*-runner` If you want to learn more about building native executables, please consult https://quarkus.io/guides/maven-tooling. -## Provided Code +## Running tests -### RESTEasy Reactive +All tests are automatically executed when you build a new package. -Easily start your Reactive RESTful Web Services +## License -[Related guide section...](https://quarkus.io/guides/getting-started-reactive#reactive-jax-rs-resources) +- All original source code is licensed under [Apache-2.0](./LICENSES/Apache-2.0.txt). +- All documentation is licensed under [CC-BY-4.0](./LICENSES/CC-BY-4.0.txt). +- For more accurate information, check the individual files. diff --git a/eclipse-java-google-style.xml b/eclipse-java-google-style.xml deleted file mode 100644 index 7bb6804..0000000 --- a/eclipse-java-google-style.xml +++ /dev/null @@ -1,337 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/eclipse-java-google-style.xml.license b/eclipse-java-google-style.xml.license deleted file mode 100644 index a6df6eb..0000000 --- a/eclipse-java-google-style.xml.license +++ /dev/null @@ -1,3 +0,0 @@ -SPDX-FileCopyrightText: 2024 Google LLC - -SPDX-License-Identifier: Apache-2.0 diff --git a/gdi_logo.svg b/gdi_logo.svg new file mode 100644 index 0000000..b0f80ab --- /dev/null +++ b/gdi_logo.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/gdi_logo.svg.license b/gdi_logo.svg.license new file mode 100644 index 0000000..81ef9dc --- /dev/null +++ b/gdi_logo.svg.license @@ -0,0 +1,3 @@ +SPDX-FileCopyrightText: Genomic Data Infrastructure + +SPDX-License-Identifier: CC-BY-4.0 diff --git a/pom.xml b/pom.xml index bbcbcb6..87d3a78 100644 --- a/pom.xml +++ b/pom.xml @@ -25,6 +25,7 @@ SPDX-License-Identifier: Apache-2.0 3.2.5 3.25.3 1.18.30 + 3.3.1 @@ -181,6 +182,21 @@ SPDX-License-Identifier: Apache-2.0 + + org.apache.maven.plugins + maven-checkstyle-plugin + ${checkstyle-maven-plugin.version} + + google_checks.xml + + + + + check + + + + @@ -197,4 +213,4 @@ SPDX-License-Identifier: Apache-2.0 - + \ No newline at end of file diff --git a/select_repo_template.png b/select_repo_template.png deleted file mode 100644 index 1fd091e..0000000 Binary files a/select_repo_template.png and /dev/null differ diff --git a/select_repo_template.png.license b/select_repo_template.png.license deleted file mode 100644 index be0b881..0000000 --- a/select_repo_template.png.license +++ /dev/null @@ -1,3 +0,0 @@ -SPDX-FileCopyrightText: 2024 PNED G.I.E. - -SPDX-License-Identifier: CC-BY-4.0 \ No newline at end of file diff --git a/src/main/java/lu/lnds/daam/api/Applications.java b/src/main/java/lu/lnds/daam/api/Applications.java index 607dba2..818db89 100644 --- a/src/main/java/lu/lnds/daam/api/Applications.java +++ b/src/main/java/lu/lnds/daam/api/Applications.java @@ -5,20 +5,19 @@ package lu.lnds.daam.api; import java.util.List; - import lu.lnds.daam.beans.ListedApplication; import lu.lnds.daam.beans.RetrievedApplication; +/** Applications API. */ public class Applications implements ApplicationsApi { - @Override - public List listApplicationsV1() { - return List.of(); - } + @Override + public List listApplicationsV1() { + return List.of(); + } - @Override - public RetrievedApplication retrieveApplicationV1(String id) { - return RetrievedApplication.builder() - .id(id).build(); - } + @Override + public RetrievedApplication retrieveApplicationV1(String id) { + return RetrievedApplication.builder().id(id).build(); + } } diff --git a/src/test/java/lu/lnds/damm/api/ApplicationsIT.java b/src/test/java/lu/lnds/damm/api/ApplicationsIT.java index 7a0be2e..b3412f3 100644 --- a/src/test/java/lu/lnds/damm/api/ApplicationsIT.java +++ b/src/test/java/lu/lnds/damm/api/ApplicationsIT.java @@ -7,6 +7,4 @@ import io.quarkus.test.junit.QuarkusIntegrationTest; @QuarkusIntegrationTest -public class ApplicationsIT extends ApplicationsTest { - -} +public class ApplicationsIT extends ApplicationsTest {} diff --git a/src/test/java/lu/lnds/damm/api/ApplicationsTest.java b/src/test/java/lu/lnds/damm/api/ApplicationsTest.java index b379eaa..bab0974 100644 --- a/src/test/java/lu/lnds/damm/api/ApplicationsTest.java +++ b/src/test/java/lu/lnds/damm/api/ApplicationsTest.java @@ -4,38 +4,35 @@ package lu.lnds.damm.api; -import org.junit.jupiter.api.Test; - -import io.quarkus.test.junit.QuarkusTest; -import lu.lnds.daam.beans.ListedApplication; -import lu.lnds.daam.beans.RetrievedApplication; - import static io.restassured.RestAssured.given; import static org.assertj.core.api.Assertions.assertThat; +import io.quarkus.test.junit.QuarkusTest; import java.util.List; +import lu.lnds.daam.beans.ListedApplication; +import lu.lnds.daam.beans.RetrievedApplication; +import org.junit.jupiter.api.Test; @QuarkusTest public class ApplicationsTest { - @Test - void retrieves_applications() { - var response = given().when().get("/api/v1/applications").then().statusCode(200); + @Test + void retrieves_applications() { + var response = given().when().get("/api/v1/applications").then().statusCode(200); - var actual = response.extract().body().>as(List.class); + var actual = response.extract().body().>as(List.class); - assertThat(actual).isEmpty(); - } + assertThat(actual).isEmpty(); + } - @Test - void given_id_retrieves_application() { - var response = given().when().get("/api/v1/applications/dummy").then() - .statusCode(200); + @Test + void given_id_retrieves_application() { + var response = given().when().get("/api/v1/applications/dummy").then().statusCode(200); - var actual = response.extract().body().as(RetrievedApplication.class); + var actual = response.extract().body().as(RetrievedApplication.class); - var excepted = RetrievedApplication.builder().id("dummy").build(); + var excepted = RetrievedApplication.builder().id("dummy").build(); - assertThat(actual).usingRecursiveComparison().isEqualTo(excepted); - } + assertThat(actual).usingRecursiveComparison().isEqualTo(excepted); + } }