← Back to team overview

kicad-developers team mailing list archive

Re: [Patch] Add gitlab support to github plugin

 

Gitlab uses different URLs for zip file downloads. Rather than
<project>/zip/master the URLs are of the pattern
<project>/repository/archive.zip. There are similarities in the two APIs,
but they are not the same.

The URL cannot be <project> as in the kicad code that handles non github
servers; that points to the project main page.

On Wed, Aug 12, 2015 at 11:44 AM, Wayne Stambaugh <stambaughw@xxxxxxxxx>
wrote:

> Please help me understand the purpose of this patch.  Are you saying
> that the github plugin does not work when KIGITHUB has the properly
> specified URL and gitlab is configured properly?  What's different
> between gitlab and github access that necessitates this change?  I
> realize that it's a minor change but the comment in the source says it
> all and I would rather avoid polluting the source if there is an
> external solution.
>
> For future reference, please include you patch as an attachment rather
> than inline.  Bazaar is the VCS used by KiCad so inline patches are more
> work to apply.  The git repo is only a mirror for devs who prefer git.
> I noticed you created a pull request against the github mirror which
> will never happen because the github mirror is not the official
> development repo.
>
> On 8/8/2015 6:37 PM, Ian Roth wrote:
> > This allows users to host the footprint libraries on a local gitlab
> > server in case there is no access to github.
> >
> > I know this patch has the potential to be controversial because the code
> > in the plugin is supposed to be as generic as possible and that the
> > server should change. I would like to counter that by noting that gitlab
> > is probably the most popular option for self hosted git servers, and the
> > code change adds just one string comparison and a string concatenation
> > to make the integration work.
> >
> > This patch can be found online
> > at: https://github.com/KiCad/kicad-source-mirror/pull/6/files
> >
> > Git diff:
> > diff --git a/pcbnew/github/github_plugin.cpp
> > b/pcbnew/github/github_plugin.cpp
> > index 695365c..8ab03a2 100644
> > --- a/pcbnew/github/github_plugin.cpp
> > +++ b/pcbnew/github/github_plugin.cpp
> > @@ -516,6 +516,14 @@ bool GITHUB_PLUGIN::repoURL_zipURL( const wxString&
> > aRepoURL, string* aZipURL )
> >
> >              zip_url += repo.GetPath();      // path comes with a
> > leading '/'
> >
> > +            // This is intented for use with gitlab, for users who wish
> > to self-host
> > +            // the library repos on a local server. The KIGITHUB path
> > (and thus server name)
> > +            // must contain "git" for this code to work.
> > +            if ( repo.GetServer().Contains("git") )
> > +            {
> > +                zip_url += "/repository/archive.zip";
> > +            }
> > +
> >              // Do not modify the path, we cannot anticipate the needs
> > of all
> >              // servers which are serving up zip files directly.  URL
> > modifications
> >              // are more generally done in the server, rather than
> > contaminating
> >
> >
> > _______________________________________________
> > Mailing list: https://launchpad.net/~kicad-developers
> > Post to     : kicad-developers@xxxxxxxxxxxxxxxxxxx
> > Unsubscribe : https://launchpad.net/~kicad-developers
> > More help   : https://help.launchpad.net/ListHelp
> >
>
> _______________________________________________
> Mailing list: https://launchpad.net/~kicad-developers
> Post to     : kicad-developers@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~kicad-developers
> More help   : https://help.launchpad.net/ListHelp
>

Follow ups

References