You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@fineract.apache.org by "leonardoalunno (via GitHub)" <gi...@apache.org> on 2026/03/16 19:57:38 UTC
[PR] FINERACT-2535: Data type 'BOOLEAN' is not supported in runreports endpoint [fineract]
leonardoalunno opened a new pull request, #5637:
URL: https://github.com/apache/fineract/pull/5637
## Description
Describe the changes made and why they were made. (Ignore if these details are present on the associated Apache Fineract JIRA ticket.)
## Checklist
Please make sure these boxes are checked before submitting your pull request - thanks!
- [ ] Write the commit message as per [our guidelines](https://github.com/apache/fineract/blob/develop/CONTRIBUTING.md#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](https://fineract.apache.org/docs/current/#_testing) for verifying the changes made.
- [ ] Follow our [coding conventions](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
- [ ] [This PR must not be a "code dump"](https://cwiki.apache.org/confluence/display/FINERACT/Pull+Request+Size+Limit). Large changes can be made in a branch, with assistance. Ask for help on the [developer mailing list](https://fineract.apache.org/#contribute).
Your assigned reviewer(s) will follow our [guidelines for code reviews](https://cwiki.apache.org/confluence/display/FINERACT/Code+Review+Guide).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@fineract.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] FINERACT-2535: Data type 'BOOLEAN' is not supported in runreports endpoint [fineract]
Posted by "leonardoalunno (via GitHub)" <gi...@apache.org>.
leonardoalunno commented on PR #5637:
URL: https://github.com/apache/fineract/pull/5637#issuecomment-4150090949
Asking for review and eventually merge
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@fineract.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] FINERACT-2535: Data type 'BOOLEAN' is not supported in runreports endpoint [fineract]
Posted by "leonardoalunno (via GitHub)" <gi...@apache.org>.
leonardoalunno commented on PR #5637:
URL: https://github.com/apache/fineract/pull/5637#issuecomment-4205811672
Rebase done!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@fineract.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] FINERACT-2535: Data type 'BOOLEAN' is not supported in runreports endpoint [fineract]
Posted by "adamsaghy (via GitHub)" <gi...@apache.org>.
adamsaghy merged PR #5637:
URL: https://github.com/apache/fineract/pull/5637
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@fineract.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] FINERACT-2535: Data type 'BOOLEAN' is not supported in runreports endpoint [fineract]
Posted by "leonardoalunno (via GitHub)" <gi...@apache.org>.
leonardoalunno commented on PR #5637:
URL: https://github.com/apache/fineract/pull/5637#issuecomment-4137011168
It was a mistake, could you double check now?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@fineract.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] FINERACT-2535: Data type 'BOOLEAN' is not supported in runreports endpoint [fineract]
Posted by "leonardoalunno (via GitHub)" <gi...@apache.org>.
leonardoalunno commented on PR #5637:
URL: https://github.com/apache/fineract/pull/5637#issuecomment-4155258800
Asking for review and eventually merge
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@fineract.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] FINERACT-2535: Data type 'BOOLEAN' is not supported in runreports endpoint [fineract]
Posted by "adamsaghy (via GitHub)" <gi...@apache.org>.
adamsaghy commented on PR #5637:
URL: https://github.com/apache/fineract/pull/5637#issuecomment-4205724051
@leonardoalunno Please rebase this PR with latest `develop` branch. Many of the checks were skipped due to incorrect dependency in Github Actions CI jobs!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@fineract.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] FINERACT-2535: Data type 'BOOLEAN' is not supported in runreports endpoint [fineract]
Posted by "adamsaghy (via GitHub)" <gi...@apache.org>.
adamsaghy commented on PR #5637:
URL: https://github.com/apache/fineract/pull/5637#issuecomment-4137441757
> It was a mistake, could you double check now?
you need to push your changes! ;)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@fineract.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] FINERACT-2535: Data type 'BOOLEAN' is not supported in runreports endpoint [fineract]
Posted by "adamsaghy (via GitHub)" <gi...@apache.org>.
adamsaghy commented on code in PR #5637:
URL: https://github.com/apache/fineract/pull/5637#discussion_r2995322670
##########
integration-tests/src/test/java/org/apache/fineract/integrationtests/SqlInjectionReportingServiceIntegrationTest.java:
##########
@@ -155,53 +173,87 @@ private void createTestReportIfNotExists() {
"Test report creation failed with status " + postResponse.getStatusCode() + ": " + errorResponse);
}
} catch (Exception e) {
- // This is a critical failure - tests cannot proceed without the test report
throw new RuntimeException(
"CRITICAL: Could not create test report '" + TEST_REPORT_NAME + "'. Tests cannot proceed. Error: " + e.getMessage(), e);
}
}
- private void deleteTestReport() {
- if (testReportId != null) {
- try {
- Utils.performServerDelete(requestSpec, responseSpec, "/fineract-provider/api/v1/reports/" + testReportId, "");
- log.info("Deleted test report with ID: {}", testReportId);
- } catch (Exception e) {
- log.warn("Failed to delete test report: " + e.getMessage());
+ private void createBooleanReport() {
+ booleanReportName = "BOOLEAN_Runreports_Test_Report_" + java.util.UUID.randomUUID();
+
+ String reportJson = "{" + "\"reportName\": \"" + booleanReportName + "\"," + "\"reportType\": \"Table\","
+ + "\"reportCategory\": \"Client\"," + "\"reportSql\": \"" + BOOLEAN_REPORT_SQL + "\","
+ + "\"description\": \"Test report for BOOLEAN runreports support\"," + "\"useReport\": true" + "}";
+
+ Response postResponse = given().spec(requestSpec).contentType(ContentType.JSON).body(reportJson).when()
+ .post("/fineract-provider/api/v1/reports");
+
+ if (postResponse.getStatusCode() == 200 || postResponse.getStatusCode() == 201) {
+ String response = postResponse.asString();
+ if (response.contains("resourceId")) {
+ String idStr = response.replaceAll(".*\"resourceId\":(\\d+).*", "$1");
+ booleanReportId = Long.parseLong(idStr);
+ log.info("Created BOOLEAN test report with ID: {}, name: {}", booleanReportId, booleanReportName);
+ } else {
+ throw new RuntimeException("BOOLEAN test report creation failed - no resourceId in response: " + response);
}
+ } else {
+ throw new RuntimeException(
+ "BOOLEAN test report creation failed with status " + postResponse.getStatusCode() + ": " + postResponse.asString());
+ }
+ }
+
+ private void deleteTestReport() {
+ if (testReportId == null) {
+ return;
+ }
+
+ Response deleteResponse = given().spec(requestSpec).contentType(ContentType.JSON).when()
+ .delete("/fineract-provider/api/v1/reports/" + testReportId);
+
+ if (deleteResponse.getStatusCode() == 200 || deleteResponse.getStatusCode() == 204 || deleteResponse.getStatusCode() == 404) {
+ log.info("Deleted (or already absent) test report with ID: {}", testReportId);
+ } else {
+ throw new RuntimeException("Failed deleting test report with ID " + testReportId + ", status: " + deleteResponse.getStatusCode()
+ + ", body: " + deleteResponse.asString());
+ }
+ }
+
+ private void deleteBooleanReport() {
+ if (booleanReportId == null) {
+ return;
+ }
+
+ Response deleteResponse = given().spec(requestSpec).contentType(ContentType.JSON).when()
+ .delete("/fineract-provider/api/v1/reports/" + booleanReportId);
+
+ if (deleteResponse.getStatusCode() == 200 || deleteResponse.getStatusCode() == 204 || deleteResponse.getStatusCode() == 404) {
+ log.info("Deleted (or already absent) BOOLEAN test report with ID: {}", booleanReportId);
+ } else {
+ throw new RuntimeException("Failed deleting BOOLEAN test report with ID " + booleanReportId + ", status: "
+ + deleteResponse.getStatusCode() + ", body: " + deleteResponse.asString());
}
}
- /**
- * UC1: Test legitimate report execution works correctly Validates that the SQL injection prevention doesn't break
- * normal functionality
- */
@Test
void uc1_testLegitimateReportExecution() {
log.info("Testing that legitimate reports still work after SQL injection prevention");
Map<String, String> queryParams = new HashMap<>();
queryParams.put("R_officeId", "1");
- // Test with the test report we created in setup - this MUST succeed
String response = Utils.performServerGet(requestSpec, responseSpec,
"/fineract-provider/api/v1/runreports/" + TEST_REPORT_NAME + "?genericResultSet=false&" + toQueryString(queryParams), null);
assertNotNull(response);
assertNotEquals("", response.trim());
- // Debug: Log actual response to understand structure
log.info("Response from report execution: {}", response);
- // Verify response is valid JSON structure
assertTrue(response.contains("columnHeaders") || response.contains("data") || response.contains("test_column"),
"Response should contain expected JSON structure, but got: " + response);
}
- /**
Review Comment:
Any reason to remove these?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@fineract.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] FINERACT-2535: Data type 'BOOLEAN' is not supported in runreports endpoint [fineract]
Posted by "leonardoalunno (via GitHub)" <gi...@apache.org>.
leonardoalunno commented on PR #5637:
URL: https://github.com/apache/fineract/pull/5637#issuecomment-4073902759
> Can you write an integration test which tests whether the reported report can be executed successfully?
Thanks, I added an integration test that creates and executes a custom SQL report containing a BOOLEAN column.
I was able to run the unit test locally. I also tried to run the new integration test locally with the PostgreSQL setup (`-PdbType=postgresql`), but in my local environment Fineract did not become healthy within the Cargo/Tomcat startup window, so the integration test environment itself did not complete startup.
I’m pushing the integration test change so CI can validate it in the project-standard environment.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@fineract.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] FINERACT-2535: Data type 'BOOLEAN' is not supported in runreports endpoint [fineract]
Posted by "leonardoalunno (via GitHub)" <gi...@apache.org>.
leonardoalunno commented on PR #5637:
URL: https://github.com/apache/fineract/pull/5637#issuecomment-4073900404
Thanks, I added an integration test that creates and executes a custom SQL report containing a BOOLEAN column.
I was able to run the unit test locally. I also tried to run the new integration test locally with the PostgreSQL setup (`-PdbType=postgresql`), but in my local environment Fineract did not become healthy within the Cargo/Tomcat startup window, so the integration test environment itself did not complete startup.
I’m pushing the integration test change so CI can validate it in the project-standard environment.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@fineract.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] FINERACT-2535: Data type 'BOOLEAN' is not supported in runreports endpoint [fineract]
Posted by "adamsaghy (via GitHub)" <gi...@apache.org>.
adamsaghy commented on code in PR #5637:
URL: https://github.com/apache/fineract/pull/5637#discussion_r2995321315
##########
integration-tests/src/test/java/org/apache/fineract/integrationtests/SqlInjectionReportingServiceIntegrationTest.java:
##########
@@ -155,53 +173,87 @@ private void createTestReportIfNotExists() {
"Test report creation failed with status " + postResponse.getStatusCode() + ": " + errorResponse);
}
} catch (Exception e) {
- // This is a critical failure - tests cannot proceed without the test report
throw new RuntimeException(
"CRITICAL: Could not create test report '" + TEST_REPORT_NAME + "'. Tests cannot proceed. Error: " + e.getMessage(), e);
}
}
- private void deleteTestReport() {
- if (testReportId != null) {
- try {
- Utils.performServerDelete(requestSpec, responseSpec, "/fineract-provider/api/v1/reports/" + testReportId, "");
- log.info("Deleted test report with ID: {}", testReportId);
- } catch (Exception e) {
- log.warn("Failed to delete test report: " + e.getMessage());
+ private void createBooleanReport() {
+ booleanReportName = "BOOLEAN_Runreports_Test_Report_" + java.util.UUID.randomUUID();
+
+ String reportJson = "{" + "\"reportName\": \"" + booleanReportName + "\"," + "\"reportType\": \"Table\","
+ + "\"reportCategory\": \"Client\"," + "\"reportSql\": \"" + BOOLEAN_REPORT_SQL + "\","
+ + "\"description\": \"Test report for BOOLEAN runreports support\"," + "\"useReport\": true" + "}";
+
+ Response postResponse = given().spec(requestSpec).contentType(ContentType.JSON).body(reportJson).when()
+ .post("/fineract-provider/api/v1/reports");
+
+ if (postResponse.getStatusCode() == 200 || postResponse.getStatusCode() == 201) {
+ String response = postResponse.asString();
+ if (response.contains("resourceId")) {
+ String idStr = response.replaceAll(".*\"resourceId\":(\\d+).*", "$1");
+ booleanReportId = Long.parseLong(idStr);
+ log.info("Created BOOLEAN test report with ID: {}, name: {}", booleanReportId, booleanReportName);
+ } else {
+ throw new RuntimeException("BOOLEAN test report creation failed - no resourceId in response: " + response);
}
+ } else {
+ throw new RuntimeException(
+ "BOOLEAN test report creation failed with status " + postResponse.getStatusCode() + ": " + postResponse.asString());
+ }
+ }
+
+ private void deleteTestReport() {
+ if (testReportId == null) {
+ return;
+ }
+
+ Response deleteResponse = given().spec(requestSpec).contentType(ContentType.JSON).when()
+ .delete("/fineract-provider/api/v1/reports/" + testReportId);
+
+ if (deleteResponse.getStatusCode() == 200 || deleteResponse.getStatusCode() == 204 || deleteResponse.getStatusCode() == 404) {
+ log.info("Deleted (or already absent) test report with ID: {}", testReportId);
+ } else {
+ throw new RuntimeException("Failed deleting test report with ID " + testReportId + ", status: " + deleteResponse.getStatusCode()
+ + ", body: " + deleteResponse.asString());
+ }
+ }
+
+ private void deleteBooleanReport() {
+ if (booleanReportId == null) {
+ return;
+ }
+
+ Response deleteResponse = given().spec(requestSpec).contentType(ContentType.JSON).when()
+ .delete("/fineract-provider/api/v1/reports/" + booleanReportId);
+
+ if (deleteResponse.getStatusCode() == 200 || deleteResponse.getStatusCode() == 204 || deleteResponse.getStatusCode() == 404) {
+ log.info("Deleted (or already absent) BOOLEAN test report with ID: {}", booleanReportId);
+ } else {
+ throw new RuntimeException("Failed deleting BOOLEAN test report with ID " + booleanReportId + ", status: "
+ + deleteResponse.getStatusCode() + ", body: " + deleteResponse.asString());
}
}
- /**
Review Comment:
Any reason to remove these?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@fineract.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] FINERACT-2535: Data type 'BOOLEAN' is not supported in runreports endpoint [fineract]
Posted by "leonardoalunno (via GitHub)" <gi...@apache.org>.
leonardoalunno commented on PR #5637:
URL: https://github.com/apache/fineract/pull/5637#issuecomment-4198131789
> @leonardoalunno Please dont remove valid comments! Example:
>
> ```
> /**
> * UC1: Test legitimate report execution works correctly Validates that the SQL injection prevention doesn't break
> * normal functionality
> */
> ```
I'm doing it now, sorry but I've been busy these days
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@fineract.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] FINERACT-2535: Data type 'BOOLEAN' is not supported in runreports endpoint [fineract]
Posted by "adamsaghy (via GitHub)" <gi...@apache.org>.
adamsaghy commented on PR #5637:
URL: https://github.com/apache/fineract/pull/5637#issuecomment-4178217642
@leonardoalunno Please dont remove valid comments!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@fineract.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] FINERACT-2535: Data type 'BOOLEAN' is not supported in runreports endpoint [fineract]
Posted by "adamsaghy (via GitHub)" <gi...@apache.org>.
adamsaghy commented on PR #5637:
URL: https://github.com/apache/fineract/pull/5637#issuecomment-4194407260
@leonardoalunno Please dont remove valid comments!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@fineract.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] FINERACT-2535: Data type 'BOOLEAN' is not supported in runreports endpoint [fineract]
Posted by "leonardoalunno (via GitHub)" <gi...@apache.org>.
leonardoalunno commented on PR #5637:
URL: https://github.com/apache/fineract/pull/5637#issuecomment-4198356323
Done!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@fineract.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] FINERACT-2535: Data type 'BOOLEAN' is not supported in runreports endpoint [fineract]
Posted by "leonardoalunno (via GitHub)" <gi...@apache.org>.
leonardoalunno commented on PR #5637:
URL: https://github.com/apache/fineract/pull/5637#issuecomment-4128249482
Asking for review and eventually merge
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@fineract.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] FINERACT-2535: Data type 'BOOLEAN' is not supported in runreports endpoint [fineract]
Posted by "leonardoalunno (via GitHub)" <gi...@apache.org>.
leonardoalunno commented on PR #5637:
URL: https://github.com/apache/fineract/pull/5637#issuecomment-4141525368
> > It was a mistake, could you double check now?
>
> you need to push your changes! ;)
Done!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@fineract.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org