Skip to content
This repository was archived by the owner on Apr 16, 2022. It is now read-only.

Issue 844 portable metadata files #847

Merged
merged 3 commits into from
Jan 8, 2020
Merged

Issue 844 portable metadata files #847

merged 3 commits into from
Jan 8, 2020

Conversation

ggalmazor
Copy link
Contributor

Closes #844

What has been done to verify that this works as intended?

Two things:

  • Manually pulled some forms in a Windows 10 box and verified that the paths in the metadata.json files contain / dir separators (instead of the standard \ for Windows)

    Also verified that Briefcase can read these paths and work in Windows 10 too.

  • Added new automated tests to verify we will never include /, or \ in form directory names.

    \ would be valid in *nix filenames, but then we would have portability issues in Windows.

Why is this the best possible solution? Were any other approaches considered?

This PR felt like it fell kinda short in two ways:

  • I couldn't find anything provided by Java that could solve this portability issues. Weirdly, after exploring some user solutions, doing string replacements is what most people were recommending.
  • I coulnd't express the full behavior change in a junit test (without expending more time on it) because it would require emulating the different filesystems involved.

How does this change affect users? Describe intentional changes to behavior and behavior that could have accidentally been affected by code changes. In other words, what are the regression risks?

The most risky assumption is that, according to official Java docs, / dir separators should work both in Windows and *nix platforms. Other than that, changes in this PR feel pretty much safe.

Does this change require updates to documentation? If so, please file an issue at https://github.com/opendatakit/docs/issues/new and include the link below.

Nope.

@ggalmazor ggalmazor requested a review from dcbriccetti December 9, 2019 12:38
@ggalmazor ggalmazor added the bug label Dec 9, 2019
@ggalmazor ggalmazor added this to the v1.17.2 milestone Dec 9, 2019
@kkrawczyk123
Copy link
Contributor

Tested with success!
I have checked if forms pulled on Windows have in metadata file / dir separators as in other systems.
I have also checked if the content of sd created on Windows is useable on Ubuntu and Mac.
I have checked if sd created on Ubuntu and MacOS are also useable on Windows.
I was testing on Windows 10.

@opendatakit-bot unlabel "needs testing"
@opendatakit-bot label "behavior verified"

@ggalmazor ggalmazor merged commit 08ca7c0 into getodk:master Jan 8, 2020
@ggalmazor ggalmazor deleted the issue_844_portable_metadata_files branch January 8, 2020 14:47
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Metadata files not portable between Windows and macOS/Linux
4 participants