#7808 Check for wiki presence before importing it

v1.2.1
closed
General
2015-08-20
2014-12-18
No

The wiki import (both individual and full-project, I suspect) will throw an error if the wiki is not available. We should catch and handle that situation (e.g. silently skip on full-project import, and error to user on individual import form maybe) so that we don't have unnecessary error emails.

Importing the Wiki data from the Groove GitHub project to the groovejam SourceForge project failed with the error: 'git clone --bare -v https://github.com/radhouenerouached/Groove.wiki /tmp/tmpU1fq4V' returned exit status 128: fatal: remote error: access denied or repository not exported: /b/nw/bf/80/1f/107924511/28155028.wiki.git

Traceback (most recent call last):
  File "/var/local/allura/ForgeImporters/forgeimporters/base.py", line 131, in import_tool
    mount_point=mount_point, mount_label=mount_label, **kw)
  File "/var/local/allura/ForgeImporters/forgeimporters/github/wiki.py", line 162, in import_tool
    self.import_pages(wiki_url, history=with_history)
  File "/var/local/allura/ForgeImporters/forgeimporters/github/wiki.py", line 259, in import_pages
    wiki = git.Repo.clone_from(wiki_url, to_path=wiki_path, bare=True)
  File "/var/local/env-allura/lib/python2.7/site-packages/GitPython-0.3.2.RC1_20140304-py2.7.egg/git/repo/base.py", line 742, in clone_from
    return cls._clone(Git(os.getcwd()), url, to_path, GitCmdObjectDB, progress, **kwargs)
  File "/var/local/env-allura/lib/python2.7/site-packages/GitPython-0.3.2.RC1_20140304-py2.7.egg/git/repo/base.py", line 694, in _clone
    finalize_process(proc)
  File "/var/local/env-allura/lib/python2.7/site-packages/GitPython-0.3.2.RC1_20140304-py2.7.egg/git/util.py", line 129, in finalize_process
    proc.wait()
  File "/var/local/env-allura/lib/python2.7/site-packages/GitPython-0.3.2.RC1_20140304-py2.7.egg/git/cmd.py", line 101, in wait
    raise GitCommandError(self.args, status, self.proc.stderr.read())
GitCommandError: 'git clone --bare -v https://github.com/radhouenerouached/Groove.wiki /tmp/tmpU1fq4V' returned exit status 128: fatal: remote error: access denied or repository not exported: /b/nw/bf/80/1f/107924511/28155028.wiki.git

https://github.com/radhouenerouached/Groove

Discussion

  • Igor Bondarenko - 2015-01-05
    • labels: github, sf-current, import --> github, sf-current, import, 42cc
    • status: open --> in-progress
    • assigned_to: Igor Bondarenko
     
  • Igor Bondarenko - 2015-01-07

    I see GitHubWikiImporter already has check for wiki presence, but it relies on wrong data (project_info -> has_wiki in the github API response). This key only indicates that wiki is enabled, but does not provide any information if it actually has any pages. Github does not provide any other information regarding wiki in the API, so we can rely only on wiki repo being present.

    So, implementing "skip silently" behavior will be pretty easy, but I'm not sure about reporting error to user on individual import form... We can't reliably determine if wiki is present via API, and, obviously, we won't run git clone from within controller to determine that. We can request wiki home page and do some heuristic (presence of "Create the first page" button, maybe) but that's kinda fragile.

     
    • Dave Brondsema

      Dave Brondsema - 2015-01-07

      +1 to silent skip with no feedback then

       
  • Igor Bondarenko - 2015-01-08
    • status: in-progress --> review
     
  • Igor Bondarenko - 2015-01-08

    Closed #703. ib/7808

     
  • Dave Brondsema

    Dave Brondsema - 2015-01-09
    • labels: github, sf-current, import, 42cc --> github, sf-current, import, 42cc, sf-2
    • status: review --> closed
    • Reviewer: Dave Brondsema
     
  • Dave Brondsema

    Dave Brondsema - 2015-01-12
    • labels: github, sf-current, import, 42cc, sf-2 --> github, import, 42cc, sf-2
     
  • Igor Bondarenko - 2015-02-18
    • Milestone: unreleased --> asf_release_1.2.1
     

Log in to post a comment.