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: historical-usage date calculation bug #9257

Merged
merged 1 commit into from
Apr 26, 2024

Conversation

keita-determined
Copy link
Contributor

@keita-determined keita-determined commented Apr 26, 2024

Ticket

DET-10249

Description

value prop was directly modified in calendar onChange handler. That caused unintentional state change.

Test Plan

  • Go to historical usage page /clusters/historical-usage
  • Set the from range too far (more than a year) with group by day and months
  • Check if start date cannot be after end date error is not shown and correctly call /api/v1/resources/allocation/aggregated API

Checklist

  • Changes have been manually QA'd
  • User-facing API changes need the "User-facing API Change" label.
  • Release notes should be added as a separate file under docs/release-notes/.
    See Release Note for details.
  • Licenses should be included for new code which was copied and/or modified from any external code.

@cla-bot cla-bot bot added the cla-signed label Apr 26, 2024
@keita-determined keita-determined marked this pull request as ready for review April 26, 2024 19:12
@keita-determined keita-determined requested a review from a team as a code owner April 26, 2024 19:12
Copy link

netlify bot commented Apr 26, 2024

Deploy Preview for determined-ui ready!

Name Link
🔨 Latest commit 5c98f31
🔍 Latest deploy log https://app.netlify.com/sites/determined-ui/deploys/662bfcfd72dd6200081174c1
😎 Deploy Preview https://deploy-preview-9257--determined-ui.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

codecov bot commented Apr 26, 2024

Codecov Report

Attention: Patch coverage is 0% with 15 lines in your changes are missing coverage. Please review.

Project coverage is 38.00%. Comparing base (32b6ce6) to head (5c98f31).
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9257      +/-   ##
==========================================
- Coverage   44.71%   38.00%   -6.71%     
==========================================
  Files        1271      947     -324     
  Lines      155397   115741   -39656     
  Branches     2436     2437       +1     
==========================================
- Hits        69487    43993   -25494     
+ Misses      85673    71511   -14162     
  Partials      237      237              
Flag Coverage Δ
harness ?
web 35.21% <0.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
...rc/pages/Cluster/ClusterHistoricalUsageFilters.tsx 0.00% <0.00%> (ø)

... and 324 files with indirect coverage changes

@@ -53,32 +54,34 @@ const ClusterHistoricalUsageFilters: React.FC<ClusterHistoricalUsageFiltersProps

const handleAfterDateSelect = (afterDate: Dayjs | null) => {
if (!afterDate) return;
const val = _.cloneDeep(value);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

value from props should not be directly modified.

@carolinaecalderon carolinaecalderon added the to-cherry-pick Pull requests that need to be cherry-picked into the current release label Apr 26, 2024
Copy link
Contributor

@gt2345 gt2345 left a comment

Choose a reason for hiding this comment

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

Works as expected

@keita-determined keita-determined merged commit 8794e42 into main Apr 26, 2024
89 of 101 checks passed
@keita-determined keita-determined deleted the fix/historical-usage-bug branch April 26, 2024 22:28
github-actions bot pushed a commit that referenced this pull request Apr 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed to-cherry-pick Pull requests that need to be cherry-picked into the current release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants