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 handling of URL in file field #7347

Merged
merged 8 commits into from
Jan 24, 2021
Merged

Conversation

koppor
Copy link
Member

@koppor koppor commented Jan 14, 2021

One test introduced in #7043 raises an exception on Windows, because : is not allowed as path separator.

This PR adds a workaround.

Alternative: @DisableOnWindows test annotation. Since we (hopefully) need that only once, we decided for a quick workaround by checking for OS.WINDOWS.

  • Change in CHANGELOG.md described (if applicable)
  • Tests created for changes (if applicable)
  • Manually tested changed features in running JabRef (always required)
  • Screenshots added in PR description (for UI changes)
  • Checked documentation: Is the information available and up to date? If not created an issue at https://github.com/JabRef/user-documentation/issues or, even better, submitted a pull request to the documentation repository.

Siedlerchr
Siedlerchr previously approved these changes Jan 14, 2021
calixtus
calixtus previously approved these changes Jan 14, 2021
Co-authored-by: Dominik Voigt <[email protected]>
@koppor koppor dismissed stale reviews from calixtus and Siedlerchr via 561f259 January 14, 2021 22:59
@tobiasdiez tobiasdiez added the status: changes required Pull requests that are not yet complete label Jan 15, 2021
@Siedlerchr Siedlerchr mentioned this pull request Jan 17, 2021
1 task
@koppor
Copy link
Member Author

koppor commented Jan 20, 2021

Bug should be resolved. Changes added.

Fixes #7359. Added test cases for that, too.

@koppor koppor removed the status: changes required Pull requests that are not yet complete label Jan 20, 2021
@koppor koppor changed the title Add workaround of test not working on Windows Fix handling of URL in file field Jan 20, 2021
@Siedlerchr Siedlerchr added the status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers label Jan 21, 2021
Siedlerchr
Siedlerchr previously approved these changes Jan 22, 2021
calixtus
calixtus previously approved these changes Jan 24, 2021
Copy link
Member

@calixtus calixtus left a comment

Choose a reason for hiding this comment

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

Seems to me the requested changes have been addressed and the code looks good to me. So...

@calixtus
Copy link
Member

Well, a test is still failing.

@koppor koppor dismissed stale reviews from calixtus and Siedlerchr via dd05264 January 24, 2021 20:30
@koppor
Copy link
Member Author

koppor commented Jan 24, 2021

Had to fix a checkstyle issue.

Also added a heuristics for // so that the thing is consistent on Linux and Windows. --> // is kept when converting to an internal representation (before, on windows, it was kept, on Linux, it was shrunk to /).

Should be ready now.

Copy link
Member

@tobiasdiez tobiasdiez left a comment

Choose a reason for hiding this comment

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

LGTM

Maybe it's time to introduce OnlineLinkedFile, PathLinkedFile and InvalidLinkedFile deriving from an abstract LinkedFile class (as we currently parse a string to a LinkedFile trying to convert strings to paths and urls, but then LinkedFile converts them to a string again...). Something for another time.

@tobiasdiez tobiasdiez merged commit ae43548 into master Jan 24, 2021
@tobiasdiez tobiasdiez deleted the hotfix-for-test-on-windows branch January 24, 2021 23:26
Siedlerchr added a commit to JabRef/jabref-koppor that referenced this pull request Jan 26, 2021
* upstream/master: (217 commits)
  Fix handling of URL in file field (JabRef#7347)
  Fix expansion of bracketed expressions in RegExpBasedFileFinder (JabRef#7338)
  Refactor unlinked files (JabRef#7209)
  Add pressing enter when the search field is focused as a way to trigger search (JabRef#7377)
  Upgrade citeproc to 3.x snapshot without graal (JabRef#7370)
  Fix Exception if no AzureInstrumentationKey is available (JabRef#7373)
  Update snapcraft source url (JabRef#7372)
  Fix checkstyle and adjust language
  GitBook: [master] 3 pages and 32 assets modified
  Add migration to special field (JabRef#7368)
  GitBook: [master] 5 pages and 29 assets modified
  Modify message at the duplicates found dialog (JabRef#7231)
  Fixes miss-parsed names in `AutomaticPersonsGroup` (JabRef#7228)
  Fix an issue where the password for a shared SQL database was only remembered if it was the same as the username (JabRef#7364)
  Fix harvard exporter by changing AuthorsFormatter (JabRef#7355)
  Bump styfle/cancel-workflow-action from 0.6.0 to 0.7.0 (JabRef#7363)
  Bump mockito-core from 3.7.0 to 3.7.7 (JabRef#7360)
  Bump org.beryx.jlink from 2.23.1 to 2.23.2 (JabRef#7361)
  Bump libreoffice from 7.0.3 to 7.0.4 (JabRef#7362)
  Export full month name instead of number in ms office (JabRef#7358)
  ...

# Conflicts:
#	external-libraries.md
#	src/main/java/module-info.java
#	src/main/java/org/jabref/gui/shared/SharedDatabaseLoginDialogViewModel.java
Siedlerchr added a commit that referenced this pull request Feb 1, 2021
* upstream/master:
  Bump archunit-junit5-api from 0.15.0 to 0.16.0 (#7407)
  Bump classgraph from 4.8.98 to 4.8.102 (#7401)
  Bump archunit-junit5-engine from 0.15.0 to 0.16.0 (#7402)
  Bump mariadb-java-client from 2.7.1 to 2.7.2 (#7406)
  Bump org.beryx.jlink from 2.23.2 to 2.23.3 (#7400)
  Bump checkstyle from 8.39 to 8.40 (#7404)
  Ignore codecov status for automerge
  Fixes issue of Changing font size makes font size field too small (#7398)
  fix "Alt + keyboard shortcuts do not work" (#7379)
  Fixed invisible file path in the dark theme (#7396)
  Fix File Filter and some layout issues (#7385)
  Feature/implement complex queries (#7350)
  Change format for study definition to yaml (#7126)
  Fix handling of URL in file field (#7347)
  Fix expansion of bracketed expressions in RegExpBasedFileFinder (#7338)
@calixtus calixtus mentioned this pull request Feb 15, 2021
1 task
@calixtus
Copy link
Member

For the record: Fixes #6859

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants