Skip to content

fix: Blocked time release metrics are incorrect #279#305

Open
YuliaMittova wants to merge 1 commit intotoloka-agent/159-autofrom
bugfix/279-blocked-time-release-metrics-are-incorrect
Open

fix: Blocked time release metrics are incorrect #279#305
YuliaMittova wants to merge 1 commit intotoloka-agent/159-autofrom
bugfix/279-blocked-time-release-metrics-are-incorrect

Conversation

@YuliaMittova
Copy link
Copy Markdown

Bugfix for issue #279

FAIL_TO_PASS: ReleaseMetricsIntegrationTests#shouldCorrectlyCalculateTotalBlockedDaysWhenNoFeatureIsBlocked, ReleaseMetricsIntegrationTests#shouldCorrectlyCalculateBlockedPercentageOfTimeWhenNoFeatureIsBlocked, ReleaseMetricsIntegrationTests#shouldCorrectlyCalculateTotalBlockedDaysForOneBlockedFeature, ReleaseMetricsIntegrationTests#shouldCorrectlyCalculateBlockedPercentageOfTimeForOneBlockedFeature, ReleaseMetricsIntegrationTests#shouldCorrectlyCalculateTotalBlockedDaysForSeveralBlockedFeature, ReleaseMetricsIntegrationTests#shouldCorrectlyCalculateBlockedPercentageOfTimeForSeveralBlockedFeature
@YuliaMittova YuliaMittova force-pushed the bugfix/279-blocked-time-release-metrics-are-incorrect branch from 84962e7 to 00c17ff Compare March 30, 2026 19:25
.mapToInt(f -> (int) (ChronoUnit.DAYS.between(f.getCreatedAt(), Instant.now())))
.sum();

int totalBlockedDays = blockedFeatures.size() * 5; // Simplified calculation
Copy link
Copy Markdown

@innokenty innokenty Mar 31, 2026

Choose a reason for hiding this comment

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

Lol, I just love how AI produced "Simplified calculations" 😂

@github-actions github-actions bot added Verified and removed Review labels Mar 31, 2026
.mapToInt(f -> (int) (ChronoUnit.DAYS.between(f.getUpdatedAt(), Instant.now())))
.sum();
final int totalDaysSinceCreated = features.stream()
.mapToInt(f -> (int) (ChronoUnit.DAYS.between(f.getCreatedAt(), Instant.now())))
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

According to comment from @ElizavetaP , I think we just need to change this line here:

Suggested change
.mapToInt(f -> (int) (ChronoUnit.DAYS.between(f.getCreatedAt(), Instant.now())))
.mapToInt(f -> (int) (ChronoUnit.DAYS.between(f.getCreatedAt(), f.getPlanningStatus() == FeaturePlanningStatus.DONE ? f.getUpdatedAt() : Instant.now())))

Copy link
Copy Markdown

@innokenty innokenty left a comment

Choose a reason for hiding this comment

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

Please address the discussion on the issue:

  • adjust calculation logic (suggestion provided)
  • adjust tests accordingly
  • replace "in between" assertions with proper value

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants