Skip to content

Conversation

robert-uhl
Copy link
Contributor

Addresses MLDM-56 and MLDM-45.

Copy link

github-actions bot commented Sep 20, 2024

size-limit report 📦

Path Size
Entry 93.11 KB (0%)
Vendor XL 800.86 KB (0%)
Chunks 292.47 KB (0%)
Everything 1.16 MB (0%)

@robert-uhl robert-uhl marked this pull request as ready for review September 20, 2024 19:58
Copy link

codecov bot commented Sep 20, 2024

Codecov Report

Attention: Patch coverage is 83.33333% with 1 line in your changes missing coverage. Please review.

Project coverage is 62.44%. Comparing base (bf7a823) to head (ed908ce).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
src/internal/storage/server.go 83.33% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #10350      +/-   ##
==========================================
+ Coverage   62.40%   62.44%   +0.03%     
==========================================
  Files        1218     1218              
  Lines       87608    87609       +1     
  Branches     1820     1820              
==========================================
+ Hits        54675    54707      +32     
+ Misses      32259    32227      -32     
- Partials      674      675       +1     
Flag Coverage Δ
62.44% <83.33%> (+0.03%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

}
if ttl > maxTTL {
return nil, errors.Errorf("ttl (%d) exceeds max ttl (%d)", ttl, maxTTL)
var ttl time.Duration
Copy link
Contributor

Choose a reason for hiding this comment

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

Nits, ttl could just be declared where it is set and I don't think the comment is really necessary. The implicit structure should just be validate then process with the expectation that the inputs are valid at that point.

@@ -419,3 +420,28 @@ func checkFilesetCDR(ctx context.Context, t *testing.T, c storage.FilesetClient,
}
require.Equal(t, 0, len(expected))
}

func TestRenewFileset(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

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

This seems like it should indicate it is testing the validation. Maybe in the test name, or just a subtest such that we could add other types of subtests later.

require.True(t, strings.Contains(err.Error(), "exceeds max ttl"))
_, err = c.RenewFileset(ctx, &storage.RenewFilesetRequest{
FilesetId: id,
TtlSeconds: 1800000000000,
Copy link
Contributor

Choose a reason for hiding this comment

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

This test case seems unnecessary, and would require maintenance if we changed the max ttl. Also, it looks like there are duplicate max ttl error checks below this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I’ve removed the duplicated error check.

This test case is deliberately trying to test that a value much greater than the max TTL but much less than the maximum int64 is invalidated.

Copy link
Contributor

@brycemcanally brycemcanally left a comment

Choose a reason for hiding this comment

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

lgtm, just a few minor changes suggested. The renew fileset endpoint in the PFS API would also benefit from this change.

@robert-uhl robert-uhl merged commit c615493 into master Sep 25, 2024
26 checks passed
@robert-uhl robert-uhl deleted the rau/mldm-52-mldm-45-ttl-seconds branch September 25, 2024 14:09
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.

2 participants