Skip to content
This repository has been archived by the owner on Jun 23, 2023. It is now read-only.

Lambada Webhook POST failing on validation #56

Open
baraths84 opened this issue Aug 14, 2020 · 5 comments
Open

Lambada Webhook POST failing on validation #56

baraths84 opened this issue Aug 14, 2020 · 5 comments
Assignees
Labels

Comments

@baraths84
Copy link

baraths84 commented Aug 14, 2020

vI have configured the AWS lambda and gateway but Github web hook during PULL Request event POST call returning the below error:

POST Response code : 422
POST Response Body :

HttpError: Validation Failed: {"resource":"Status","code":"custom","field":"target_url","message":"target_url must use http(s) scheme"}
    at response.text.then.message (/var/task/awslambda.js:52517:23)
    at process._tickCallback (internal/process/next_tick.js:68:7)

Request Header :

Request URL: https://7pmsthjir6.execute-api.us-west-1.amazonaws.com:
Request method: POST
Accept: */*
content-type: application/json
User-Agent: GitHub-Hookshot/d696b2a
X-GitHub-Delivery: f8837900-dde0-11ea-8ddc-5b781669f07b
X-GitHub-Event: pull_request
X-Hub-Signature: sha1=2fa747c6dde1e4c67ca32dea54e9804189e69a38

Request Body :

{
  "action": "opened",
  "number": 4,
  "pull_request": {
    "url": "https://api.github.com/repos/baraths84/filebuilder/pulls/4",
    "id": 467750349,
    "node_id": "MDExOlB1bGxSZXF1ZXN0NDY3NzUwMzQ5",
    "html_url": "https://github.com/baraths84/filebuilder/pull/4",
    "diff_url": "https://github.com/baraths84/filebuilder/pull/4.diff",
    "patch_url": "https://github.com/baraths84/filebuilder/pull/4.patch",
    "issue_url": "https://api.github.com/repos/baraths84/filebuilder/issues/4",
    "number": 4,
    "state": "open",
    "locked": false,
    "title": "kHkhd barath",
    "user": {
      "login": "baraths84",
      "id": 2089311,
      "node_id": "MDQ6VXNlcjIwODkzMTE=",
      "avatar_url": "https://avatars1.githubusercontent.com/u/2089311?v=4",
      "gravatar_id": "",
      "url": "https://api.github.com/users/baraths84",
      "html_url": "https://github.com/baraths84",
      "followers_url": "https://api.github.com/users/baraths84/followers",
      "following_url": "https://api.github.com/users/baraths84/following{/other_user}",
      "gists_url": "https://api.github.com/users/baraths84/gists{/gist_id}",
      "starred_url": "https://api.github.com/users/baraths84/starred{/owner}{/repo}",
      "subscriptions_url": "https://api.github.com/users/baraths84/subscriptions",
      "organizations_url": "https://api.github.com/users/baraths84/orgs",
      "repos_url": "https://api.github.com/users/baraths84/repos",
      "events_url": "https://api.github.com/users/baraths84/events{/privacy}",
      "received_events_url": "https://api.github.com/users/baraths84/received_events",
      "type": "User",
      "site_admin": false
    },
    "body": "new",
    "created_at": "2020-08-14T03:48:09Z",
    "updated_at": "2020-08-14T03:48:09Z",
    "closed_at": null,
    "merged_at": null,
    "merge_commit_sha": null,
    "assignee": null,
    "assignees": [

    ],
    "requested_reviewers": [

    ],
    "requested_teams": [

    ],
    "labels": [

    ],
    "milestone": null,
    "draft": false,
    "commits_url": "https://api.github.com/repos/baraths84/filebuilder/pulls/4/commits",
    "review_comments_url": "https://api.github.com/repos/baraths84/filebuilder/pulls/4/comments",
    "review_comment_url": "https://api.github.com/repos/baraths84/filebuilder/pulls/comments{/number}",
    "comments_url": "https://api.github.com/repos/baraths84/filebuilder/issues/4/comments",
    "statuses_url": "https://api.github.com/repos/baraths84/filebuilder/statuses/238b18bcdab34e0193021fac54a88e92916dca76",
    "head": {
      "label": "baraths84:FEATURE/TESLA-200",
      "ref": "FEATURE/TESLA-200",
      "sha": "238b18bcdab34e0193021fac54a88e92916dca76",
      "user": {
        "login": "baraths84",
        "id": 2089311,
        "node_id": "MDQ6VXNlcjIwODkzMTE=",
        "avatar_url": "https://avatars1.githubusercontent.com/u/2089311?v=4",
        "gravatar_id": "",
        "url": "https://api.github.com/users/baraths84",
        "html_url": "https://github.com/baraths84",
        "followers_url": "https://api.github.com/users/baraths84/followers",
        "following_url": "https://api.github.com/users/baraths84/following{/other_user}",
        "gists_url": "https://api.github.com/users/baraths84/gists{/gist_id}",
        "starred_url": "https://api.github.com/users/baraths84/starred{/owner}{/repo}",
        "subscriptions_url": "https://api.github.com/users/baraths84/subscriptions",
        "organizations_url": "https://api.github.com/users/baraths84/orgs",
        "repos_url": "https://api.github.com/users/baraths84/repos",
        "events_url": "https://api.github.com/users/baraths84/events{/privacy}",
        "received_events_url": "https://api.github.com/users/baraths84/received_events",
        "type": "User",
        "site_admin": false
      },
      "repo": {
        "id": 148515704,
        "node_id": "MDEwOlJlcG9zaXRvcnkxNDg1MTU3MDQ=",
        "name": "filebuilder",
        "full_name": "baraths84/filebuilder",
        "private": false,
        "owner": {
          "login": "baraths84",
          "id": 2089311,
          "node_id": "MDQ6VXNlcjIwODkzMTE=",
          "avatar_url": "https://avatars1.githubusercontent.com/u/2089311?v=4",
          "gravatar_id": "",
          "url": "https://api.github.com/users/baraths84",
          "html_url": "https://github.com/baraths84",
          "followers_url": "https://api.github.com/users/baraths84/followers",
          "following_url": "https://api.github.com/users/baraths84/following{/other_user}",
          "gists_url": "https://api.github.com/users/baraths84/gists{/gist_id}",
          "starred_url": "https://api.github.com/users/baraths84/starred{/owner}{/repo}",
          "subscriptions_url": "https://api.github.com/users/baraths84/subscriptions",
          "organizations_url": "https://api.github.com/users/baraths84/orgs",
          "repos_url": "https://api.github.com/users/baraths84/repos",
          "events_url": "https://api.github.com/users/baraths84/events{/privacy}",
          "received_events_url": "https://api.github.com/users/baraths84/received_events",
          "type": "User",
          "site_admin": false
        },
        "html_url": "https://github.com/baraths84/filebuilder",
        "description": null,
        "fork": false,
        "url": "https://api.github.com/repos/baraths84/filebuilder",
        "forks_url": "https://api.github.com/repos/baraths84/filebuilder/forks",
        "keys_url": "https://api.github.com/repos/baraths84/filebuilder/keys{/key_id}",
        "collaborators_url": "https://api.github.com/repos/baraths84/filebuilder/collaborators{/collaborator}",
        "teams_url": "https://api.github.com/repos/baraths84/filebuilder/teams",
        "hooks_url": "https://api.github.com/repos/baraths84/filebuilder/hooks",
        "issue_events_url": "https://api.github.com/repos/baraths84/filebuilder/issues/events{/number}",
        "events_url": "https://api.github.com/repos/baraths84/filebuilder/events",
        "assignees_url": "https://api.github.com/repos/baraths84/filebuilder/assignees{/user}",
        "branches_url": "https://api.github.com/repos/baraths84/filebuilder/branches{/branch}",
        "tags_url": "https://api.github.com/repos/baraths84/filebuilder/tags",
        "blobs_url": "https://api.github.com/repos/baraths84/filebuilder/git/blobs{/sha}",
        "git_tags_url": "https://api.github.com/repos/baraths84/filebuilder/git/tags{/sha}",
        "git_refs_url": "https://api.github.com/repos/baraths84/filebuilder/git/refs{/sha}",
        "trees_url": "https://api.github.com/repos/baraths84/filebuilder/git/trees{/sha}",
        "statuses_url": "https://api.github.com/repos/baraths84/filebuilder/statuses/{sha}",
        "languages_url": "https://api.github.com/repos/baraths84/filebuilder/languages",
        "stargazers_url": "https://api.github.com/repos/baraths84/filebuilder/stargazers",
        "contributors_url": "https://api.github.com/repos/baraths84/filebuilder/contributors",
        "subscribers_url": "https://api.github.com/repos/baraths84/filebuilder/subscribers",
        "subscription_url": "https://api.github.com/repos/baraths84/filebuilder/subscription",
        "commits_url": "https://api.github.com/repos/baraths84/filebuilder/commits{/sha}",
        "git_commits_url": "https://api.github.com/repos/baraths84/filebuilder/git/commits{/sha}",
        "comments_url": "https://api.github.com/repos/baraths84/filebuilder/comments{/number}",
        "issue_comment_url": "https://api.github.com/repos/baraths84/filebuilder/issues/comments{/number}",
        "contents_url": "https://api.github.com/repos/baraths84/filebuilder/contents/{+path}",
        "compare_url": "https://api.github.com/repos/baraths84/filebuilder/compare/{base}...{head}",
        "merges_url": "https://api.github.com/repos/baraths84/filebuilder/merges",
        "archive_url": "https://api.github.com/repos/baraths84/filebuilder/{archive_format}{/ref}",
        "downloads_url": "https://api.github.com/repos/baraths84/filebuilder/downloads",
        "issues_url": "https://api.github.com/repos/baraths84/filebuilder/issues{/number}",
        "pulls_url": "https://api.github.com/repos/baraths84/filebuilder/pulls{/number}",
        "milestones_url": "https://api.github.com/repos/baraths84/filebuilder/milestones{/number}",
        "notifications_url": "https://api.github.com/repos/baraths84/filebuilder/notifications{?since,all,participating}",
        "labels_url": "https://api.github.com/repos/baraths84/filebuilder/labels{/name}",
        "releases_url": "https://api.github.com/repos/baraths84/filebuilder/releases{/id}",
        "deployments_url": "https://api.github.com/repos/baraths84/filebuilder/deployments",
        "created_at": "2018-09-12T17:19:49Z",
        "updated_at": "2020-08-13T22:54:30Z",
        "pushed_at": "2020-08-14T03:46:31Z",
        "git_url": "git://github.com/baraths84/filebuilder.git",
        "ssh_url": "git@github.com:baraths84/filebuilder.git",
        "clone_url": "https://github.com/baraths84/filebuilder.git",
        "svn_url": "https://github.com/baraths84/filebuilder",
        "homepage": null,
        "size": 917,
        "stargazers_count": 0,
        "watchers_count": 0,
        "language": "JavaScript",
        "has_issues": true,
        "has_projects": true,
        "has_downloads": true,
        "has_wiki": true,
        "has_pages": false,
        "forks_count": 0,
        "mirror_url": null,
        "archived": false,
        "disabled": false,
        "open_issues_count": 1,
        "license": null,
        "forks": 0,
        "open_issues": 1,
        "watchers": 0,
        "default_branch": "master",
        "allow_squash_merge": true,
        "allow_merge_commit": true,
        "allow_rebase_merge": true,
        "delete_branch_on_merge": false
      }
    },
    "base": {
      "label": "baraths84:master",
      "ref": "master",
      "sha": "096bcfb614ac0d829382e2afb52f8c22ba5bd91e",
      "user": {
        "login": "baraths84",
        "id": 2089311,
        "node_id": "MDQ6VXNlcjIwODkzMTE=",
        "avatar_url": "https://avatars1.githubusercontent.com/u/2089311?v=4",
        "gravatar_id": "",
        "url": "https://api.github.com/users/baraths84",
        "html_url": "https://github.com/baraths84",
        "followers_url": "https://api.github.com/users/baraths84/followers",
        "following_url": "https://api.github.com/users/baraths84/following{/other_user}",
        "gists_url": "https://api.github.com/users/baraths84/gists{/gist_id}",
        "starred_url": "https://api.github.com/users/baraths84/starred{/owner}{/repo}",
        "subscriptions_url": "https://api.github.com/users/baraths84/subscriptions",
        "organizations_url": "https://api.github.com/users/baraths84/orgs",
        "repos_url": "https://api.github.com/users/baraths84/repos",
        "events_url": "https://api.github.com/users/baraths84/events{/privacy}",
        "received_events_url": "https://api.github.com/users/baraths84/received_events",
        "type": "User",
        "site_admin": false
      },
      "repo": {
        "id": 148515704,
        "node_id": "MDEwOlJlcG9zaXRvcnkxNDg1MTU3MDQ=",
        "name": "filebuilder",
        "full_name": "baraths84/filebuilder",
        "private": false,
        "owner": {
          "login": "baraths84",
          "id": 2089311,
          "node_id": "MDQ6VXNlcjIwODkzMTE=",
          "avatar_url": "https://avatars1.githubusercontent.com/u/2089311?v=4",
          "gravatar_id": "",
          "url": "https://api.github.com/users/baraths84",
          "html_url": "https://github.com/baraths84",
          "followers_url": "https://api.github.com/users/baraths84/followers",
          "following_url": "https://api.github.com/users/baraths84/following{/other_user}",
          "gists_url": "https://api.github.com/users/baraths84/gists{/gist_id}",
          "starred_url": "https://api.github.com/users/baraths84/starred{/owner}{/repo}",
          "subscriptions_url": "https://api.github.com/users/baraths84/subscriptions",
          "organizations_url": "https://api.github.com/users/baraths84/orgs",
          "repos_url": "https://api.github.com/users/baraths84/repos",
          "events_url": "https://api.github.com/users/baraths84/events{/privacy}",
          "received_events_url": "https://api.github.com/users/baraths84/received_events",
          "type": "User",
          "site_admin": false
        },
        "html_url": "https://github.com/baraths84/filebuilder",
        "description": null,
        "fork": false,
        "url": "https://api.github.com/repos/baraths84/filebuilder",
        "forks_url": "https://api.github.com/repos/baraths84/filebuilder/forks",
        "keys_url": "https://api.github.com/repos/baraths84/filebuilder/keys{/key_id}",
        "collaborators_url": "https://api.github.com/repos/baraths84/filebuilder/collaborators{/collaborator}",
        "teams_url": "https://api.github.com/repos/baraths84/filebuilder/teams",
        "hooks_url": "https://api.github.com/repos/baraths84/filebuilder/hooks",
        "issue_events_url": "https://api.github.com/repos/baraths84/filebuilder/issues/events{/number}",
        "events_url": "https://api.github.com/repos/baraths84/filebuilder/events",
        "assignees_url": "https://api.github.com/repos/baraths84/filebuilder/assignees{/user}",
        "branches_url": "https://api.github.com/repos/baraths84/filebuilder/branches{/branch}",
        "tags_url": "https://api.github.com/repos/baraths84/filebuilder/tags",
        "blobs_url": "https://api.github.com/repos/baraths84/filebuilder/git/blobs{/sha}",
        "git_tags_url": "https://api.github.com/repos/baraths84/filebuilder/git/tags{/sha}",
        "git_refs_url": "https://api.github.com/repos/baraths84/filebuilder/git/refs{/sha}",
        "trees_url": "https://api.github.com/repos/baraths84/filebuilder/git/trees{/sha}",
        "statuses_url": "https://api.github.com/repos/baraths84/filebuilder/statuses/{sha}",
        "languages_url": "https://api.github.com/repos/baraths84/filebuilder/languages",
        "stargazers_url": "https://api.github.com/repos/baraths84/filebuilder/stargazers",
        "contributors_url": "https://api.github.com/repos/baraths84/filebuilder/contributors",
        "subscribers_url": "https://api.github.com/repos/baraths84/filebuilder/subscribers",
        "subscription_url": "https://api.github.com/repos/baraths84/filebuilder/subscription",
        "commits_url": "https://api.github.com/repos/baraths84/filebuilder/commits{/sha}",
        "git_commits_url": "https://api.github.com/repos/baraths84/filebuilder/git/commits{/sha}",
        "comments_url": "https://api.github.com/repos/baraths84/filebuilder/comments{/number}",
        "issue_comment_url": "https://api.github.com/repos/baraths84/filebuilder/issues/comments{/number}",
        "contents_url": "https://api.github.com/repos/baraths84/filebuilder/contents/{+path}",
        "compare_url": "https://api.github.com/repos/baraths84/filebuilder/compare/{base}...{head}",
        "merges_url": "https://api.github.com/repos/baraths84/filebuilder/merges",
        "archive_url": "https://api.github.com/repos/baraths84/filebuilder/{archive_format}{/ref}",
        "downloads_url": "https://api.github.com/repos/baraths84/filebuilder/downloads",
        "issues_url": "https://api.github.com/repos/baraths84/filebuilder/issues{/number}",
        "pulls_url": "https://api.github.com/repos/baraths84/filebuilder/pulls{/number}",
        "milestones_url": "https://api.github.com/repos/baraths84/filebuilder/milestones{/number}",
        "notifications_url": "https://api.github.com/repos/baraths84/filebuilder/notifications{?since,all,participating}",
        "labels_url": "https://api.github.com/repos/baraths84/filebuilder/labels{/name}",
        "releases_url": "https://api.github.com/repos/baraths84/filebuilder/releases{/id}",
        "deployments_url": "https://api.github.com/repos/baraths84/filebuilder/deployments",
        "created_at": "2018-09-12T17:19:49Z",
        "updated_at": "2020-08-13T22:54:30Z",
        "pushed_at": "2020-08-14T03:46:31Z",
        "git_url": "git://github.com/baraths84/filebuilder.git",
        "ssh_url": "git@github.com:baraths84/filebuilder.git",
        "clone_url": "https://github.com/baraths84/filebuilder.git",
        "svn_url": "https://github.com/baraths84/filebuilder",
        "homepage": null,
        "size": 917,
        "stargazers_count": 0,
        "watchers_count": 0,
        "language": "JavaScript",
        "has_issues": true,
        "has_projects": true,
        "has_downloads": true,
        "has_wiki": true,
        "has_pages": false,
        "forks_count": 0,
        "mirror_url": null,
        "archived": false,
        "disabled": false,
        "open_issues_count": 1,
        "license": null,
        "forks": 0,
        "open_issues": 1,
        "watchers": 0,
        "default_branch": "master",
        "allow_squash_merge": true,
        "allow_merge_commit": true,
        "allow_rebase_merge": true,
        "delete_branch_on_merge": false
      }
    },
    "_links": {
      "self": {
        "href": "https://api.github.com/repos/baraths84/filebuilder/pulls/4"
      },
      "html": {
        "href": "https://github.com/baraths84/filebuilder/pull/4"
      },
      "issue": {
        "href": "https://api.github.com/repos/baraths84/filebuilder/issues/4"
      },
      "comments": {
        "href": "https://api.github.com/repos/baraths84/filebuilder/issues/4/comments"
      },
      "review_comments": {
        "href": "https://api.github.com/repos/baraths84/filebuilder/pulls/4/comments"
      },
      "review_comment": {
        "href": "https://api.github.com/repos/baraths84/filebuilder/pulls/comments{/number}"
      },
      "commits": {
        "href": "https://api.github.com/repos/baraths84/filebuilder/pulls/4/commits"
      },
      "statuses": {
        "href": "https://api.github.com/repos/baraths84/filebuilder/statuses/238b18bcdab34e0193021fac54a88e92916dca76"
      }
    },
    "author_association": "OWNER",
    "active_lock_reason": null,
    "merged": false,
    "mergeable": null,
    "rebaseable": null,
    "mergeable_state": "unknown",
    "merged_by": null,
    "comments": 0,
    "review_comments": 0,
    "maintainer_can_modify": false,
    "commits": 1,
    "additions": 17,
    "deletions": 3,
    "changed_files": 1
  },
  "repository": {
    "id": 148515704,
    "node_id": "MDEwOlJlcG9zaXRvcnkxNDg1MTU3MDQ=",
    "name": "filebuilder",
    "full_name": "baraths84/filebuilder",
    "private": false,
    "owner": {
      "login": "baraths84",
      "id": 2089311,
      "node_id": "MDQ6VXNlcjIwODkzMTE=",
      "avatar_url": "https://avatars1.githubusercontent.com/u/2089311?v=4",
      "gravatar_id": "",
      "url": "https://api.github.com/users/baraths84",
      "html_url": "https://github.com/baraths84",
      "followers_url": "https://api.github.com/users/baraths84/followers",
      "following_url": "https://api.github.com/users/baraths84/following{/other_user}",
      "gists_url": "https://api.github.com/users/baraths84/gists{/gist_id}",
      "starred_url": "https://api.github.com/users/baraths84/starred{/owner}{/repo}",
      "subscriptions_url": "https://api.github.com/users/baraths84/subscriptions",
      "organizations_url": "https://api.github.com/users/baraths84/orgs",
      "repos_url": "https://api.github.com/users/baraths84/repos",
      "events_url": "https://api.github.com/users/baraths84/events{/privacy}",
      "received_events_url": "https://api.github.com/users/baraths84/received_events",
      "type": "User",
      "site_admin": false
    },
    "html_url": "https://github.com/baraths84/filebuilder",
    "description": null,
    "fork": false,
    "url": "https://api.github.com/repos/baraths84/filebuilder",
    "forks_url": "https://api.github.com/repos/baraths84/filebuilder/forks",
    "keys_url": "https://api.github.com/repos/baraths84/filebuilder/keys{/key_id}",
    "collaborators_url": "https://api.github.com/repos/baraths84/filebuilder/collaborators{/collaborator}",
    "teams_url": "https://api.github.com/repos/baraths84/filebuilder/teams",
    "hooks_url": "https://api.github.com/repos/baraths84/filebuilder/hooks",
    "issue_events_url": "https://api.github.com/repos/baraths84/filebuilder/issues/events{/number}",
    "events_url": "https://api.github.com/repos/baraths84/filebuilder/events",
    "assignees_url": "https://api.github.com/repos/baraths84/filebuilder/assignees{/user}",
    "branches_url": "https://api.github.com/repos/baraths84/filebuilder/branches{/branch}",
    "tags_url": "https://api.github.com/repos/baraths84/filebuilder/tags",
    "blobs_url": "https://api.github.com/repos/baraths84/filebuilder/git/blobs{/sha}",
    "git_tags_url": "https://api.github.com/repos/baraths84/filebuilder/git/tags{/sha}",
    "git_refs_url": "https://api.github.com/repos/baraths84/filebuilder/git/refs{/sha}",
    "trees_url": "https://api.github.com/repos/baraths84/filebuilder/git/trees{/sha}",
    "statuses_url": "https://api.github.com/repos/baraths84/filebuilder/statuses/{sha}",
    "languages_url": "https://api.github.com/repos/baraths84/filebuilder/languages",
    "stargazers_url": "https://api.github.com/repos/baraths84/filebuilder/stargazers",
    "contributors_url": "https://api.github.com/repos/baraths84/filebuilder/contributors",
    "subscribers_url": "https://api.github.com/repos/baraths84/filebuilder/subscribers",
    "subscription_url": "https://api.github.com/repos/baraths84/filebuilder/subscription",
    "commits_url": "https://api.github.com/repos/baraths84/filebuilder/commits{/sha}",
    "git_commits_url": "https://api.github.com/repos/baraths84/filebuilder/git/commits{/sha}",
    "comments_url": "https://api.github.com/repos/baraths84/filebuilder/comments{/number}",
    "issue_comment_url": "https://api.github.com/repos/baraths84/filebuilder/issues/comments{/number}",
    "contents_url": "https://api.github.com/repos/baraths84/filebuilder/contents/{+path}",
    "compare_url": "https://api.github.com/repos/baraths84/filebuilder/compare/{base}...{head}",
    "merges_url": "https://api.github.com/repos/baraths84/filebuilder/merges",
    "archive_url": "https://api.github.com/repos/baraths84/filebuilder/{archive_format}{/ref}",
    "downloads_url": "https://api.github.com/repos/baraths84/filebuilder/downloads",
    "issues_url": "https://api.github.com/repos/baraths84/filebuilder/issues{/number}",
    "pulls_url": "https://api.github.com/repos/baraths84/filebuilder/pulls{/number}",
    "milestones_url": "https://api.github.com/repos/baraths84/filebuilder/milestones{/number}",
    "notifications_url": "https://api.github.com/repos/baraths84/filebuilder/notifications{?since,all,participating}",
    "labels_url": "https://api.github.com/repos/baraths84/filebuilder/labels{/name}",
    "releases_url": "https://api.github.com/repos/baraths84/filebuilder/releases{/id}",
    "deployments_url": "https://api.github.com/repos/baraths84/filebuilder/deployments",
    "created_at": "2018-09-12T17:19:49Z",
    "updated_at": "2020-08-13T22:54:30Z",
    "pushed_at": "2020-08-14T03:46:31Z",
    "git_url": "git://github.com/baraths84/filebuilder.git",
    "ssh_url": "git@github.com:baraths84/filebuilder.git",
    "clone_url": "https://github.com/baraths84/filebuilder.git",
    "svn_url": "https://github.com/baraths84/filebuilder",
    "homepage": null,
    "size": 917,
    "stargazers_count": 0,
    "watchers_count": 0,
    "language": "JavaScript",
    "has_issues": true,
    "has_projects": true,
    "has_downloads": true,
    "has_wiki": true,
    "has_pages": false,
    "forks_count": 0,
    "mirror_url": null,
    "archived": false,
    "disabled": false,
    "open_issues_count": 1,
    "license": null,
    "forks": 0,
    "open_issues": 1,
    "watchers": 0,
    "default_branch": "master"
  },
  "sender": {
    "login": "baraths84",
    "id": 2089311,
    "node_id": "MDQ6VXNlcjIwODkzMTE=",
    "avatar_url": "https://avatars1.githubusercontent.com/u/2089311?v=4",
    "gravatar_id": "",
    "url": "https://api.github.com/users/baraths84",
    "html_url": "https://github.com/baraths84",
    "followers_url": "https://api.github.com/users/baraths84/followers",
    "following_url": "https://api.github.com/users/baraths84/following{/other_user}",
    "gists_url": "https://api.github.com/users/baraths84/gists{/gist_id}",
    "starred_url": "https://api.github.com/users/baraths84/starred{/owner}{/repo}",
    "subscriptions_url": "https://api.github.com/users/baraths84/subscriptions",
    "organizations_url": "https://api.github.com/users/baraths84/orgs",
    "repos_url": "https://api.github.com/users/baraths84/repos",
    "events_url": "https://api.github.com/users/baraths84/events{/privacy}",
    "received_events_url": "https://api.github.com/users/baraths84/received_events",
    "type": "User",
    "site_admin": false
  }
}

Any pointers please @radekk . Thanks

@radekk
Copy link
Contributor

radekk commented Aug 28, 2020

Hi @baraths84, I'm not entirely sure as there is not much logs from lambda itself you shared but I have some ideas what could go wrong.

The response error target_url must use http(s) scheme might indicate a call from calling the Github API to set a status on a commit (github docs). Therefore, it could be a reason of not being able to get the repo supervisor (lambda) URL that it could be accessed from the internet.

This is the code that potentially failed:

getEndpointURL: (event) => {
if (!event.headers) return null;
return url.format({
protocol: event.headers['X-Forwarded-Proto'],
host: event.headers.Host,
pathname: event.path
}).replace(/\/+$/g, '');
},

If you are debugging that please check if event.headers. is not empty.

Please verify:

  1. That the repo:status scope is assigned to your github personal access token. Otherwise, it's not possible to set CI statuses on a commit.
  2. Check if all of your environment variables are set - GITHUB_TOKEN, JWT_SECRET
  3. Set API Gateway in front of Lambda if you don't have a one - more details here: aws lambda

@radekk radekk self-assigned this Aug 28, 2020
@radekk radekk added the pending Waiting for a third party to respond. label Aug 28, 2020
@baraths84
Copy link
Author

baraths84 commented Aug 29, 2020

Hi @radekk - Thanks for the inputs. I am still stuck on the same error.
Verified (1,2,3) For 2 - I created the Environment variable GITHUB_TOKEN, JWT_SECRET on AWS Lambda function alone.
-verified permissions.

i debugged and observed the payload flowing in
module.exports = async (payload, event, github, viewer, res, isFalsePositiveReport) => { console.log(payload.repository.name); console.log(event);

"event" is not empty - full json is logging correctly reference here.

const endpointURL = url.getEndpointURL(event); - this returns empty.
Yes i see event.headers object is undefined/empty.

I am still getting the same error.
HttpError: Validation Failed: {"resource":"Status","code":"custom","field":"target_url","message":"target_url must use http(s) scheme"}

AWS screenshots reference here

@radekk
Copy link
Contributor

radekk commented Aug 31, 2020

@baraths84 In the payload you included I see that there is x-forwarded-proto instead of X-Forwarded-Proto I use in the repo-supervisor. It might be an issue.

Would you be able to edit the source code and implement a change in a file:

protocol: event.headers['X-Forwarded-Proto'],

  1. From: protocol: event.headers['X-Forwarded-Proto'],
  2. To: protocol: event.headers['x-forwarded-proto'],

Then rebuild and repackage the repo-supervisor: npm run build and upload a new zip package to lambda.

Let me know if this worked.

@baraths84
Copy link
Author

baraths84 commented Sep 2, 2020

Hi @radekk , Thank you for debugging more!This helped fix the issue. Few other observations after applying the fix(sequence of fixes below):

  1. Supervisor — SLACK_URL is not set - I got this issue after applying the fix - Looks like this is mandatory ?
    repo-supervisor/config/main.json - I updated below property to 'false' to disable the trigger like below
    "runTriggers": false to disable Slack reporting.
  2. To fix broken link "details"- in PULL request - i updated the below "host" and "pathname" like below, since the payload was different. (is this because of github API revision changes ?) .
    from
    return url.format({ protocol: event.headers['x-forwarded-proto'], host: event.headers.Host, pathname: event.path }).replace(/\/+$/g, ''); },
    to
    return url.format({ protocol: event.headers['x-forwarded-proto'], host: event.headers.host, pathname: event.rawPath }).replace(/\/+$/g, '');
  3. under - repo-supervisor/src/viewer/index.js. -- I removed the "/" before query param "?" . Since my link was showing in broken state in the pull request.

getReportURL: (url, pullRequestId, pullRequestSHA, owner, repo) => { const id = token.create({ pullRequestId, pullRequestSHA, owner, repo }, secret); return ${url}?id=${id}; }

With above changes - the flow worked without any issues.

Thanks !

@radekk
Copy link
Contributor

radekk commented Sep 2, 2020

@baraths84 I'm glad to hear that it worked for you 👏

There seems to be some changes either in the way how Lambda headers are normalized (lowercase) or how github headers are sent. I'm going to investigate that and implement necessary fixes in the stable release.

Thank you for debugging and helping to identify these issues.

@radekk radekk added bug and removed pending Waiting for a third party to respond. labels Sep 2, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants