quarkiverse / quarkus-github-app

Develop your GitHub Apps in Java with Quarkus.
https://docs.quarkiverse.io/quarkus-github-app/dev/index.html
Apache License 2.0
64 stars 29 forks source link

Github merge_group is missing #664

Open janpk opened 1 month ago

janpk commented 1 month ago

Hi, would it be possible to get support for the merge_group event to avoid using @RawEvent?

gsmet commented 1 month ago

Hey!

It would need to be added here first: https://github.com/hub4j/github-api/blob/main/src/main/java/org/kohsuke/github/GHEventPayload.java .

I'm pretty full at the moment so if you have time you could experiment with it?

If not, I'll put in on my list but probably won't get to it before mid-October.

janpk commented 1 month ago

I will take a look at hub4j and try to figure out what needs to be done there. Just need to rewire my brain from Kotlin to Java😄

Closing this issue for now. Will create a new one depending on what I'm able to do with hub4j

gsmet commented 1 month ago

We can keep it open. Let me know how it goes for you and I’ll keep on my TODO if you don’t beat me to it.

gsmet commented 1 month ago

That being said, if you can get me an example payload, I might be able to check if it’s a matter of a few minutes or more.

janpk commented 1 month ago

Here is the merge_group: checks requested

{
    "action": "checks_requested",
    "merge_group": {
        "head_sha": "9372b57f677a2562db635fff72c74ced03af444c",
        "head_ref": "refs/heads/gh-readonly-queue/main/pr-29-db6125c8fc1e4021c0126b9e76d77bbb3849f3cc",
        "base_sha": "db6125c8fc1e4021c0126b9e76d77bbb3849f3cc",
        "base_ref": "refs/heads/main",
        "head_commit": {
            "id": "9372b57f677a2562db635fff72c74ced03af444c",
            "tree_id": "93c270f96343b61ca2c690befba30a71818f5d27",
            "message": "Merge pull request #29 from myorganization/feature/app-test-3\n\nchore: Updated PR template",
            "timestamp": "2024-09-05T11:54:00Z",
            "author": {
                "name": "Jan-Petter Krüger",
                "email": "j.p.k@myorg.com"
            },
            "committer": {
                "name": "GitHub",
                "email": "noreply@github.com"
            }
        }
    },
    "repository": {
    },
    "organization": {
    },
    "enterprise": {
    },
    "sender": {
    },
    "installation": {
    }
}

and merge_group: destroyed

{
    "action": "destroyed",
    "merge_group": {
        "head_sha": "db6125c8fc1e4021c0126b9e76d77bbb3849f3cc",
        "head_ref": "refs/heads/gh-readonly-queue/main/pr-28-84f9a3b9f76337ee77ed1511cedaa8694bbd5aa0",
        "base_sha": "84f9a3b9f76337ee77ed1511cedaa8694bbd5aa0",
        "base_ref": "refs/heads/main",
        "head_commit": {
            "id": "db6125c8fc1e4021c0126b9e76d77bbb3849f3cc",
            "tree_id": "5f19bd2b0c152924a44b4a0c475a4a1b50e3855c",
            "message": "Merge pull request #28 from myorganization/feature/app-test-2\n\nchore(docs): contributed to readme",
            "timestamp": "2024-09-05T11:27:04Z",
            "author": {
                "name": "Jan-Petter Krüger",
                "email": "j.p.k@myorg.com"
            },
            "committer": {
                "name": "GitHub",
                "email": "noreply@github.com"
            }
        }
    },
    "reason": "merged",
    "repository": {
    },
    "organization": {
    },
    "enterprise": {
    },
    "sender": {
    },
    "installation": {
    }
}