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: local checkpoint download path fix #8722

Merged
merged 1 commit into from
Jan 22, 2024

Conversation

erikwilson
Copy link
Contributor

Description

Fixes an issue with local checkpoint download where file contents are relative to the root.

Test Plan

e2e tests

Commentary (optional)

This bug fix is for unreleased code in PR #8684.

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.

Ticket

@erikwilson erikwilson requested a review from a team as a code owner January 22, 2024 16:05
@cla-bot cla-bot bot added the cla-signed label Jan 22, 2024
Copy link

netlify bot commented Jan 22, 2024

Deploy Preview for determined-ui canceled.

Name Link
🔨 Latest commit 4cfe9fd
🔍 Latest deploy log https://app.netlify.com/sites/determined-ui/deploys/65ae92663174ee00080066b1

Copy link

codecov bot commented Jan 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (190af1d) 47.26% compared to head (4cfe9fd) 47.25%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8722      +/-   ##
==========================================
- Coverage   47.26%   47.25%   -0.01%     
==========================================
  Files        1045     1045              
  Lines      166692   166692              
  Branches     2244     2244              
==========================================
- Hits        78780    78777       -3     
- Misses      87754    87757       +3     
  Partials      158      158              
Flag Coverage Δ
backend 40.95% <ø> (-0.01%) ⬇️
harness 64.29% <ø> (ø)
web 42.56% <ø> (ø)

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

see 3 files with indirect coverage changes

if !strings.HasSuffix(prefix, "/") {
prefix += "/"
}
return &LocalDownloader{
aw: aw,
prefix: filepath.Clean(prefix),
Copy link
Contributor

Choose a reason for hiding this comment

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

why do we need filepath.Clean in the first place?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the original instance of filepath.Clean in archivePath was added because the go sec linter desired some validation for open, altho one could argue we could ignore the linter there. it does seem helpful to cleanup the input here as we don't need to be as concerned with the internal implementation of filepath.Walk and what sort of path names might be returned when we trim the prefix during listing.

@erikwilson erikwilson merged commit f32e015 into main Jan 22, 2024
79 of 91 checks passed
@erikwilson erikwilson deleted the erikw/fix/local_fs_downloads_path branch January 22, 2024 16:57
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