GitHub integration is broken

@glitch_support

Glitch asked me for permissions to access my GitHub repositories for what seems like the third or fourth time in recent memory when I tried to import a private repository earlier today. After clicking that darn button again, Glitch was once again able to access my private GitHub repositories. Once I imported my project, however, I noticed a few things:

  • Git did not persist any access credentials for the repository
  • There was no entry for a remote repository in the local Git configuration file

I studied the various API interactions on Glitch pretty extensively back in mid-April so I happen to have a few notes written down specifically on how Glitch used to import projects from GitHub.

Circa April 23, 2020

GET https://glitch.com/edit/#!/import/git?url=${url}
where url is the web URL of the GitHub repository to import, including protocol and extension (e.g., “GitHub - primer/css: The CSS design system that powers GitHub”)

  1. POST https://api.glitch.com/v1/projects/${id}/remix
    where id is 6860ad0b-a29d-4ee1-8163-e9aee048fe60, the ID of the base project for cloning Git repositories, clone-from-repo

  2. POST https://api.glitch.com/projects/${domain}/setenv
    where domain is the unique subdomain under which the new project is served on the glitch.me domain (e.g., “tangy-macaroni-chord”)

    {
      "env": {
        "REPO_URL": "https://${username}:${password}@github.com/${owner}/${name}.git"
      }
    }
    

Today

GET https://glitch.com/edit/#!/import/git?url=${url}
where url is the URL of the GitHub repository

  1. POST https://api.glitch.com/v1/projects/${id}/remix
    where id is 6860ad0b-a29d-4ee1-8163-e9aee048fe60 as before

  2. POST https://api.glitch.com/projects/${domain}/setenv
    where domain is the subdomain of the new project

    {
      "env": {}
    }
    

The web application no longer populates the ‘env’ object in the JSON payload it sends to the /setenv endpoint. As a result, the remixed version of clone-from-repo fails to properly configure the project repository.

1 Like