Skip to content

Conversation

@pado0
Copy link
Contributor

@pado0 pado0 commented Nov 1, 2025

Description

This PR refactors the Condition.Stats and DirectoryFileTransferTracker.Stats class to use the Builder pattern instead of relying on multiple constructors.

By adopting the Builder pattern, it becomes easier to evolve the stats API, add new metrics, and maintain backward compatibility without forcing disruptive constructor changes.

Based on the related issue:

  1. Added a Builder and deprecated the existing constructors.
  2. Replaced usages of constructors in code and tests with the new Builder.

There are multiple stats-related classes that need similar refactoring, and we are addressing them in priority order. This PR covers Condition.Stats and DirectoryFileTransferTracker.Stats as part of that effort.

Related Issues

Related to #19225

Check List

  • Functionality includes testing.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

@github-actions
Copy link
Contributor

github-actions bot commented Nov 1, 2025

❌ Gradle check result for d34b9e7: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

@pado0 pado0 force-pushed the builder-condition-directory-stats branch from d34b9e7 to bdcb3cd Compare November 1, 2025 18:15
@github-actions
Copy link
Contributor

github-actions bot commented Nov 1, 2025

❌ Gradle check result for bdcb3cd: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

@github-actions
Copy link
Contributor

github-actions bot commented Nov 1, 2025

❌ Gradle check result for 0158f39: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

@pado0 pado0 closed this Nov 1, 2025
@pado0 pado0 reopened this Nov 1, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Nov 2, 2025

✅ Gradle check result for 0158f39: SUCCESS

@codecov
Copy link

codecov bot commented Nov 2, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 73.22%. Comparing base (f3e6399) to head (78938ec).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##               main   #19862   +/-   ##
=========================================
  Coverage     73.21%   73.22%           
+ Complexity    71564    71542   -22     
=========================================
  Files          5785     5785           
  Lines        326759   326814   +55     
  Branches      47291    47291           
=========================================
+ Hits         239246   239304   +58     
+ Misses        68272    68252   -20     
- Partials      19241    19258   +17     

☔ 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.

@github-actions
Copy link
Contributor

github-actions bot commented Nov 3, 2025

✅ Gradle check result for 8968d2d: SUCCESS

@github-actions
Copy link
Contributor

github-actions bot commented Nov 3, 2025

❕ Gradle check result for 82a6b4b: UNSTABLE

Please review all flaky tests that succeeded after retry and create an issue if one does not already exist to track the flaky failure.

@pado0 pado0 force-pushed the builder-condition-directory-stats branch from 82a6b4b to f427ebb Compare November 4, 2025 07:02
@github-actions
Copy link
Contributor

github-actions bot commented Nov 4, 2025

✅ Gradle check result for f427ebb: SUCCESS

@pado0
Copy link
Contributor Author

pado0 commented Nov 7, 2025

I'll work on the next Stats class once comments are resolved and this PR is merged!

@sandeshkr419 sandeshkr419 reopened this Nov 7, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Nov 7, 2025

❌ Gradle check result for 78938ec: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

@github-actions
Copy link
Contributor

github-actions bot commented Nov 7, 2025

❌ Gradle check result for 78938ec: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

@github-actions
Copy link
Contributor

github-actions bot commented Nov 7, 2025

✅ Gradle check result for 78938ec: SUCCESS

@sandeshkr419 sandeshkr419 merged commit 51aa21a into opensearch-project:main Nov 7, 2025
35 of 39 checks passed
@pado0 pado0 deleted the builder-condition-directory-stats branch November 8, 2025 22:02
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