yegor256 / 0pdd

Puzzle Driven Development (PDD) Chatbot Assistant for Your GitHub Repositories
https://www.0pdd.com
MIT License
129 stars 32 forks source link

Can't connect `0pdd` to `jsmith` repository #702

Closed volodya-lombrozo closed 1 week ago

volodya-lombrozo commented 2 weeks ago

I have the jsmith repository with the following .0pdd.yaml configuration:

threshold: 256
model: true
alerts:
  suppress:
    - on-found-puzzle
    - on-lost-puzzle
    - on-scope
  github:
    - volodya-lombrozo
format:
  - short-title
  - title-length=100
tags:
  - pdd
  - bug

Also I added a web-hook:

**Payload URL ***

https://p.rehttp.net/https://www.0pdd.com/hook/github

**Content type ***

application/json

Also I added a pdd GitHub action:

---
name: pdd
on:
  push:
    branches:
      - main
  pull_request:
    branches:
      - main
jobs:
  pdd:
    runs-on: ubuntu-24.04
    steps:
      - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
      - uses: volodya-lombrozo/pdd-action@master

Actual behaviour: When I push new puzzles into main brach, nothing happens. Expected behaviour: When I push new puzzles into main brach, the new puzzles are successfully created.

volodya-lombrozo commented 2 weeks ago

@yegor256 Could you take a look, please?

yegor256 commented 2 weeks ago

@volodya-lombrozo what is the HTTP response that GitHub is getting from 0pdd.com server?

volodya-lombrozo commented 2 weeks ago

@yegor256

Response

Code 400 with the following headers

Content-Length: 88
Content-Type: text/html;charset=utf-8
Date: Fri, 08 Nov 2024 13:39:47 GMT
Nel: {"report_to":"heroku-nel","max_age":3600,"success_fraction":0.005,"failure_fraction":0.05,"response_headers":["Via"]}
Report-To: {"group":"heroku-nel","max_age":3600,"endpoints":[{"url":"https://nel.heroku.com/reports?ts=1731073187&sid=c46efe9b-d3d2-4a0c-8c76-bfafa16c5add&s=nN5ndDZT7x9dc5VrjiPB%2BC0AlBJao3IgYHjWWyLWAdY%3D"}]}
Reporting-Endpoints: heroku-nel=https://nel.heroku.com/reports?ts=1731073187&sid=c46efe9b-d3d2-4a0c-8c76-bfafa16c5add&s=nN5ndDZT7x9dc5VrjiPB%2BC0AlBJao3IgYHjWWyLWAdY%3D
Server: WEBrick/1.8.1 (Ruby/3.1.4/2023-03-30)
Vary: Accept-Encoding
Via: 1.1 vegur, 1.1 vegur
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-Rehttp-Revision: BUILD
X-Takes-Millis: 135
X-Takes-Tkproxy: from /hook/github to https://www.0pdd.com/hook/github by org.takes.tk.TkProxy
X-Takes-Version: 1.24.4 9dc92d2 2022-08-26T17:02:45
X-Xss-Protection: 1; mode=block

and body

URL-encoded content is expected in the "payload" query parameter, but it is not provided

Request

Headers

Request URL: https://p.rehttp.net/https://www.0pdd.com/hook/github
Request method: POST
Accept: */*
Content-Type: application/x-www-form-urlencoded
User-Agent: GitHub-Hookshot/8fe978d
X-GitHub-Delivery: eb4383e2-9dd6-11ef-8082-c53f3275268d
X-GitHub-Event: push
X-GitHub-Hook-ID: 445796827
X-GitHub-Hook-Installation-Target-ID: 724666553
X-GitHub-Hook-Installation-Target-Type: repository

with payload

{
  "ref": "refs/heads/main",
  "before": "bbd1c17c00a44e8b2671b43a7befb4302c65cf5c",
  "after": "87c1b5720ff17a982360e30e7c1bcc42dad103b2",
  "repository": {
    "id": 724666553,
    "node_id": "R_kgDOKzGIuQ",
    "name": "jsmith",
    "full_name": "volodya-lombrozo/jsmith",
    "private": false,
    "owner": {
      "name": "volodya-lombrozo",
      "email": "volodya.lombrozo@gmail.com",
      "login": "volodya-lombrozo",
      "id": 51804353,
      "node_id": "MDQ6VXNlcjUxODA0MzUz",
      "avatar_url": "https://avatars.githubusercontent.com/u/51804353?v=4",
      "gravatar_id": "",
      "url": "https://api.github.com/users/volodya-lombrozo",
      "html_url": "https://github.com/volodya-lombrozo",
      "followers_url": "https://api.github.com/users/volodya-lombrozo/followers",
      "following_url": "https://api.github.com/users/volodya-lombrozo/following{/other_user}",
      "gists_url": "https://api.github.com/users/volodya-lombrozo/gists{/gist_id}",
      "starred_url": "https://api.github.com/users/volodya-lombrozo/starred{/owner}{/repo}",
      "subscriptions_url": "https://api.github.com/users/volodya-lombrozo/subscriptions",
      "organizations_url": "https://api.github.com/users/volodya-lombrozo/orgs",
      "repos_url": "https://api.github.com/users/volodya-lombrozo/repos",
      "events_url": "https://api.github.com/users/volodya-lombrozo/events{/privacy}",
      "received_events_url": "https://api.github.com/users/volodya-lombrozo/received_events",
      "type": "User",
      "user_view_type": "public",
      "site_admin": false
    },
    "html_url": "https://github.com/volodya-lombrozo/jsmith",
    "description": "Jsmith, a random generator of Java programs",
    "fork": false,
    "url": "https://github.com/volodya-lombrozo/jsmith",
    "forks_url": "https://api.github.com/repos/volodya-lombrozo/jsmith/forks",
    "keys_url": "https://api.github.com/repos/volodya-lombrozo/jsmith/keys{/key_id}",
    "collaborators_url": "https://api.github.com/repos/volodya-lombrozo/jsmith/collaborators{/collaborator}",
    "teams_url": "https://api.github.com/repos/volodya-lombrozo/jsmith/teams",
    "hooks_url": "https://api.github.com/repos/volodya-lombrozo/jsmith/hooks",
    "issue_events_url": "https://api.github.com/repos/volodya-lombrozo/jsmith/issues/events{/number}",
    "events_url": "https://api.github.com/repos/volodya-lombrozo/jsmith/events",
    "assignees_url": "https://api.github.com/repos/volodya-lombrozo/jsmith/assignees{/user}",
    "branches_url": "https://api.github.com/repos/volodya-lombrozo/jsmith/branches{/branch}",
    "tags_url": "https://api.github.com/repos/volodya-lombrozo/jsmith/tags",
    "blobs_url": "https://api.github.com/repos/volodya-lombrozo/jsmith/git/blobs{/sha}",
    "git_tags_url": "https://api.github.com/repos/volodya-lombrozo/jsmith/git/tags{/sha}",
    "git_refs_url": "https://api.github.com/repos/volodya-lombrozo/jsmith/git/refs{/sha}",
    "trees_url": "https://api.github.com/repos/volodya-lombrozo/jsmith/git/trees{/sha}",
    "statuses_url": "https://api.github.com/repos/volodya-lombrozo/jsmith/statuses/{sha}",
    "languages_url": "https://api.github.com/repos/volodya-lombrozo/jsmith/languages",
    "stargazers_url": "https://api.github.com/repos/volodya-lombrozo/jsmith/stargazers",
    "contributors_url": "https://api.github.com/repos/volodya-lombrozo/jsmith/contributors",
    "subscribers_url": "https://api.github.com/repos/volodya-lombrozo/jsmith/subscribers",
    "subscription_url": "https://api.github.com/repos/volodya-lombrozo/jsmith/subscription",
    "commits_url": "https://api.github.com/repos/volodya-lombrozo/jsmith/commits{/sha}",
    "git_commits_url": "https://api.github.com/repos/volodya-lombrozo/jsmith/git/commits{/sha}",
    "comments_url": "https://api.github.com/repos/volodya-lombrozo/jsmith/comments{/number}",
    "issue_comment_url": "https://api.github.com/repos/volodya-lombrozo/jsmith/issues/comments{/number}",
    "contents_url": "https://api.github.com/repos/volodya-lombrozo/jsmith/contents/{+path}",
    "compare_url": "https://api.github.com/repos/volodya-lombrozo/jsmith/compare/{base}...{head}",
    "merges_url": "https://api.github.com/repos/volodya-lombrozo/jsmith/merges",
    "archive_url": "https://api.github.com/repos/volodya-lombrozo/jsmith/{archive_format}{/ref}",
    "downloads_url": "https://api.github.com/repos/volodya-lombrozo/jsmith/downloads",
    "issues_url": "https://api.github.com/repos/volodya-lombrozo/jsmith/issues{/number}",
    "pulls_url": "https://api.github.com/repos/volodya-lombrozo/jsmith/pulls{/number}",
    "milestones_url": "https://api.github.com/repos/volodya-lombrozo/jsmith/milestones{/number}",
    "notifications_url": "https://api.github.com/repos/volodya-lombrozo/jsmith/notifications{?since,all,participating}",
    "labels_url": "https://api.github.com/repos/volodya-lombrozo/jsmith/labels{/name}",
    "releases_url": "https://api.github.com/repos/volodya-lombrozo/jsmith/releases{/id}",
    "deployments_url": "https://api.github.com/repos/volodya-lombrozo/jsmith/deployments",
    "created_at": 1701182881,
    "updated_at": "2024-11-06T15:35:49Z",
    "pushed_at": 1731073186,
    "git_url": "git://github.com/volodya-lombrozo/jsmith.git",
    "ssh_url": "git@github.com:volodya-lombrozo/jsmith.git",
    "clone_url": "https://github.com/volodya-lombrozo/jsmith.git",
    "svn_url": "https://github.com/volodya-lombrozo/jsmith",
    "homepage": null,
    "size": 663,
    "stargazers_count": 11,
    "watchers_count": 11,
    "language": "Java",
    "has_issues": true,
    "has_projects": true,
    "has_downloads": true,
    "has_wiki": true,
    "has_pages": false,
    "has_discussions": false,
    "forks_count": 1,
    "mirror_url": null,
    "archived": false,
    "disabled": false,
    "open_issues_count": 7,
    "license": {
      "key": "mit",
      "name": "MIT License",
      "spdx_id": "MIT",
      "url": "https://api.github.com/licenses/mit",
      "node_id": "MDc6TGljZW5zZTEz"
    },
    "allow_forking": true,
    "is_template": false,
    "web_commit_signoff_required": false,
    "topics": [

    ],
    "visibility": "public",
    "forks": 1,
    "open_issues": 7,
    "watchers": 11,
    "default_branch": "main",
    "stargazers": 11,
    "master_branch": "main"
  },
  "pusher": {
    "name": "volodya-lombrozo",
    "email": "volodya.lombrozo@gmail.com"
  },
  "sender": {
    "login": "volodya-lombrozo",
    "id": 51804353,
    "node_id": "MDQ6VXNlcjUxODA0MzUz",
    "avatar_url": "https://avatars.githubusercontent.com/u/51804353?v=4",
    "gravatar_id": "",
    "url": "https://api.github.com/users/volodya-lombrozo",
    "html_url": "https://github.com/volodya-lombrozo",
    "followers_url": "https://api.github.com/users/volodya-lombrozo/followers",
    "following_url": "https://api.github.com/users/volodya-lombrozo/following{/other_user}",
    "gists_url": "https://api.github.com/users/volodya-lombrozo/gists{/gist_id}",
    "starred_url": "https://api.github.com/users/volodya-lombrozo/starred{/owner}{/repo}",
    "subscriptions_url": "https://api.github.com/users/volodya-lombrozo/subscriptions",
    "organizations_url": "https://api.github.com/users/volodya-lombrozo/orgs",
    "repos_url": "https://api.github.com/users/volodya-lombrozo/repos",
    "events_url": "https://api.github.com/users/volodya-lombrozo/events{/privacy}",
    "received_events_url": "https://api.github.com/users/volodya-lombrozo/received_events",
    "type": "User",
    "user_view_type": "public",
    "site_admin": false
  },
  "created": false,
  "deleted": false,
  "forced": false,
  "base_ref": null,
  "compare": "https://github.com/volodya-lombrozo/jsmith/compare/bbd1c17c00a4...87c1b5720ff1",
  "commits": [
    {
      "id": "87c1b5720ff17a982360e30e7c1bcc42dad103b2",
      "tree_id": "3313161561690c1934c8726e6a8592e0d6f8d4ff",
      "distinct": true,
      "message": "chore: add the pdd configuration",
      "timestamp": "2024-11-08T16:39:39+03:00",
      "url": "https://github.com/volodya-lombrozo/jsmith/commit/87c1b5720ff17a982360e30e7c1bcc42dad103b2",
      "author": {
        "name": "volodya-lombrozo",
        "email": "volodya.lombrozo@gmail.com",
        "username": "volodya-lombrozo"
      },
      "committer": {
        "name": "volodya-lombrozo",
        "email": "volodya.lombrozo@gmail.com",
        "username": "volodya-lombrozo"
      },
      "added": [
        ".0pdd.yaml"
      ],
      "removed": [

      ],
      "modified": [

      ]
    }
  ],
  "head_commit": {
    "id": "87c1b5720ff17a982360e30e7c1bcc42dad103b2",
    "tree_id": "3313161561690c1934c8726e6a8592e0d6f8d4ff",
    "distinct": true,
    "message": "chore: add the pdd configuration",
    "timestamp": "2024-11-08T16:39:39+03:00",
    "url": "https://github.com/volodya-lombrozo/jsmith/commit/87c1b5720ff17a982360e30e7c1bcc42dad103b2",
    "author": {
      "name": "volodya-lombrozo",
      "email": "volodya.lombrozo@gmail.com",
      "username": "volodya-lombrozo"
    },
    "committer": {
      "name": "volodya-lombrozo",
      "email": "volodya.lombrozo@gmail.com",
      "username": "volodya-lombrozo"
    },
    "added": [
      ".0pdd.yaml"
    ],
    "removed": [

    ],
    "modified": [

    ]
  }
}
volodya-lombrozo commented 1 week ago

@yegor256 Could you help with it, please? It's kinda blocker

yegor256 commented 1 week ago

@volodya-lombrozo I will check today. In the meantime, try to change the URL to this one, it may help: https://www.0pdd.com/hook/github

volodya-lombrozo commented 1 week ago

@yegor256 the same output: Last delivery was not successful. Invalid HTTP Response: 400.

yegor256 commented 1 week ago

@volodya-lombrozo try to use a different content-type

volodya-lombrozo commented 1 week ago

@yegor256 I tried https://www.0pdd.com/hook/github with application/json one more time and it seems to help. Than you!