#6344 Only allow web based svn import if repo is empty

v1.0.0
closed
nobody
General
2015-08-20
2013-06-07
Chris Tsai
No

Had an incident this past week where a project accidentally wiped out their repository by trying to import while on the page for the wrong repo (and apparently provided incorrect data in the form as well).

I think a good option to prevent this in the future would be to only allow repo imports over empty repos (might also prevent issues with trying to import onto a repo that's been borked via direct edits). Requiring the explicit extra step of deleting and recreating the repo should prevent unintentional overwriting.

Related

Tickets: #6344

Discussion

  • Dave Brondsema

    Dave Brondsema - 2013-06-18
    • Milestone: limbo --> forge-backlog
     
  • Dave Brondsema

    Dave Brondsema - 2013-06-18

    Let's keep the "Import Repo" admin link, so people know it's there, but then on the importer page, check to see if the repo is really empty (IIRC, svn tree view template checks this too). If it is really empty, show the regular form. If it's not empty say this instead of showing the form: "You cannot import into a repository that already has commits in it. Please delete this SVN tool if you really want to delete this whole repository. Then install a new SVN tool and you will be able to import into it."

     
  • Dave Brondsema

    Dave Brondsema - 2013-06-18
    • labels: for-support --> for-support, 42cc
     
  • Chris Tsai - 2013-06-18

    We can probably remove the warning lines at the same time.

    "Be careful! Importing will overwrite current repository contents."
    "If you really, really want to do this, enter the URL of the source repository below:"

     
  • Dave Brondsema

    Dave Brondsema - 2013-06-18

    Also, validate that the repo is empty when handling a form submit (not just for the template display).

    On the template, we can also remove the "Be careful! Importing will overwrite current repository contents." and "If you really, really want to do this,"

     
  • Igor Bondarenko - 2013-06-19
    • status: open --> in-progress
     
  • Igor Bondarenko - 2013-06-19

    Created #379: [#6344] Only allow web based svn import if repo is empty (1cp)

     

    Related

    Tickets: #6344

  • Igor Bondarenko - 2013-06-25
    • status: in-progress --> code-review
     
  • Igor Bondarenko - 2013-06-25

    Closed #379. je/42cc_6344

     
    • QA: Tim Van Steenburgh
     
    • status: code-review --> closed
    • Milestone: forge-backlog --> forge-jun-28
     

Log in to post a comment.