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](https://github.com/RadhoueneRouached/Groove/wiki) and do some heuristic 
(presence of "Create the first page" button, maybe) but that's kinda fragile.


---

** [tickets:#7808] Check for wiki presence before importing it**

**Status:** in-progress
**Milestone:** unreleased
**Labels:** github sf-current import 42cc 
**Created:** Thu Dec 18, 2014 03:05 PM UTC by Dave Brondsema
**Last Updated:** Wed Jan 07, 2015 12:52 PM UTC
**Owner:** Igor Bondarenko

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


---

Sent from forge-allura.apache.org because [email protected] is subscribed 
to https://forge-allura.apache.org/p/allura/tickets/

To unsubscribe from further messages, a project admin can change settings at 
https://forge-allura.apache.org/p/allura/admin/tickets/options.  Or, if this is 
a mailing list, you can unsubscribe from the mailing list.

Reply via email to