Can't create project from GitHub private repository

lair's Avatar

lair

12 May, 2015 08:58 PM

I am granted a contributor access to a private GitHub repository of another user. I'd like to set up CI builds and deployment for it, but I don't see it in New Project/Select Repository/GitHub list.

Should I add it as "plain Git" (and what will I lose with such a setup), or is there another way?

  1. Support Staff 1 Posted by Feodor Fitsner on 12 May, 2015 09:01 PM

    Feodor Fitsner's Avatar

    Re-authorize GitHub for "private and public" repositories on https://ci.appveyor.com/account page

  2. 2 Posted by lair on 12 May, 2015 09:05 PM

    lair's Avatar

    Worked like a charm, thank you!

  3. 3 Posted by lair on 12 May, 2015 09:06 PM

    lair's Avatar

    Actually, not quite (sorry).

    Now I see the repo in the list, but when I click "Add" I get the following error message: "Error adding SSH key to GitHub repository: Response status code does not indicate success: 404 (Not Found)."

  4. Support Staff 4 Posted by Feodor Fitsner on 12 May, 2015 09:18 PM

    Feodor Fitsner's Avatar

    There is not enough permissions to add SSH key to that repo. Usually, being collaborator is not enough for that (collaborator works with code only), but you should be an admin.

  5. 5 Posted by lair on 13 May, 2015 10:06 AM

    lair's Avatar

    Unfortunately, repository I am trying to add build to is a user repository, not an organization one, so I cannot be made an admin there (without transferring ownership).

    I'll outline the situation again:

    • the repo is private, personal and owned by user A
    • I am collaborator on this repo
    • A trusts me well enough, but there's no possibility to designate me as "co-admin" of personal repo on GitHub
    • I'd like to set up a private build for the repository
    • user A has no enough time to set up the build himself

    What are our options?
    Is there any way the we can manually set up the relationship between GitHub and AppVeyor?
    What would we lose if we set it up as "plain Git"?

  6. Support Staff 6 Posted by Feodor Fitsner on 13 May, 2015 04:41 PM

    Feodor Fitsner's Avatar

    "Git" and "GitHub" webhook formats might be non-compatible, but you can give it a try for sure.

  7. 7 Posted by lair on 14 May, 2015 11:00 AM

    lair's Avatar

    It mostly works. There's no problem with manual builds (so the SSH access works just fine), but there are some with CI.

    If we use a GitHub-flavored webhook URL (https://ci.appveyor.com/api/github/webhook?id=***), it does not accept an event with following message: Push request and project repositories do not match..

    If we use a normal URL (https://ci.appveyor.com/api/git/webhook?id=***), our events are accepted just fine, but they always trigger a build from master, regardless of which branch the commit was pushed to.

    Here's the example of an event:

    Headers:

    Request URL: https://ci.appveyor.com/api/git/webhook?id=njo1lo58n1vpgteo
    Request method: POST
    content-type: application/x-www-form-urlencoded
    Expect: 
    User-Agent: GitHub-Hookshot/6a28ed9
    X-GitHub-Delivery: f5089980-fa1b-11e4-87b0-d9c84e6a670c
    X-GitHub-Event: push
    

    Body:

    {
      "ref": "refs/heads/feature-automatic-doc-generation",
      "before": "4866afffada160e645081ae1b1c5b98436b8d715",
      "after": "aabe6ed0e4cf6ba2b4caef282339fc2eb39977e7",
      "created": false,
      "deleted": false,
      "forced": false,
      "base_ref": null,
      "compare": "https://github.com/***/compare/4866afffada1...aabe6ed0e4cf",
      "commits": [
        {
          "id": "aabe6ed0e4cf6ba2b4caef282339fc2eb39977e7",
          "distinct": true,
          "message": "Just another AppVeyor test on another branch",
          "timestamp": "2015-05-14T12:30:51+03:00",
          "url": "https://github.com/***/commit/aabe6ed0e4cf6ba2b4caef282339fc2eb39977e7",
          "author": {
            "name": "Serg Rogovtsev",
            "email": "***",
            "username": "srogovtsev"
          },
          "committer": {
            "name": "Serg Rogovtsev",
            "email": "***",
            "username": "srogovtsev"
          },
          "added": [
            "eee"
          ],
          "removed": [
    
          ],
          "modified": [
    
          ]
        }
      ],
      "head_commit": {
        "id": "aabe6ed0e4cf6ba2b4caef282339fc2eb39977e7",
        "distinct": true,
        "message": "Just another AppVeyor test on another branch",
        "timestamp": "2015-05-14T12:30:51+03:00",
        "url": "https://github.com/***/commit/aabe6ed0e4cf6ba2b4caef282339fc2eb39977e7",
        "author": {
          "name": "Serg Rogovtsev",
          "email": "***",
          "username": "srogovtsev"
        },
        "committer": {
          "name": "Serg Rogovtsev",
          "email": "***",
          "username": "srogovtsev"
        },
        "added": [
          "eee"
        ],
        "removed": [
    
        ],
        "modified": [
    
        ]
      },
      "repository": {
        "id": 33789552,
        "name": "***",
        "full_name": "***",
        "owner": {
          "name": "***",
          "email": "***"
        },
        "private": true,
        "html_url": "https://github.com/***",
        "description": "REST API",
        "fork": false,
        "url": "https://github.com/***",
        "forks_url": "https://api.github.com/repos/***/forks",
        "keys_url": "https://api.github.com/repos/***/keys{/key_id}",
        "collaborators_url": "https://api.github.com/repos/***/collaborators{/collaborator}",
        "teams_url": "https://api.github.com/repos/***/teams",
        "hooks_url": "https://api.github.com/repos/***/hooks",
        "issue_events_url": "https://api.github.com/repos/***/issues/events{/number}",
        "events_url": "https://api.github.com/repos/***/events",
        "assignees_url": "https://api.github.com/repos/***/assignees{/user}",
        "branches_url": "https://api.github.com/repos/***/branches{/branch}",
        "tags_url": "https://api.github.com/repos/***/tags",
        "blobs_url": "https://api.github.com/repos/***/git/blobs{/sha}",
        "git_tags_url": "https://api.github.com/repos/***/git/tags{/sha}",
        "git_refs_url": "https://api.github.com/repos/***/git/refs{/sha}",
        "trees_url": "https://api.github.com/repos/***/git/trees{/sha}",
        "statuses_url": "https://api.github.com/repos/***/statuses/{sha}",
        "languages_url": "https://api.github.com/repos/***/languages",
        "stargazers_url": "https://api.github.com/repos/***/stargazers",
        "contributors_url": "https://api.github.com/repos/***/contributors",
        "subscribers_url": "https://api.github.com/repos/***/subscribers",
        "subscription_url": "https://api.github.com/repos/***/subscription",
        "commits_url": "https://api.github.com/repos/***/commits{/sha}",
        "git_commits_url": "https://api.github.com/repos/***/git/commits{/sha}",
        "comments_url": "https://api.github.com/repos/***/comments{/number}",
        "issue_comment_url": "https://api.github.com/repos/***/issues/comments{/number}",
        "contents_url": "https://api.github.com/repos/***/contents/{+path}",
        "compare_url": "https://api.github.com/repos/***/compare/{base}...{head}",
        "merges_url": "https://api.github.com/repos/***/merges",
        "archive_url": "https://api.github.com/repos/***/{archive_format}{/ref}",
        "downloads_url": "https://api.github.com/repos/***/downloads",
        "issues_url": "https://api.github.com/repos/***/issues{/number}",
        "pulls_url": "https://api.github.com/repos/***/pulls{/number}",
        "milestones_url": "https://api.github.com/repos/***/milestones{/number}",
        "notifications_url": "https://api.github.com/repos/***/notifications{?since,all,participating}",
        "labels_url": "https://api.github.com/repos/***/labels{/name}",
        "releases_url": "https://api.github.com/repos/***/releases{/id}",
        "created_at": 1428781099,
        "updated_at": "2015-05-10T09:48:44Z",
        "pushed_at": 1431595871,
        "git_url": "git://github.com/***.git",
        "ssh_url": "git@github.com:***.git",
        "clone_url": "https://github.com/***.git",
        "svn_url": "https://github.com/***",
        "homepage": null,
        "size": 96,
        "stargazers_count": 0,
        "watchers_count": 0,
        "language": "C#",
        "has_issues": true,
        "has_downloads": true,
        "has_wiki": true,
        "has_pages": false,
        "forks_count": 0,
        "mirror_url": null,
        "open_issues_count": 3,
        "forks": 0,
        "open_issues": 3,
        "watchers": 0,
        "default_branch": "master",
        "stargazers": 0,
        "master_branch": "master"
      },
      "pusher": {
        "name": "srogovtsev",
        "email": "***"
      },
      "sender": {
        "login": "srogovtsev",
        "id": 2332517,
        "avatar_url": "https://avatars.githubusercontent.com/u/2332517?v=3",
        "gravatar_id": "",
        "url": "https://api.github.com/users/srogovtsev",
        "html_url": "https://github.com/srogovtsev",
        "followers_url": "https://api.github.com/users/srogovtsev/followers",
        "following_url": "https://api.github.com/users/srogovtsev/following{/other_user}",
        "gists_url": "https://api.github.com/users/srogovtsev/gists{/gist_id}",
        "starred_url": "https://api.github.com/users/srogovtsev/starred{/owner}{/repo}",
        "subscriptions_url": "https://api.github.com/users/srogovtsev/subscriptions",
        "organizations_url": "https://api.github.com/users/srogovtsev/orgs",
        "repos_url": "https://api.github.com/users/srogovtsev/repos",
        "events_url": "https://api.github.com/users/srogovtsev/events{/privacy}",
        "received_events_url": "https://api.github.com/users/srogovtsev/received_events",
        "type": "User",
        "site_admin": false
      }
    }
    
  8. Support Staff 8 Posted by Feodor Fitsner on 14 May, 2015 08:42 PM

    Feodor Fitsner's Avatar

    OK, thanks for the update.

    So, we might have at least two options here:

    1) Ignore error and continue adding a new project if SSH key cannot be added to repo. This is like its done with webhooks now though having broken build right aways doesn't look good.

    2) Improve repository name validation by recognizing standard GitHub URLs (if provider is generic Git).

    My preferred choice would be #2

  9. 9 Posted by lair on 14 May, 2015 09:06 PM

    lair's Avatar

    I think that actually you could implement both scenarios.

    The first one would be "Error adding SSH key, click "OK" if you ready to configure repository yourself, here's your key, here's your webhook url". That will allow for all the GitHub-related bonus options (skipping tags, so on).

    And the second one is just as you described, improving repository name validation in webhooks.

    Thanks for your understanding!

  10. 10 Posted by lair on 17 May, 2015 06:11 PM

    lair's Avatar

    For example of first one, you can take a look at Slack: https://slack.zendesk.com/hc/en-us/articles/201710957-How-do-I-use-...

    They call it "unauthed integration", and it's pretty easy to setup. Basically it's just a webhook url + settings.

  11. Support Staff 11 Posted by Ilya Finkelshte... on 07 Apr, 2017 06:10 PM

    Ilya Finkelshteyn's Avatar

    Update: workaround with calling GitHub or BitBucket projects with Git webhook will not work anymore. It is blocked as part of security hardening.

    If someone uses this approach and broken now, target project should be re-created as a Git project in AppVeyor. If project re-creation is problematic, please let us know and we can change project repository type to Git manually in backed system.

    Ilya.

  12. 12 Posted by Michael on 16 Jun, 2017 08:39 AM

    Michael's Avatar

    Dear Feodor,

    I have the same case
    (I am granted a contributor access to a private GitHub repository of another user. I'd like to set up CI builds and deployment for it, but I don't see it in New Project/Select Repository/GitHub list.)
    Only difference is that I am a contributor of an organization not of a user.

    I have re-authorized Github as you suggested but I still cannot see this repository in the list. I see only my personal public repository.

    What else can I do to see the required repo?

    Thanks.

  13. Support Staff 13 Posted by Feodor Fitsner on 16 Jun, 2017 09:46 PM

    Feodor Fitsner's Avatar

    Go to https://github.com/settings/applications, then click "AppVeyor CI" link and make sure AppVeyor access is allowed to the organization owning the repo.

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

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

Recent Discussions

19 Oct, 2017 02:25 AM
18 Oct, 2017 07:26 PM
18 Oct, 2017 11:00 AM
18 Oct, 2017 08:54 AM
18 Oct, 2017 07:42 AM

 

17 Oct, 2017 07:36 PM
17 Oct, 2017 05:39 PM
17 Oct, 2017 04:29 PM
17 Oct, 2017 07:49 AM
16 Oct, 2017 11:38 PM
16 Oct, 2017 10:01 PM