Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ui): Fix last release bubble bucket #86956

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

billyvg
Copy link
Member

@billyvg billyvg commented Mar 12, 2025

The last release bubble has some more recent releases filtered out because the meaning of maxTime differs between the time series plots and the release buckets:

image

This PR changes the bucketing logic so it adds releases > maxTime to the last bucket. It assumes we fetch the correct releases outside of the buckets.

We will have to fix the tooltip to reflect this without changing maxTime.

ref #85775

@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Mar 12, 2025
Copy link

codecov bot commented Mar 12, 2025

❌ 4 Tests Failed:

Tests completed Failed Passed Skipped
9943 4 9939 4
View the top 3 failed test(s) by shortest run time
createReleaseBuckets buckets releases correctly
Stack Traces | 0.003s run time
TypeError: releases is not iterable
    at createReleaseBuckets (.../releaseBubbles/utils/createReleaseBuckets.tsx:57:25)
    at Object.<anonymous> (.../releaseBubbles/utils/createReleaseBuckets.spec.tsx:101:68)
    at Promise.then.completed (.../jest-circus/build/utils.js:298:28)
    at new Promise (<anonymous>)
    at callAsyncCircusFn (.../jest-circus/build/utils.js:231:10)
    at _callCircusTest (.../jest-circus/build/run.js:316:40)
    at processTicksAndRejections (node:internal/process/task_queues:105:5)
    at _runTest (.../jest-circus/build/run.js:252:3)
    at _runTestsForDescribeBlock (.../jest-circus/build/run.js:126:9)
    at _runTestsForDescribeBlock (.../jest-circus/build/run.js:121:9)
    at run (.../jest-circus/build/run.js:71:3)
    at runAndTransformResultsToJestFormat (.../build/legacy-code-todo-rewrite/jestAdapterInit.js:122:21)
    at jestAdapter (.../build/legacy-code-todo-rewrite/jestAdapter.js:79:19)
    at runTestInternal (.../jest-runner/build/runTest.js:367:16)
    at runTest (.../jest-runner/build/runTest.js:444:34)
    at Object.worker (.../jest-runner/build/testWorker.js:106:12)
createReleaseBuckets creates correct # of buckets for timeSeries with [min, max] of [1508208080000, 1508208081000] and 20 desired buckets
Stack Traces | 0.003s run time
TypeError: releases is not iterable
    at createReleaseBuckets (.../releaseBubbles/utils/createReleaseBuckets.tsx:57:25)
    at .../releaseBubbles/utils/createReleaseBuckets.spec.tsx:7:68
    at Object.<anonymous> (.../jest-each/build/bind.js:81:13)
    at Promise.then.completed (.../jest-circus/build/utils.js:298:28)
    at new Promise (<anonymous>)
    at callAsyncCircusFn (.../jest-circus/build/utils.js:231:10)
    at _callCircusTest (.../jest-circus/build/run.js:316:40)
    at processTicksAndRejections (node:internal/process/task_queues:105:5)
    at _runTest (.../jest-circus/build/run.js:252:3)
    at _runTestsForDescribeBlock (.../jest-circus/build/run.js:126:9)
    at _runTestsForDescribeBlock (.../jest-circus/build/run.js:121:9)
    at run (.../jest-circus/build/run.js:71:3)
    at runAndTransformResultsToJestFormat (.../build/legacy-code-todo-rewrite/jestAdapterInit.js:122:21)
    at jestAdapter (.../build/legacy-code-todo-rewrite/jestAdapter.js:79:19)
    at runTestInternal (.../jest-runner/build/runTest.js:367:16)
    at runTest (.../jest-runner/build/runTest.js:444:34)
    at Object.worker (.../jest-runner/build/testWorker.js:106:12)
createReleaseBuckets creates the correct buckets
Stack Traces | 0.003s run time
TypeError: releases is not iterable
    at createReleaseBuckets (.../releaseBubbles/utils/createReleaseBuckets.tsx:57:25)
    at Object.<anonymous> (.../releaseBubbles/utils/createReleaseBuckets.spec.tsx:13:68)
    at Promise.then.completed (.../jest-circus/build/utils.js:298:28)
    at new Promise (<anonymous>)
    at callAsyncCircusFn (.../jest-circus/build/utils.js:231:10)
    at _callCircusTest (.../jest-circus/build/run.js:316:40)
    at processTicksAndRejections (node:internal/process/task_queues:105:5)
    at _runTest (.../jest-circus/build/run.js:252:3)
    at _runTestsForDescribeBlock (.../jest-circus/build/run.js:126:9)
    at _runTestsForDescribeBlock (.../jest-circus/build/run.js:121:9)
    at run (.../jest-circus/build/run.js:71:3)
    at runAndTransformResultsToJestFormat (.../build/legacy-code-todo-rewrite/jestAdapterInit.js:122:21)
    at jestAdapter (.../build/legacy-code-todo-rewrite/jestAdapter.js:79:19)
    at runTestInternal (.../jest-runner/build/runTest.js:367:16)
    at runTest (.../jest-runner/build/runTest.js:444:34)
    at Object.worker (.../jest-runner/build/testWorker.js:106:12)

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

@billyvg billyvg marked this pull request as ready for review March 13, 2025 19:51
@billyvg billyvg requested a review from a team as a code owner March 13, 2025 19:51
@billyvg billyvg force-pushed the fix-ui-release-bubbles-missing-most-recent-bucket branch from 9080779 to 0be4c82 Compare March 13, 2025 20:06
@billyvg billyvg force-pushed the fix-ui-release-bubbles-missing-most-recent-bucket branch from 6aeb6eb to 6317e09 Compare March 13, 2025 20:42
currentBucket.releases.push(release);
} else if (releaseTs > maxTime) {
Copy link
Member Author

Choose a reason for hiding this comment

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

I suppose we don't necessarily need this based on our assumption about releases being properly constrained to the correct timeframe, but this was to prevent adding releases with date < minTs into the last bucket.

// the last bucket, as the last buckets width can be less than the
// others. (i.e. if the total time difference is not perfectly divible by
// `desiredBuckets`, the last bucket will be the remainder)
if (bucketEndTs && releaseTs <= bucketEndTs) {
Copy link
Member Author

Choose a reason for hiding this comment

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

You were kinda right about this @gggritso

Copy link
Member

Choose a reason for hiding this comment

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

@billyvg 😂 what did I say about this, I don't remember!

Copy link
Member Author

Choose a reason for hiding this comment

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

I dug it up to refer to: #85270 (comment) -- we in fact do want to include releases more recent than the time series. maxTime is equivalent to the latest plotted date -- but the data at that point includes [maxTime, now], but the releases bucket was only including up to maxTime

@billyvg billyvg requested a review from a team March 13, 2025 20:49
Copy link
Member

@gggritso gggritso left a comment

Choose a reason for hiding this comment

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

I defer to you on what's the best experience here, but genuinely wondering if it's really that bad to let the final bubble extend the X axis!

// and for its last bucket, it's ending boundary is `maxTime` to
// correspond to the chart. We cannot change `maxTime` for the buckets
// otherwise we will draw bubbles past the chart data and it would look
// broken.
Copy link
Member

Choose a reason for hiding this comment

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

Okay I have a question about this. How broken would it look? You're doing a lot of work to jam the latest releases in the last bucket (which is completely fine) but I'm curious what happens if you just don't. If you leave things as-is, and let the final bubble extend the X axis to the current timestamp, what happens? Does it add some blank space on the right side of the chart? Or something worse?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Scope: Frontend Automatically applied to PRs that change frontend components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants