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

chore: handle empty nested structs in run metadata as nil leaf nodes #9526

Merged
merged 1 commit into from
Jun 17, 2024

Conversation

corban-beaird
Copy link
Contributor

@corban-beaird corban-beaird commented Jun 14, 2024

Ticket

ET-306

Description

When submitting metadata with nested structs (maps/lists) that contain no elements, this would previously cause a 500 response. Instead, this changes that behavior to now treat these instances as leaf nodes for indexing with nil values & stores the metadata as expected.

Test Plan

  • Automated test runs_test.go:TestFlattenMetadataEmptyNestedStructs

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.

@corban-beaird corban-beaird requested a review from a team as a code owner June 14, 2024 17:35
@cla-bot cla-bot bot added the cla-signed label Jun 14, 2024
Copy link

netlify bot commented Jun 14, 2024

Deploy Preview for determined-ui canceled.

Name Link
🔨 Latest commit ae3e000
🔍 Latest deploy log https://app.netlify.com/sites/determined-ui/deploys/666c7f4e148c0e0009794a96

Copy link

codecov bot commented Jun 14, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 49.29%. Comparing base (b51bc93) to head (ae3e000).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #9526   +/-   ##
=======================================
  Coverage   49.28%   49.29%           
=======================================
  Files        1242     1242           
  Lines      161442   161452   +10     
  Branches     2868     2867    -1     
=======================================
+ Hits        79570    79588   +18     
+ Misses      81700    81692    -8     
  Partials      172      172           
Flag Coverage Δ
backend 43.93% <100.00%> (+0.02%) ⬆️
harness 63.81% <ø> (ø)
web 44.87% <ø> (ø)

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

Files Coverage Δ
master/internal/run/runs.go 88.34% <100.00%> (+1.25%) ⬆️

... and 5 files with indirect coverage changes

Copy link
Contributor

@AmanuelAaron AmanuelAaron left a comment

Choose a reason for hiding this comment

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

Looks good. Do we know why we don't get this error when there are other metadata types provided?

@corban-beaird corban-beaird merged commit fec31a1 into main Jun 17, 2024
87 of 102 checks passed
@corban-beaird corban-beaird deleted the corban-run-metadata-allow-empty-list-map branch June 17, 2024 21:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants