diff --git a/.github/PULL_REQUEST_TEMPLATE.MD b/.github/pull_request_template.md similarity index 99% rename from .github/PULL_REQUEST_TEMPLATE.MD rename to .github/pull_request_template.md index c9bc2e3d0..f45f563fb 100644 --- a/.github/PULL_REQUEST_TEMPLATE.MD +++ b/.github/pull_request_template.md @@ -4,21 +4,15 @@ Describe the changes made and why they were made. Ignore if these details are present on the associated [Apache Fineract JIRA ticket](https://github.com/apache/fineract/pull/1284). - ## Checklist Please make sure these boxes are checked before submitting your pull request - thanks! - [ ] Write the commit message as per https://github.com/apache/fineract/#pull-requests - - [ ] Acknowledge that we will not review PRs that are not passing the build _("green")_ - it is your responsibility to get a proposed PR to pass the build, not primarily the project's maintainers. - - [ ] Create/update unit or integration tests for verifying the changes made. - - [ ] Follow coding conventions at https://cwiki.apache.org/confluence/display/FINERACT/Coding+Conventions. - - [ ] Add required Swagger annotation and update API documentation at fineract-provider/src/main/resources/static/legacy-docs/apiLive.htm with details of any API changes - - [ ] Submission is not a "code dump". (Large changes can be made "in repository" via a branch. Ask on the developer mailing list for guidance, if required.) FYI our guidelines for code reviews are at https://cwiki.apache.org/confluence/display/FINERACT/Code+Review+Guide. diff --git a/.gitpod.yml b/.gitpod.yml deleted file mode 100644 index d6630775c..000000000 --- a/.gitpod.yml +++ /dev/null @@ -1,45 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# - -# https://www.gitpod.io -# https://www.gitpod.io/docs/41_Config_Gitpod_File/ -# https://github.com/gitpod-io/workspace-images/tree/master/mysql -# -# FIXME - dead code? see https://github.com/apache/fineract/pull/4590#issuecomment-2809760331 - -image: gitpod/workspace-mysql:2022-08-04-13-40-17 -ports: -- port: 3306 - onOpen: ignore -- port: 8005 - onOpen: ignore -- port: 8009 - onOpen: ignore -- port: 8080 -- port: 8081 - onOpen: ignore -- port: 8443 -tasks: -- command: | - # NB MySQL on GitPod.io is currently quite slow. - # Using authentication_string= instead of password= due to mysql major version difference - mysql -e "USE mysql;\nUPDATE user SET authentication_string=PASSWORD('mysql') WHERE user='root';\nFLUSH PRIVILEGES;\n" - ./gradlew createDB -PdbName=fineract_tenants - ./gradlew createDB -PdbName=fineract_default - ./gradlew build -x test - init: sdk default java 17.0.4.fx-zulu diff --git a/README.md b/README.md index 7a56d6b7f..ee08ae125 100644 --- a/README.md +++ b/README.md @@ -12,11 +12,6 @@ Fineract is a mature platform with open APIs that provides a reliable, robust, a [Have a look at the FAQ on our Wiki at apache.org](https://cwiki.apache.org/confluence/display/FINERACT/FAQ) if this README does not answer what you are looking for. [Visit our JIRA Dashboard](https://issues.apache.org/jira/secure/Dashboard.jspa?selectPageId=12335824) to find issues to work on, see what others are working on, or open new issues. -[![Code Now! (Gitpod)](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/apache/fineract) -to start contributing to this project in the online web-based IDE GitPod.io right away! -(You may initially have to press F1 to Find Command and run "Java: Start Language Server".) -It's of course also possible to contribute with a "traditional" local development environment (see below). - COMMUNITY ========= @@ -72,7 +67,7 @@ __RECOMMENDATION__: you need to shift all dates in your database by the timezone Run the following commands: 1. `./gradlew createDB -PdbName=fineract_tenants` 1. `./gradlew createDB -PdbName=fineract_default` -1. `./gradlew bootRun` +1. `./gradlew devRun`
INSTRUCTIONS: How to build the JAR file @@ -170,7 +165,24 @@ Right now we depend on GitHub to know if "the build" is passing (it's actually m The authoritative source of truth for what commands/services/tests to run, how, and when are the files in `.github/workflows/`. Output from runs based on those configuration files appears at . -Note these builds are run in [short-lived virtual machines](https://docs.github.com/en/actions/using-github-hosted-runners/using-github-hosted-runners), so locally reproducing the same may require additional effort, such as these extra clean-up procedures: +Incorrect default Java-related executables may cause test failures. +To fix this on Debian and Ubuntu systems, run the following: + +```bash +export JAVA_HOME=/usr/lib/jvm/zulu21 +sudo update-alternatives --set java $JAVA_HOME/bin/java +sudo update-alternatives --set javac $JAVA_HOME/bin/javac +sudo update-alternatives --set javadoc $JAVA_HOME/bin/javadoc +``` + +This would correct, for example, a [class file verson error](https://en.wikipedia.org/wiki/Java_class_file#General_layout). +You might see something like this if a Java 11 executable (class file format version 56) was the system default, but the integration tests were using Java 21 (class file format version 65): + +``` +UnsupportedClassVersionError: com.example.package/ClassName has been compiled by a more recent version of the Java Runtime (class file version 65.0), this version of the Java Runtime only recognizes class file versions up to 55.0 +``` + +These builds are run in [short-lived virtual machines](https://docs.github.com/en/actions/using-github-hosted-runners/using-github-hosted-runners), so locally reproducing the same may require additional effort, such as these extra clean-up procedures: ```bash # Destroy anything untracked by git. @@ -186,6 +198,23 @@ rm -rf ~/.gradle ~/.m2 /tmp/cargo* ps auxwww | grep [c]argo | awk '{ print $2 }' | xargs -r kill ``` +Integration test runs such as `./gradlew --no-daemon --console=plain test -x :twofactor-tests:test -x :oauth2-test:test :fineract-e2e-tests-runner:test -PdbType=postgresql` in `.github/workflows/build-postgresql.yml` often take an hour or longer to complete. +If you notice the `:integration-tests:test` task taking significantly less time, say, one minute, gradle may be skipping it. +Look for something like this in the test output: + +``` +> Task :integration-tests:test UP-TO-DATE 👀 +Custom actions are attached to task ':integration-tests:test'. +Build cache key for task ':integration-tests:test' is 6aeeec3f58bf9703d4c100fbaa657f5c +Skipping task ':integration-tests:test' as it is up-to-date. +Resolve mutations for :integration-tests:cargoStopLocal (Thread[Execution worker Thread 11,5,main]) started. +:integration-tests:cargoStopLocal (Thread[Execution worker Thread 11,5,main]) started. +``` + +(This is with the `--info` gradle argument with eyeballs added for emphasis) +The `--rerun-tasks` gradle argument may help, or you can try destroying `~/.gradle` and other clean-up procedures as indicated above then re-running tests. +This is useful for repeated test runs (say, for timing) when gradle would otherwise assume a task is "up-to-date" and not re-run it. + Testing within IDEs ----------------- diff --git a/build.gradle b/build.gradle index 86099a6c7..a193b8a91 100644 --- a/build.gradle +++ b/build.gradle @@ -739,13 +739,6 @@ configure(project.fineractJavaProjects) { tasks.withType(Javadoc) { options.addStringOption('Xdoclint:none', '-quiet') options.encoding = 'UTF-8' - // FIXME - html5 is the default since sometime before Java 17 - // Disable strict checking to prevent build failures on invalid javadoc - options.addBooleanOption('html5', true) - // Add this if you're using Java 21 records or other modern features - if (JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_21)) { - options.addBooleanOption('html5', true) - } // Ignore any errors during javadoc generation failOnError = false } diff --git a/fineract-war/build.gradle b/fineract-war/build.gradle index c7a29aad0..93b12e422 100644 --- a/fineract-war/build.gradle +++ b/fineract-war/build.gradle @@ -145,7 +145,7 @@ distributions { from("$rootDir/") { exclude '**/build' , '.git', '**/.gradle', '.github', '**/.settings', '**/.project', '**/.classpath', '.idea', 'out', '._.DS_Store', '.DS_Store', 'WebContent', - '**/.externalToolbuilders', '.theia', '.gitpod.yml', 'LICENSE_RELEASE', + '**/.externalToolbuilders', '.theia', 'LICENSE_RELEASE', 'NOTICE_RELEASE', '**/licenses', '*.class', '**/bin', '*.log', '.dockerignore', '**/.gitkeep'