Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix parsing of PRs that have been forked #1

Open
bdangit opened this issue Mar 9, 2017 · 4 comments
Open

fix parsing of PRs that have been forked #1

bdangit opened this issue Mar 9, 2017 · 4 comments

Comments

@bdangit
Copy link
Collaborator

bdangit commented Mar 9, 2017

api_1    | WOOF: header {
api_1    |   "content-type": "application/json",
api_1    |   "x-gitlab-event": "Merge Request Hook",
api_1    |   "connection": "close",
api_1    |   "host": "192.168.79.140:9001",
api_1    |   "content-length": "3275"
api_1    | }
api_1    | WOOF: payload {
api_1    |   "object_kind": "merge_request",
api_1    |   "user": {
api_1    |     "name": "wooflab",
api_1    |     "username": "wooflab",
api_1    |     "avatar_url": "http://www.gravatar.com/avatar/3aa7ca48582a80075023efdd29db3960?s=80&d=identicon"
api_1    |   },
api_1    |   "project": {
api_1    |     "name": "quickstart-generic",
api_1    |     "description": "",
api_1    |     "web_url": "http://192.168.7.30/bdangit/quickstart-generic",
api_1    |     "avatar_url": null,
api_1    |     "git_ssh_url": "[email protected]:bdangit/quickstart-generic.git",
api_1    |     "git_http_url": "http://192.168.7.30/bdangit/quickstart-generic.git",
api_1    |     "namespace": "bdangit",
api_1    |     "visibility_level": 20,
api_1    |     "path_with_namespace": "bdangit/quickstart-generic",
api_1    |     "default_branch": "master",
api_1    |     "homepage": "http://192.168.7.30/bdangit/quickstart-generic",
api_1    |     "url": "[email protected]:bdangit/quickstart-generic.git",
api_1    |     "ssh_url": "[email protected]:bdangit/quickstart-generic.git",
api_1    |     "http_url": "http://192.168.7.30/bdangit/quickstart-generic.git"
api_1    |   },
api_1    |   "object_attributes": {
api_1    |     "id": 11,
api_1    |     "target_branch": "master",
api_1    |     "source_branch": "new-file",
api_1    |     "source_project_id": 6,
api_1    |     "author_id": 3,
api_1    |     "assignee_id": null,
api_1    |     "title": "Add new file",
api_1    |     "created_at": "2017-03-09 14:49:04 UTC",
api_1    |     "updated_at": "2017-03-09 14:49:04 UTC",
api_1    |     "milestone_id": null,
api_1    |     "state": "opened",
api_1    |     "merge_status": "unchecked",
api_1    |     "target_project_id": 3,
api_1    |     "iid": 7,
api_1    |     "description": "",
api_1    |     "position": 0,
api_1    |     "locked_at": null,
api_1    |     "updated_by_id": null,
api_1    |     "merge_error": null,
api_1    |     "merge_params": {
api_1    |       "force_remove_source_branch": "0"
api_1    |     },
api_1    |     "merge_when_build_succeeds": false,
api_1    |     "merge_user_id": null,
api_1    |     "merge_commit_sha": null,
api_1    |     "deleted_at": null,
api_1    |     "in_progress_merge_commit_sha": null,
api_1    |     "lock_version": null,
api_1    |     "time_estimate": 0,
api_1    |     "source": {
api_1    |       "name": "quickstart-generic",
api_1    |       "description": "",
api_1    |       "web_url": "http://192.168.7.30/wooflab/quickstart-generic",
api_1    |       "avatar_url": null,
api_1    |       "git_ssh_url": "[email protected]:wooflab/quickstart-generic.git",
api_1    |       "git_http_url": "http://192.168.7.30/wooflab/quickstart-generic.git",
api_1    |       "namespace": "wooflab",
api_1    |       "visibility_level": 20,
api_1    |       "path_with_namespace": "wooflab/quickstart-generic",
api_1    |       "default_branch": "master",
api_1    |       "homepage": "http://192.168.7.30/wooflab/quickstart-generic",
api_1    |       "url": "[email protected]:wooflab/quickstart-generic.git",
api_1    |       "ssh_url": "[email protected]:wooflab/quickstart-generic.git",
api_1    |       "http_url": "http://192.168.7.30/wooflab/quickstart-generic.git"
api_1    |     },
api_1    |     "target": {
api_1    |       "name": "quickstart-generic",
api_1    |       "description": "",
api_1    |       "web_url": "http://192.168.7.30/bdangit/quickstart-generic",
api_1    |       "avatar_url": null,
api_1    |       "git_ssh_url": "[email protected]:bdangit/quickstart-generic.git",
api_1    |       "git_http_url": "http://192.168.7.30/bdangit/quickstart-generic.git",
api_1    |       "namespace": "bdangit",
api_1    |       "visibility_level": 20,
api_1    |       "path_with_namespace": "bdangit/quickstart-generic",
api_1    |       "default_branch": "master",
api_1    |       "homepage": "http://192.168.7.30/bdangit/quickstart-generic",
api_1    |       "url": "[email protected]:bdangit/quickstart-generic.git",
api_1    |       "ssh_url": "[email protected]:bdangit/quickstart-generic.git",
api_1    |       "http_url": "http://192.168.7.30/bdangit/quickstart-generic.git"
api_1    |     },
api_1    |     "last_commit": {
api_1    |       "id": "9e7f71e836098f51921c8c3225a961ff7102ee48",
api_1    |       "message": "Add new file",
api_1    |       "timestamp": "2017-03-09T14:48:54+00:00",
api_1    |       "url": "http://192.168.7.30/bdangit/quickstart-generic/commit/9e7f71e836098f51921c8c3225a961ff7102ee48",
api_1    |       "author": {
api_1    |         "name": "wooflab",
api_1    |         "email": "[email protected]"
api_1    |       }
api_1    |     },
api_1    |     "work_in_progress": false,
api_1    |     "url": "http://192.168.7.30/bdangit/quickstart-generic/merge_requests/7",
api_1    |     "action": "open"
api_1    |   },
api_1    |   "repository": {
api_1    |     "name": "quickstart-generic",
api_1    |     "url": "[email protected]:bdangit/quickstart-generic.git",
api_1    |     "description": "",
api_1    |     "homepage": "http://192.168.7.30/bdangit/quickstart-generic"
api_1    |   }
api_1    | }
api_1    | 170309/144905.411, (1489070945408:315cfc4336cd:17:j02h2683:10254) [request,webhook,11] data: Received event type pr
api_1    | 170309/144905.412, (1489070945408:315cfc4336cd:17:j02h2683:10254) [request,webhook,11] data: PR #7 opened for http://192.168.7.30/wooflab/quickstart-generic.git#master
api_1    | 170309/144905.423, (1489070945408:315cfc4336cd:17:j02h2683:10254) [request,server,error] data: TypeError: Cannot read property 'unsealToken' of null
api_1    |     at userFactory.get.then.buildBotUser (/usr/src/app/plugins/webhooks/index.js:214:55)
api_1    | 170309/144905.408, [response,api,webhook] http://192.168.79.140:9001: post /v4/webhooks {} 500 (18ms)
@bdangit
Copy link
Collaborator Author

bdangit commented Mar 9, 2017

note: bdangit and wooflab are different orgs.

  1. created SD project: bdangit/quickstart-generic
  2. forked bdangit/quickstart-generic to wooflab/quickstart-generic
  3. created new branch in wooflab/quickstart-generic
  4. add new change (added a new file)
  5. checked in change and submitted merge_request with bdangit/quickstart-generic

SD failed to parse hook and is not showing up.

@bdangit
Copy link
Collaborator Author

bdangit commented Mar 9, 2017

observation:

wooflab/quickstart-generic is not public.

image

@bdangit
Copy link
Collaborator Author

bdangit commented Mar 14, 2017

after tests have been implemented thought this would go away. This is still an issue when projects are forked. Will have to debug this after #3.

@bdangit
Copy link
Collaborator Author

bdangit commented Mar 14, 2017

While fxnal testing of getOpenedPRs, this error shows up in gitlab. There's a 404.

web_1  | ==> /var/log/gitlab/gitlab-workhorse/current <==
web_1  | 2017-03-14_13:40:46.02418 192.168.7.30 @ - - [2017-03-14 13:40:45.357796299 +0000 UTC] "GET /api/v3/projects/3/merge_requests?state=opened HTTP/1.1" 200 902 "" "" 0.666248
web_1  | 2017-03-14_13:40:46.12185 192.168.7.30 @ - - [2017-03-14 13:40:46.032667925 +0000 UTC] "GET /api/v3/projects/3/repository/files?file_path=screwdriver.yaml&ref=new-file HTTP/1.1" 404 34 "" "" 0.089104
web_1  |

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant