Skip to content

Remove URL normalisation #1686

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

Merged

Conversation

ivanayov
Copy link
Collaborator

As a target path is a URL path it's not correct to consider it as
interchangeable with a filepath within every operation system. The
unquote is also removed as the ngclient cannot assume correctly
which encoding is intended and which not

Fixes #1483

  • The code follows the Code Style Guidelines
  • [n/a] Tests have been added for the bug fix or new feature
  • [n/a] Docs have been added for the bug fix or new feature

@jku
Copy link
Member

jku commented Nov 22, 2021

tuf/download.py is legacy code base, should not be touched.

The other failures are all in test_updater_ng: my first guess would be the test setup is broken: maybe the test setup uses local file paths as URL parts.

@ivanayov ivanayov force-pushed the ivanayov/remove_url_normalisation branch from c9440dc to ad7feb4 Compare November 22, 2021 12:50
@coveralls
Copy link

coveralls commented Nov 22, 2021

Pull Request Test Coverage Report for Build 1490229889

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+1.0%) to 98.47%

Totals Coverage Status
Change from base Build 1476295870: 1.0%
Covered Lines: 3280
Relevant Lines: 3300

💛 - Coveralls

@ivanayov ivanayov force-pushed the ivanayov/remove_url_normalisation branch 2 times, most recently from 6da61b6 to 3407881 Compare November 22, 2021 15:30
Copy link
Member

@jku jku left a comment

Choose a reason for hiding this comment

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

I really dislike hard coding OS specific path separators even in test code... but it looks like not doing that would mean we'd have to make the test infrastructure simpler, which is likely a bigger task and requires more infrastructure context.

So... maybe we take this as a win (removing hard coded OS specific path separators from actual library is still a big improvement, even if we just move them to tests), and move on.

@sechkova mind having a look, any opinions?

@sechkova
Copy link
Contributor

I agree with you, I'm ok with changing the tests like this for now. I only have one comment about test_fetcher_ng.

Copy link
Member

@jku jku left a comment

Choose a reason for hiding this comment

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

marking "request changes" for @sechkovas basename finding: leave a comment if it turns out to be actually necessary

As a target path is a URL path it's not correct to consider it as
interchangeable with a filepath within every operation system. The
unquote is also removed as the ngclient cannot assume correctly
which encoding is intended and which not

Fixes theupdateframework#1483

Signed-off-by: Ivana Atanasova <iyovcheva@iyovcheva-a02.vmware.com>
@ivanayov ivanayov force-pushed the ivanayov/remove_url_normalisation branch from 3407881 to aa59192 Compare November 25, 2021 13:42
@ivanayov
Copy link
Collaborator Author

@jku @sechkova you've been right. Probably test_fetcher_ng used to fail due to some other change that's been removed now. I discarded the changes there.

@jku
Copy link
Member

jku commented Nov 30, 2021

Thanks!

@jku jku merged commit bca1e67 into theupdateframework:develop Nov 30, 2021
@lukpueh lukpueh mentioned this pull request Dec 13, 2021
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.

ngclient: remove URL normalization
4 participants