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

AutoUpdateTitleWithLabelSubscriber does not work on UX #257

Open
Kocal opened this issue Feb 28, 2025 · 4 comments
Open

AutoUpdateTitleWithLabelSubscriber does not work on UX #257

Kocal opened this issue Feb 28, 2025 · 4 comments

Comments

@Kocal
Copy link
Contributor

Kocal commented Feb 28, 2025

Hi!

I'm trying to understand why the AutoUpdateTitleWithLabelSubscriber configured on symfony/ux does not work.

For example in the PR symfony/ux#2602, I added the label LiveComponent which has a dddddd color, but the title didn't change.

I have another examples, if it can helps:

Do you know what can happens here? Could it be caused by a missing configuration in https://github.com/symfony/ux/settings/hooks?

Thanks!

@Kocal
Copy link
Contributor Author

Kocal commented Feb 28, 2025

I've just checked recent webhook deliveries, and sometimes we have a 500 error:
Image
or sometimes we have a {"unsupported_action":"pull_request"} content, meaning IINW that no subscribers were able to successfully handle the payload:
Image

@Kocal
Copy link
Contributor Author

Kocal commented Feb 28, 2025

By curiosity I executed locally the failing webhook b7491a40-f568-11ef-8926-deac0518a433 with the following payload:

Request URL: https://master-7rqtwti-7z7nkuqybnws6.eu-5.platformsh.site/webhooks/github
Request method: POST
Accept: */*
Content-Type: application/json
User-Agent: GitHub-Hookshot/c3aacd3
X-GitHub-Delivery: b7491a40-f568-11ef-8926-deac0518a433
X-GitHub-Event: pull_request
X-GitHub-Hook-ID: 457623327
X-GitHub-Hook-Installation-Target-ID: 316705415
X-GitHub-Hook-Installation-Target-Type: repository
X-Hub-Signature: sha1=748fc20f14a78a6414f0b2483afd04128a328e37
X-Hub-Signature-256: sha256=0b2098054b63f645720fd5352bee4095e7bba8cec4b7ac753ff00809f2723a50

{
  "action": "labeled",
  "number": 2602,
  "pull_request": {
    "url": "https://api.github.com/repos/symfony/ux/pulls/2602",
    "id": 2356371592,
    // ...
    "title": "[ComponentWithFormTrait] Force recreation of FormView on PreReRender hook to synchronize FormInstance and FormView.",
    // ...
    "labels": [
      {
        "id": 2540405635,
        "node_id": "MDU6TGFiZWwyNTQwNDA1NjM1",
        "url": "https://api.github.com/repos/symfony/ux/labels/Bug",
        "name": "Bug",
        "color": "E10C02",
        "default": false,
        "description": "Bug Fix"
      },
      {
        "id": 4511728191,
        "node_id": "LA_kwDOEuCKh88AAAABDOuCPw",
        "url": "https://api.github.com/repos/symfony/ux/labels/Status:%20Needs%20Review",
        "name": "Status: Needs Review",
        "color": "EDEDED",
        "default": false,
        "description": "Needs to be reviewed"
      },
      {
        "id": 6831690880,
        "node_id": "LA_kwDOEuCKh88AAAABlzNUgA",
        "url": "https://api.github.com/repos/symfony/ux/labels/LiveComponent",
        "name": "LiveComponent",
        "color": "dddddd",
        "default": false,
        "description": ""
      }
    ],
  }
  // ...
}

And it worked, instead of having a 500 error, I'm having the following 200 response:

{"pull_request":2602,"new_title":"[LiveComponent] [ComponentWithFormTrait] Force recreation of FormView on PreReRender hook to synchronize FormInstance and FormView."}

and the PR's title have been updated (I expected [ComponentWithFormTrait] to be removed from the title, but that's another problem):
Image

@Kocal
Copy link
Contributor Author

Kocal commented Feb 28, 2025

Still on symfony/ux#2602, I tested:

  • to add a new label TwigComponent, which triggered webhook fc3609a0-f5aa-11ef-9433-297ca1ece72a -> error 500
  • to remove this new label, which triggered webhook 0bbea170-f5ab-11ef-8963-1029a34ad442 -> {"unsupported_action":"pull_request"}

@fabpot
Copy link
Contributor

fabpot commented Mar 3, 2025

[2025-03-03T10:23:07.138303+00:00] php.WARNING: Warning: Trying to access array offset on int {"exception":"[object] (ErrorException(code: 0): Warning: Trying to access array offset on int at /app/src/Api/Workflow/GithubWorkflowApi.php:28)"} []
[2025-03-03T10:23:07.138370+00:00] php.WARNING: Warning: Trying to access array offset on null {"exception":"[object] (ErrorException(code: 0): Warning: Trying to access array offset on null at /app/src/Api/Workflow/GithubWorkflowApi.php:28)"} []
[2025-03-03T10:23:07.138416+00:00] php.WARNING: Warning: Undefined array key "head_repository" {"exception":"[object] (ErrorException(code: 0): Warning: Undefined array key \"head_repository\" at /app/src/Api/Workflow/GithubWorkflowApi.php:28)"} []
[2025-03-03T10:23:07.138482+00:00] php.WARNING: Warning: Trying to access array offset on null {"exception":"[object] (ErrorException(code: 0): Warning: Trying to access array offset on null at /app/src/Api/Workflow/GithubWorkflowApi.php:28)"} []

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

No branches or pull requests

2 participants