Skip to content

APP-422: Update non-sql fields based on report exec request#3150

Merged
JordanGuinn merged 38 commits intomainfrom
jg/APP-422
Apr 14, 2026
Merged

APP-422: Update non-sql fields based on report exec request#3150
JordanGuinn merged 38 commits intomainfrom
jg/APP-422

Conversation

@JordanGuinn
Copy link
Copy Markdown
Contributor

@JordanGuinn JordanGuinn commented Apr 10, 2026

Description

This PR updates the ReportSpecBuilder to set all non-SQL fields on the generated ReportSpec to non-default values, but rather the corresponding values coming from the ReportLibrary and the corresponding request.

Tickets

Checklist before requesting a review

  • PR focuses on a single story
  • Code has been fully tested to meet acceptance criteria
  • PR is reasonably small and reviewable (Generally less than 10 files and 500 changed lines)
  • All new functions/classes/components reasonably small
  • Functions/classes/components focused on one responsibility
  • Code easy to understand and modify (clarity over concise/clever)
  • PRs containing TypeScript follow the Do's and Don'ts
  • PR does not contain hardcoded values (Uses constants)
  • All code is covered by unit or feature tests

@JordanGuinn JordanGuinn marked this pull request as ready for review April 10, 2026 23:10
@JordanGuinn JordanGuinn requested a review from a team as a code owner April 10, 2026 23:10
@JordanGuinn JordanGuinn requested review from emyl3 and krista-skylight and removed request for a team April 10, 2026 23:10
@JordanGuinn JordanGuinn changed the title (WIP) APP-422: Update non-sql fields based on report exec request APP-422: Update non-sql fields based on report exec request Apr 10, 2026
Copy link
Copy Markdown
Contributor

@mcmcgrath13 mcmcgrath13 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The version field is not for the library, but for the spec itself so we can evolve the contents of it if need be, it can stay hardcoded to 1 at this point

List<Long> columnUids,
List<Filter> filters) {}
List<Filter> filters,
TimeRange timeRange) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

time range won't directly come from the report execution request, nor will the title. The report title is metadata from the report configuration and the time range is derived from the basic filters somehow

boolean isExport = reportExecRequest.isExport();

String reportTitle =
reportExecRequest.reportTitle() == null || reportExecRequest.reportTitle().isEmpty()
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should come from the report config's report metadata

String libraryName = reportConfig.reportLibrary().libraryName();
Library reportLibrary = reportConfig.reportLibrary();

int version = reportLibrary.version();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
int version = reportLibrary.version();
int version = 1;


int version = reportLibrary.version();
boolean isBuiltin = reportLibrary.isBuiltin();
String libraryName = reportLibrary.libraryName();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't need the library name

@mcmcgrath13
Copy link
Copy Markdown
Contributor

The time range need is under discussion from a product perspective, so hold on doing anything with that piece for now

this(
dbLibrary.getRunner(),
dbLibrary.getLibraryName(),
dbLibrary.getIsBuiltinIndex().toString().equalsIgnoreCase("Y"),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(q, nb) I don't have a lot of context on this code base so take my feedback with a grain of salt but could this conversion logic be built into the ReportLibrary object to make it more reusable?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Definitely a fan - updated!


if (start.isAfter(end)) {
throw new IllegalArgumentException("Start date cannot be after end date");
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(q, nb) Any way to not repeat this non null enforcement for TimeRange start and end from ReportExecutionRequest.java? Put it in a utility?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ended up removing this property from ReportExecutionRequest.java entirely based on initial feedback from Mary, but agreed in principle!

Copy link
Copy Markdown
Contributor

@krista-skylight krista-skylight left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left just a couple questions!

@JordanGuinn JordanGuinn requested a review from mcmcgrath13 April 13, 2026 17:20
import java.util.Map;

public record ReportSpec(
@JsonProperty(value = "version", required = true) int version,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks! in this PR or a quick follow, could you remove this field from the report execution service as well?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will do!

Copy link
Copy Markdown
Contributor

@mcmcgrath13 mcmcgrath13 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you!

@sonarqubecloud
Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
85.7% Coverage on New Code (required ≥ 90%)

See analysis details on SonarQube Cloud

@JordanGuinn JordanGuinn merged commit 5067641 into main Apr 14, 2026
7 of 8 checks passed
@JordanGuinn JordanGuinn deleted the jg/APP-422 branch April 14, 2026 08:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants