GitHub Integration in Stoplight Next

idea

(Tatiana Perry) #1

I checked the issues and feedback and didn’t see anything.

It would be great if we can link the site json file and any swagger files to GitHub repo.

  1. Two-way linking. If I made an update in Stoplight to a swagger, I can also push it to GitHub. If I make a change to a file in GitHub, it will also update in Stoplight.
  2. Works on OAS Spec Files
  3. Works on Hub Files Code
  4. Ability to create a branch from stoplight to have changes reviewed and approved in GitHub then after merging change is avail in Stoplight.

My current workflow is to copy and paste all my files out of stoplight and into GitHub every day. This is less than optimal.


(Erik Hansen) #2

You could probably achieve most of what your asking for by tapping into the Stoplight Git repo where you could then run some outside process for syncronizing the two repositories.

GitHub has an Actions Beta where you would be able to perform the push to Stoplight every time a commit is made in GitHub. However, you’d still need some outside process regularly checking for commits to Stoplight so that the GitHub repo could be updated.


(Tatiana Perry) #3

Thanks for the suggestion. Unfortunately this is not feasible at this time for us. So I created a suggestion for the Stoplight team.


(Tatiana Perry) #4

Just to give some more context around this,(in case anyone else is reading this) I am part of an organization and access tokens are not available for organizations from what I can tell. So right now the only projects I can clone are personal ones. Having tokens at the org level so we can manage and clone projects to github that way really help out workflow.


(Taylor Barnett) #5

Hey @tatiana.perry,

That’s good feedback, to have tokens on an organizational level. You are correct that access tokens are tied to users, not organizations.

A personal access token will have the same access level as the user in all of their orgs though, so if you have the right permissions you should be able to clone your organization’s projects, not just your own. (I think this would be admin, but I am double checking now.)


(Tatiana Perry) #6

Let me know, I wasn’t able to clone an org repo.


(Taylor Barnett) #7

Can you send me a message with the exact project? I want to check it out.


(Tatiana Perry) #8

I was able to get it to work. I can clone it, but when I try to make a push, it tells me my authentication is not correct. I already tried starting over a few times but I can never get it to commit.

C02V40LCHTDH:bigcommerce-dev-docs tatiana.perry$ git push origin
remote: HTTP Basic: Access denied
fatal: Authentication failed for 'https://tperry:@git.stoplight.io/bigcommerce/bigcommerce-dev-docs.git/'
C02V40LCHTDH:bigcommerce-dev-docs tatiana.perry$ 

(Taylor Barnett) #9

@tatiana.perry just sent you a message.


(Tatiana Perry) #10

I think I figured it out. We use 2FA with SSH. I can’t change this since our security is set by the security team. Stoplight is still using http. Is there a workaround for this?

To give everyone some context if they are reading this:
I can clone the repo
I can pull the repo
But I can not do a push if I make a change locally. That is when I get the authorization error.
I am also use bash on a mac.

C02V40LCHTDH:bigcommerce-dev-docs tatiana.perry$ git push origin
remote: HTTP Basic: Access denied
fatal: Authentication failed for 'https://tperry:@git.stoplight.io/bigcommerce/bigcommerce-dev-docs.git/'

(Taylor Barnett) #11

Hmmm, this is a new one that we’ve faced. Let me talk internally to see if there’s any ideas.


(Taylor Barnett) #12

@tatiana.perry is the 2FA SSH setup for your GitHub pushes? We are curious about this requirement because while it might be setup for GitHub, we are not sure how this would affect other git pushes to other git providers, which is basically what we are when you push this project. We don’t use GitHub for the backend either.


(Tatiana Perry) #13

SSH is for pushes.
2FA is for logging in. Sorry for the confusion.


(Tatiana Perry) #14

For anyone following this thread. The issue was totally PEBKAC. I wasn’t storing my token correctly, so it wouldn’t let me push. After fixing that, I was able to push and pull from stoplight without issues. I ended up having to store it in plain text as part of the repo remote.


(Taylor Barnett) #15

I’m glad to hear that though! I couldn’t ever really figure out what might have been happening internally and then I may have forgotten to follow up. :slight_smile: But glad it is working now!