Skip to content

Opening a template fails when the user is connected to another GitLab instance #1855

Description

@lexoyo

Reported by ceubri on the forum: https://community.silex.me/d/317

A user connected with the gitlab connector but from another instance than gitlab.com - e.g. framagit.org, cannot open any template. They get Project not found: silex-templates/silex_devdocs-template. The template does exist, but on gitlab.com, and Silex looks for it on framagit.org.

How to reproduce:

  1. Open https://v3.silex.me/ and log in with framagit.org
  2. Create a new website, click on "from a template"
  3. Click "Open in Silex" on any template
  4. You get Project not found: silex-templates/silex_devdocs-template

The same steps work when you log in with gitlab.com.

Why this happens:

  • templates are always on gitlab.com, in a public repo
  • GitLab cannot fork a project of a different instance

How to fix it:

  • GitLab connector should fork only if the user is logged in on gitlab.com
  • otherwise, create the project with import_url, the "Repository by URL" import of the GitLab API
  • the destination instance must have this import source enabled. It is on by default on gitlab.com, to be checked on framagit.org

FTP and the local storage will be covered separately in #1856. Templates never worked there at all.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghelp wantedLooking for contributors to pick this up

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions