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 versionto10.12.5Scan scopetoOnly java source(but not tests)- Add a new configuration file with:
Description:Leto.File: selectcheckstyle.xmlin project root folder.Use a local Checkstyle filechecked.Store relative to project locationchecked.
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=localhostOnce 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-proxyTo run all the application tests (unit and integration), use this command:
./gradlew test -iBefore 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 checkstyleMainReports can be found in:
build/reports/checkstyle/main.xml
You can check update of your code dependencies by running this command:
./gradlew dependencyUpdatesYou can generate test coverage report by running this command:
./gradlew jacacoTestReportReports can be found in:
build/JacocoHtml/index.htmlbuild/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.Zfrom the latestmain. - Improve the version number in
package.json,package-lock.jsonandchangelog.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
mainbranch 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_TYPEis 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_NAMEis managed by this regex:[a-z0-9._-](_is used as space character).