Add additional validation for Git and SVN repos.

Review Request #13223 — Created Aug. 18, 2023 and submitted — Latest diff uploaded

Information

Review Board
release-6.x

Reviewers

We have two cases that have come up semi-frequently, tripping up users
when they're trying to configure their repositories:

  1. Users were putting in a raw file path to an SVN repository, where it
    needs a file:// URL.
  2. When configuring a Git repo, they'd enter their SVN clone address but
    leave out the raw file URL. This one is especially confusing because
    a lot of people expect Git to just work, and don't read our
    documentation about why it doesn't.

This change adds new repository form subclasses that can validate these
conditions.

  • Verified that I wasn't able to save an SVN repo pointing to a bare
    filesystem path, but could with file:// and https://
  • Verified that trying to save a Git repo with a path but no raw file
    URL would fail.
  • Made sure that saving with a raw file URL or Git repos on a hosting
    service still worked correctly.
  • Ran unit tests.

Diff Revision 2

This is not the most recent revision of the diff. The latest diff is revision 4. See what's changed.

orig
1
2
3
4

Commits

First Last Summary ID Author
Add additional validation for Git and SVN repos.
We have two cases that have come up semi-frequently, tripping up users when they're trying to configure their repositories: 1. Users were putting in a raw file path to an SVN repository, where it needs a `file://` URL. 2. When configuring a Git repo, they'd enter their SVN clone address but leave out the raw file URL. This one is especially confusing because a lot of people expect Git to just work, and don't read our documentation about why it doesn't. This change adds new repository form subclasses that can validate these conditions. Testing Done: - Verified that I wasn't able to save an SVN repo pointing to a bare filesystem path, but could with file:// and https:// - Verified that trying to save a Git repo with a path but no raw file URL would fail. - Made sure that saving with a raw file URL or Git repos on a hosting service still worked correctly. - Ran unit tests.
e8e46b1bfd3ee093f855ba77e0f88d7880a04464 David Trowbridge
reviewboard/scmtools/git.py
reviewboard/scmtools/svn/__init__.py
reviewboard/scmtools/tests/test_git.py
reviewboard/scmtools/tests/test_repository_form.py
reviewboard/scmtools/tests/test_svn.py
reviewboard/webapi/tests/test_repository.py
Loading...