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

Escape slashes from resource names when generating filenames #521

Merged
merged 1 commit into from
Nov 13, 2024

Conversation

K-Phoen
Copy link
Member

@K-Phoen K-Phoen commented Nov 12, 2024

For some resources, grizzly uses the resource name/title as UID. This value is then directly used to generate a path on the filesystem under which it will be written.

If this value contains slashes, grizzly will write end up writing the resource at an unexpected location.

To avoid that, this PR replaces slashes by - when generating filenames from resources.

@K-Phoen K-Phoen self-assigned this Nov 12, 2024
@K-Phoen K-Phoen requested a review from a team as a code owner November 12, 2024 00:10
@malcolmholmes
Copy link
Contributor

The slashes were the seperator before we switched to dots. It should be dots everywhere, but slashes supported for back-compat. Personally, I'd suggest that the switch was so long ago that removing all mention of slashes in the code would be quite reasonable (if back-incompat).

@K-Phoen
Copy link
Member Author

K-Phoen commented Nov 12, 2024

That's true for resource references via the CLI, right? Like grr get Dashboard/some-uid that became grr get Dashboard.some-uid

This PR doesn't change anything related to how resource refs are handled, it changes how resource file paths are generated.

@K-Phoen K-Phoen merged commit 26e89e4 into main Nov 13, 2024
7 checks passed
@K-Phoen K-Phoen deleted the slashes-resource-name branch November 13, 2024 22:39
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.

3 participants