Skip to content

Enforce Quality Gates for Java and Python sub projects on CI#1543

Open
ndegwamartin wants to merge 15 commits intogoogle:masterfrom
ndegwamartin:enable-ci-gates
Open

Enforce Quality Gates for Java and Python sub projects on CI#1543
ndegwamartin wants to merge 15 commits intogoogle:masterfrom
ndegwamartin:enable-ci-gates

Conversation

@ndegwamartin
Copy link
Collaborator

Description of what I changed

Resolves #1541

E2E test

TESTED:

Please replace this with a description of how you tested your PR beyond the
automated e2e/unit tests.

Checklist: I completed these to help reviewers :)

  • I have read and will follow the
    review process.

  • I am familiar with Google Style Guides for the language I have coded in.

    No? Please take some time and review
    Java and
    Python style guides.

  • My IDE is configured to follow the Google
    code styles.

    No? Unsure? ->
    configure your IDE.

  • I have added tests to cover my changes. (If you refactored existing
    code that was well tested you do not have to add tests)

  • I ran mvn clean package right before creating this pull request and
    added all formatting changes to my commit.

  • If I made any Python code changes, I ran black ., pylint . and
    pyright . right before creating this pull request and added all
    formatting changes to my commit.

  • All new and existing tests passed.

  • My pull request is based on the latest changes of the master branch.

    No? Unsure? -> execute command git pull --rebase upstream master

@codecov-commenter
Copy link

codecov-commenter commented Dec 22, 2025

Codecov Report

❌ Patch coverage is 73.17073% with 11 lines in your changes missing coverage. Please review.
✅ Project coverage is 46.75%. Comparing base (8434457) to head (9a97804).

Files with missing lines Patch % Lines
...unsen/avro/converters/DefinitionToAvroVisitor.java 75.00% 6 Missing ⚠️
...ava/com/google/fhir/analytics/PipelineManager.java 70.00% 3 Missing ⚠️
...m/cerner/bunsen/avro/converters/NoOpConverter.java 0.00% 1 Missing ⚠️
...ava/com/google/fhir/analytics/DwhFilesManager.java 83.33% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #1543      +/-   ##
============================================
+ Coverage     46.61%   46.75%   +0.13%     
- Complexity      678      683       +5     
============================================
  Files            90       90              
  Lines          5886     5893       +7     
  Branches        834      834              
============================================
+ Hits           2744     2755      +11     
+ Misses         2827     2822       -5     
- Partials        315      316       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ndegwamartin ndegwamartin marked this pull request as ready for review December 22, 2025 05:34
@ndegwamartin ndegwamartin requested a review from bashir2 December 22, 2025 05:34
Copy link
Collaborator

@bashir2 bashir2 left a comment

Choose a reason for hiding this comment

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

Thanks @ndegwamartin for the changes; just a few minor suggestions/questions.

Copy link
Collaborator

@bashir2 bashir2 left a comment

Choose a reason for hiding this comment

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

Thanks @ndegwamartin please feel free to merge after addressing the remaining comments below.

- Reverts lazy logging for main.py
- Disables lazy logging check in pylint configuration
- Refactors get current time to use static helper method
- Adds unit tests for PipelineManager class
@ndegwamartin
Copy link
Collaborator Author

/gcbrun

Copy link
Collaborator

@bashir2 bashir2 left a comment

Choose a reason for hiding this comment

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

Just some minor unit-test/architecture related suggestion.

MeterRegistry meterRegistry = mock(MeterRegistry.class);
pipelineManager = new PipelineManager();
setField("dataProperties", dataProperties);
setField("dwhFilesManager", dwhFilesManager);
Copy link
Collaborator

Choose a reason for hiding this comment

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

I am guessing that you are forced to use reflection for these fields because we use @Autowired on fields, correct? So I think a better solution is to avoid that pattern and instead use constructor injection instead, i.e., we will have a constructor on which we have an @Autowired annotation. Then we can use the constructor directly here with mock objects. If you do that pattern then great, if you feel that is too much work, please add a TODO to switch to that pattern at some point.

public void testIncrementalModeTriggeredAtRightTime() throws Exception {
// Mock current time to be after next scheduled time
LocalDateTime currentTime = lastRunEndTimestamp.plusMinutes(2); // 2 minutes after lastRunEnd
try (MockedStatic<DwhFilesManager> mockedDwh = mockStatic(DwhFilesManager.class)) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

If we inject DwhFilesManager as well then we can change getCurrentTime to be non-static making it easier to mock, but again this is just a suggestion.

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.

Enforce Quality Gates for Java (Error Prone/NullAway) and Python (Pylint/Pyright)

3 participants

Comments