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: Use slashes in folder names instead of division slashes added by Gazer #152

Conversation

sean-rose
Copy link
Contributor

When Gazer exports folders it replaces slashes with division slashes (Unicode character 2215) in the corresponding local folder name, and when Looker Deployer is importing content it's using the local folder names to create folders in the target Looker instance, which results in folders whose names contain slashes getting slightly mangled to contain division slashes when they're imported. This PR attempts to restore the original folder names containing normal slashes when importing.

@sean-rose sean-rose requested a review from a team as a code owner December 4, 2024 17:46
@@ -134,6 +134,9 @@ def build_spaces(spaces, sdk):
id_tracker = ["0"]

for space in spaces:
# Gazer replaces slashes in folder names with division slashes (Unicode character 2215), so undo that.
space = space.replace("\u2215", "/")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is an admittedly kludgy way to do this, and runs the risk of mangling folders which had division slashes in their original names. However, I'm betting the number of cases where folders have normal slashes in their names is vastly greater than cases where folders legitimately have division slashes in their names, and the needs of the many outweigh the needs of the few.

The folder JSON files exported by Gazer do contain the original unmangled folder names, so a more robust approach could be to use those folder JSON files when present, but I didn't see a straightforward way to do that given the existing code patterns and Looker Deployer's feature to deploy to a different target folder.

@sean-rose sean-rose changed the title Use slashes in folder names instead of division slashes added by Gazer fix: Use slashes in folder names instead of division slashes added by Gazer Dec 4, 2024
…ight have been replaced with division slashes.
@drstrangelooker drstrangelooker changed the base branch from main to fix-folder-slashes December 4, 2024 18:01
@drstrangelooker drstrangelooker merged commit 26c859b into looker-open-source:fix-folder-slashes Dec 4, 2024
3 checks passed
@drstrangelooker
Copy link
Contributor

Need to merge to a local branch, then open a new PR so the tests run properly.

@sean-rose
Copy link
Contributor Author

Need to merge to a local branch, then open a new PR so the tests run properly.

The CI checks that were failing seem to be due to deprecated artifact actions being used:

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