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

API refactor: make ReleaseRequest responsible for abspath #134

Merged
merged 2 commits into from
Mar 5, 2024

Conversation

bloodearnest
Copy link
Member

  • Use container abspath in _absolute_path
  • Handle request abspath in the api layer.

I accidentally duplicated the logic here
A path locating a file in a request has the form `group/path/file`, and
the file on disk is just `root/path/file`. Previously, this discrepency
was handled in file_browser_api layer, at tree construction time.

Building on the previous commit, we move this to be a responsibility of
the ReleaseRequest container. Its abspath() now expected the full path
including group, validates the group part, and returns the abspath on
disk.

Also, in the copy logic, we no longer use abspath to get the destination
path, instead using `root / path`. This means abspath can now verify the
path exists, like workspaces abspath does.

This is much cleaner, and removes some logic and attributes from
PathItem.
@bloodearnest bloodearnest merged commit d7cffa6 into main Mar 5, 2024
8 checks passed
@bloodearnest bloodearnest deleted the api-cleanups branch March 5, 2024 15:06
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