By default, we use IntelliJ IDEA.
To help you in your development, you can install these plugins:
CheckStyle-IDEA
To configure it, go to Settings > Tools > Checkstyle
, then set:
Checkstyle version
to10.12.5
Scan scope
toOnly java source(but not tests)
- Add a new configuration file with:
Description
:Leto
.File
: selectcheckstyle.xml
in project root folder.Use a local Checkstyle file
checked.Store relative to project location
checked.
To configure it, got to Settings > Editor > General > Auto Import
, then check Optimize imports on the fly
.
Setup database with docker:
docker run -v "./init-db.sql:/docker-entrypoint-initdb.d/init-db.sql" -v "./cockroach-certs:/certs" -p 26257:26257 -p 8081:8080 --restart always cockroachdb/cockroach:v23.1.15 start-single-node --certs-dir=/certs --advertise-addr=localhost
Once database is setup you can run :
./gradlew bootrun
⚠️ You have to generate keystore.jks before!, see README.
If you do not want to have a real AI, you can use a fake AI:
docker build -t leto-modelizer-ai-proxy -f ./src/test/resources/ai/Dockerfile ./src/test/resources/ai
docker run -p 8585:8585 -v $(pwd)/src/test/resources/ai:/var/www/html --restart always leto-modelizer-ai-proxy
To run all the application tests (unit and integration), use this command:
./gradlew test -i
Before pushing your branch and open/synchronize a pull-request, you have to verify the checkstyle of your application. Here is the command to do so:
./gradlew checkstyleMain
Reports can be found in:
build/reports/checkstyle/main.xml
You can check update of your code dependencies by running this command:
./gradlew dependencyUpdates
You can generate test coverage report by running this command:
./gradlew jacacoTestReport
Reports can be found in:
build/JacocoHtml/index.html
build/reports/jacoco/test/jacocoTestReport.xml
We use Semantic Versioning as guideline for the version management.
Steps to release:
- Create a new branch labeled
release/vX.Y.Z
from the latestmain
. - Improve the version number in
package.json
,package-lock.json
andchangelog.md
. - Verify the content of the
changelog.md
. - Commit the modifications with the label
Release version X.Y.Z
. - Create a pull request on GitHub for this branch into
main
. - Once the pull request validated and merged, tag the
main
branch withvX.Y.Z
. - After the tag is pushed, make the release on the tag in GitHub.
The default branch is main
. Direct commit on it is forbidden. The only way to update the application is through pull request.
Release tags are only done on the main
branch.
[BRANCH_TYPE]/[BRANCH_NAME]
BRANCH_TYPE
is a prefix to describe the purpose of the branch. Accepted prefixes are:feature
, used for feature developmentbugfix
, used for bug fiximprovement
, used for refactolibrary
, used for updating libraryprerelease
, used for preparing the branch for the releaserelease
, used for releasing projecthotfix
, used for applying a hotfix on main
BRANCH_NAME
is managed by this regex:[a-z0-9._-]
(_
is used as space character).