diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..a37df20 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,34 @@ +--- +name: Bug Report +about: Create a report to help improve the RESTful APE service +title: '[BUG] ' +labels: 'bug' +assignees: vedran-kasalica + +--- + +**Note:** Not all fields are obligatory, but the more details you provide, the easier it will be for us to address the issue. Feel free to omit sections that you feel are not relevant to your report. + +## Description + + +## Endpoint + + +## HTTP Method + + +## Request Payload + + +## Expected Behavior + + +## Actual Behavior + + +## APE Version + + +## Spring Boot Version + + +## Problem Statement + + +## Proposed Solution + + +## Alternatives Considered + + +## Use Cases + + +## Additional Context + diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 0000000..a8f7fc5 --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,43 @@ +--- +name: Pull Request +about: Propose changes to the RESTful APE project +title: '' +labels: '' +assignees: '' + +--- + +**Note:** Not all fields are obligatory, but the more details you provide, the easier it will be for us to address the issue. Feel free to omit sections that you feel are not relevant to your report. + +## Pull Request Description + + +## Related Issue(s) + + +## Motivation and Context + + +## How Has This Been Tested? + + +## Types of changes + +- [ ] Bug fix (non-breaking change which fixes an issue) +- [ ] New feature (non-breaking change which adds functionality) +- [ ] Breaking change (fix or feature that would cause existing functionality to change) +- [ ] Documentation update + +## Checklist: + +- [ ] My code follows the code style of this project. +- [ ] I have added or updated the documentation accordingly. +- [ ] I have added tests to cover my changes. +- [ ] All new and existing tests passed. + +## Additional Information + + +## Screenshots (if applicable) + + diff --git a/CONTRIBUTION.md b/CONTRIBUTION.md index a5fc3ee..5b858cd 100644 --- a/CONTRIBUTION.md +++ b/CONTRIBUTION.md @@ -1,7 +1,6 @@ -# Contributing +# Contributing to RESTful APE -Contributions are welcome, and they are greatly appreciated! Every little bit -helps, and credit will always be given. +Contributions are welcome and greatly appreciated! Every little bit helps, and credit will always be given. ## Types of Contributions @@ -9,56 +8,58 @@ helps, and credit will always be given. If you are reporting a bug, please include: -* Your operating system name and version. -* Any details about your local setup that might be helpful in troubleshooting. -* Detailed steps to reproduce the bug. +- Your operating system name and version. +- Any details about your local setup that might be helpful in troubleshooting. +- Detailed steps to reproduce the bug. ### Fix Bugs -Look through the GitHub issues for bugs. Anything tagged with "bug" and "help -wanted" is open to whoever wants to implement it. +Look through the GitHub issues for bugs. Anything tagged with "bug" and "help wanted" is open to whoever wants to implement it. ### Implement Features -Look through the GitHub issues for features. Anything tagged with "enhancement" -and "help wanted" is open to whoever wants to implement it. +Look through the GitHub issues for features. Anything tagged with "enhancement" and "help wanted" is open to whoever wants to implement it. ### Write Documentation -You can never have enough documentation! Please feel free to contribute to any -part of the documentation, such as the official docs, docstrings, or even -on the web in blog posts, articles, and such. +You can never have enough documentation! Please feel free to contribute to any part of the documentation, such as the official docs, docstrings, or even on the web in blog posts, articles, and such. ### Submit Feedback If you are proposing a feature: -* Explain in detail how it would work. -* Keep the scope as narrow as possible, to make it easier to implement. -* Remember that this is a volunteer-driven project, and that contributions - are welcome :) +- Explain in detail how it would work. +- Keep the scope as narrow as possible, to make it easier to implement. +- Remember that this is a volunteer-driven project, and that contributions are welcome :) + +## Best Coding Practices for Java and Spring Boot + +When contributing code, please ensure it adheres to the following best practices: + +- **Follow Java and Spring Boot best practices**: This includes proper use of annotations, configuration management, and exception handling. Utilize Spring's dependency injection to keep your code clean and testable. +- **Code Style**: Adhere to the [Google Java Style Guide](https://google.github.io/styleguide/javaguide.html) to ensure consistency and readability in the codebase. +- **Documentation**: All public methods and classes should be documented with Javadoc comments. This is crucial for maintainability and for other contributors to understand your code. +- **Testing**: Include unit tests for new features and bug fixes. We use JUnit and Spring Boot Test for testing. Aim for high coverage to ensure quality and prevent regressions. ## Get Started! -Ready to contribute? Here's how to set up `RESTful APE` for local development. +Ready to contribute? Here's how to set up `RESTful APE` for local development: 1. Download a copy of `RESTful APE` locally. -2. **Fork** the `RESTful APE` repo on GitHub -3. **Clone** the project to your own machine -4. Make changes to the code. When you're done making changes, check that your changes conform to any code formatting requirements and pass any tests. +2. **Fork** the `RESTful APE` repo on GitHub. +3. **Clone** the project to your own machine. +4. Make changes to the code. Ensure your changes adhere to the coding practices mentioned above and pass all tests. 5. Commit and push your changes. 6. Open a pull request. - ## Pull Request Guidelines Before you submit a pull request, check that it meets these guidelines: -1. The pull request should include additional tests if appropriate. -2. If the pull request adds functionality, the docs should be updated. -3. The pull request should work for all currently supported operating systems and versions of Python. +1. The pull request should include tests proving the new feature works or the bug is fixed. +2. If the pull request adds functionality, update the documentation accordingly. +3. Ensure your code changes are compatible with the latest versions of Java and Spring Boot used by the project. ## Code of Conduct -Please note that the `RESTful APE` project is released with a -Code of Conduct. By contributing to this project you agree to abide by its terms. +Please note that the `RESTful APE` project is released with a Code of Conduct. By contributing to this project, you agree to abide by its terms. diff --git a/README.md b/README.md index dc721b5..10aa40f 100644 --- a/README.md +++ b/README.md @@ -1,17 +1,15 @@ -![RestAPE Logo](https://user-images.githubusercontent.com/11068408/225042915-416975d6-56c9-40d3-97b9-e2854cc19a1c.png#gh-dark-mode-only) -![RestAPE Logo](https://user-images.githubusercontent.com/11068408/225042428-824741e2-9618-413c-9546-bc352b3bb23b.png#gh-light-mode-only) - +RestAPE Logo +RestAPE Logo | Badges | | |:----:|----| | **Fairness** | [![fair-software.eu](https://img.shields.io/badge/fair--software.eu-%E2%97%8F%20%20%E2%97%8F%20%20%E2%97%8F%20%20%E2%97%8F%20%20%E2%97%8F-green)](https://fair-software.eu) [![OpenSSF Best Practices](https://bestpractices.coreinfrastructure.org/projects/8082/badge)](https://www.bestpractices.dev/projects/8082) | | **Packages and Releases** | [![Latest release](https://img.shields.io/github/release/sanctuuary/RESTAPE.svg)](https://github.com/sanctuuary/APE/releases/latest) [![Static Badge](https://img.shields.io/badge/RSD-RESTfulAPE-ape)](https://research-software-directory.org/software/restape) | | **Build Status** | ![build](https://github.com/sanctuuary/RestAPE/actions/workflows/maven.yml/badge.svg) [![CodeQL](https://github.com/sanctuuary/restape/actions/workflows/codeql.yml/badge.svg)](https://github.com/sanctuuary/restape/actions/workflows/codeql.yml) | +| **Documentation** | [![Documentation Status](https://readthedocs.org/projects/ape-framework/badge/?version=latest)](https://ape-framework.readthedocs.io/en/latest/docs/restful-ape/introduction.html) | | **DOI** | [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.10048236.svg)](https://doi.org/10.5281/zenodo.10048236) | | **License** | [![GitHub license](https://img.shields.io/github/license/sanctuuary/RESTAPE)](https://github.com/sanctuuary/RESTAPE/blob/master/LICENSE) | - - A RESTful API for the APE library (RESTful APE) provides a way for users to interact with APE's automated pipeline exploration capabilities through HTTP requests. APE is a command line tool and Java API that automates the exploration of possible computational pipelines from large collections of computational tools. The RESTful API allows users to submit requests to the APE server for pipeline exploration, which returns results in a standard format such as JSON or XML. Users can interact with APE through a web browser or any other HTTP client, and the API can be integrated into other applications for seamless pipeline exploration. @@ -34,9 +32,8 @@ and then run the jar package `java -jar target/restape-[version].jar` - - OpenAPI documentation is available at + ```` [host]:[port]]/swagger-ui/index.html ```` @@ -48,11 +45,14 @@ you can install APE in your local repository and use it to build the back-end. To do so, [download](https://github.com/sanctuuary/APE#releases) or [compile](https://github.com/sanctuuary/APE#build-ape-from-source-using-maven) the APE version you wish to use. In the location where you have the resulting APE.jar file, run the following command: + ````shell -$ mvn install:install-file -Dfile=APE-.jar +mvn install:install-file -Dfile=APE-.jar ```` + This adds the specified APE file to your local Maven repository. You can now build the back-end using: + ````shell -$ mvn package -DskipTests=true +mvn package -DskipTests=true ```` diff --git a/pom.xml b/pom.xml index 10a9279..59bfe54 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ nl.esciencecenter restape - 0.3.1 + 0.3.2 restape RESTful API for the APE library @@ -42,7 +42,7 @@ org.springframework.boot spring-boot-starter-web - 3.2.2 + 3.2.3 @@ -61,14 +61,14 @@ org.springframework.boot spring-boot-starter-actuator - 3.2.2 + 3.2.3 org.springframework.boot spring-boot-starter-data-jpa - 3.2.2 + 3.2.3 @@ -85,6 +85,7 @@ 2.2.224 runtime + io.github.sanctuuary @@ -103,7 +104,7 @@ org.graalvm.js js - 23.0.2 + 23.0.3 diff --git a/src/main/java/nl/esciencecenter/RestapeApplication.java b/src/main/java/nl/esciencecenter/RestapeApplication.java index 96dff2f..59cd077 100644 --- a/src/main/java/nl/esciencecenter/RestapeApplication.java +++ b/src/main/java/nl/esciencecenter/RestapeApplication.java @@ -1,5 +1,9 @@ package nl.esciencecenter; +import java.util.Collections; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @@ -7,12 +11,23 @@ import io.swagger.v3.oas.annotations.info.Info; import io.swagger.v3.oas.annotations.servers.Server; +/** + * The main class for the RESTful APE API. + * + * @version 0.3.0 + */ @SpringBootApplication @OpenAPIDefinition(info = @Info(title = "RestApe API", version = "0.3.0", description = "RESTfull API for the APE (Automated Pipeline Explorer) library."), servers = @Server(url = "http://localhost:4444", description = "Local server")) public class RestapeApplication { + private static final Logger log = LoggerFactory.getLogger(RestapeApplication.class); + public static void main(String[] args) { - SpringApplication.run(RestapeApplication.class, args); + SpringApplication app = new SpringApplication(RestapeApplication.class); + + app.setDefaultProperties(Collections.singletonMap("server.port", "4444")); + log.info("Starting RestApe API server..."); + app.run(args); } }