Is it possible to add FORKS to the 'projects'?

Pure Krome's Avatar

Pure Krome

03 Feb, 2015 03:54 AM

Hi,

we use this common git forking workflow model of all our dev's doing FORKS off the main repo.
- my fork == origin. - main repo == upstream.

when we want to merge our code, we create a pull request and it gets merged. Ok. fine.

Now, i'm trying to find out how to create a new project where I want to add our developer's forked repo's in. How can I the current account i'm using, see their (forked) repo to add?

I've logged into GH with the GH-Account i'm using to connect to GH with (ie. the GH authorization):

"AppVeyor was authorized 5 days ago for repo access to GitHub repositories as <snip> account. Your account authorizations."

.. and i can access or my collegues private GH forks.

Is there a way to see those and pick them, in AV?

  1. Support Staff 1 Posted by Feodor Fitsner on 03 Feb, 2015 04:01 AM

    Feodor Fitsner's Avatar

    You can do a simple Web API app (and host it on Azure Websites for free) listening for "Fork" event from GitHub webhook and then using AppVeyor API to add new projects for those forks (here YAML comes).

    When calling AppVeyor create project API (http://www.appveyor.com/docs/api/projects-builds#add-project) you can specify {owner}/{repo} to any GitHub repo. Of course, you should have rights there to add webhooks and SSH keys.

    Hope that helps.

    -Feodor

  2. 2 Posted by Pure Krome on 03 Feb, 2015 04:24 AM

    Pure Krome's Avatar

    Hm. ok - sounds complex, heavy and a bit confusing.

    Lets try using the API as u suggested.

    POST /api/projects HTTP/1.1
    Host: ci.appveyor.com
    Authorization: Bearer <snip>
    Cache-Control: no-cache
    Postman-Token: 5c99e0da-5325-15c2-7c3c-cfc40065028f


    { "repositoryProvider":"gitHub", "repositoryName":"my-collegue/XWing" }

    {"message":"Processing of the HTTP request resulted in an exception. Please see the HTTP response returned by the 'Response' property of this exception for details."}

    (i couldn't find any more info).

    So what I'm assuming is this -> hitting the api, it will
    - use the Token provided and find my account. - Grab my oauth secret sauce stuff from my account because i've already done the oauth permissions thingy in AV. - create a new project for the provided git repo link.

    because that GH repo is private BUT you're using my oauth secret token and stuff, it should download ok, right?

    Is that the general gist?

  3. Support Staff 3 Posted by Feodor Fitsner on 03 Feb, 2015 05:10 AM

    Feodor Fitsner's Avatar

    Yeah, that's correct. Don't forget to add Content-type header with application/json in it.

  4. 4 Posted by Pure Krome on 03 Feb, 2015 05:19 AM

    Pure Krome's Avatar

    AH! Worked!!!

    I didn't add that because of this:

    i assumed it didn't need it because it's say's it's default

    Ok - great - i'm in business again...

    So now .. could I create an issue to make this an option in the Add Project section of the site? eg...

    Would be -really- helpful :)

  5. Support Staff 5 Posted by Feodor Fitsner on 03 Feb, 2015 05:25 AM

    Feodor Fitsner's Avatar

    Sure. If you are on Postman right now could you check if that API (with preview header) https://developer.github.com/v3/repos/#list-your-repositories will return all repos for your account that you have access to.

  6. 6 Posted by Pure Krome on 03 Feb, 2015 05:40 AM

    Pure Krome's Avatar

    Ok - Issue #136 created :)

    Using postman, i tried to list my repo's and my private one isn't there :/

    I did fork my private one from another org .. and it has some notice about other orgs and stuff and using another endpoint, etc.

  7. Support Staff 7 Posted by Feodor Fitsner on 03 Feb, 2015 06:00 PM

    Feodor Fitsner's Avatar

    Have you added "magic" application/vnd.github.moondragon+json accept header?

  8. 8 Posted by Pure Krome on 09 Feb, 2015 03:12 AM

    Pure Krome's Avatar

    Nope - I didn't try that.

    On a side note: I didn't notice that you can any any git repo!

    So i just used that option:

    git repo => my private fork
    credentials: repository authentication
    username: whatever;
    password: whatever

    and that worked :) simple!!!

  9. Pure Krome closed this discussion on 09 Feb, 2015 03:12 AM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac

 

21 Mar, 2019 05:38 PM
21 Mar, 2019 06:16 AM
21 Mar, 2019 01:47 AM
20 Mar, 2019 11:39 PM
20 Mar, 2019 09:03 PM
20 Mar, 2019 08:55 PM