User Changed webhook: add 'nickname' and 'old_nickname' #93582

Merged
Sybren A. Stüvel merged 2 commits from webhook/gitea-username into main 2023-05-01 15:38:14 +02:00

Monitor users' nicknames, send out a 'user changed' webhook when it changes, and include the nickname in the webhook payload.

This also adds an old_nickname field to the 'user changed' webhook payload. This is necessary for the Gitea user renaming logic (see infrastructure/blender-projects-platform#1) . Since Blender ID is more lenient with allowed characters, the username on Gitea and the nickname on Blender ID will not exactly match. To detect whether a rename of the Gitea user is actually required, the webhook needs to know whether the Blender ID nickname actually changed or not.

Monitor users' nicknames, send out a 'user changed' webhook when it changes, and include the nickname in the webhook payload. This also adds an `old_nickname` field to the 'user changed' webhook payload. This is necessary for the Gitea user renaming logic (see https://projects.blender.org/infrastructure/blender-projects-platform/issues/1) . Since Blender ID is more lenient with allowed characters, the username on Gitea and the nickname on Blender ID will not exactly match. To detect whether a rename of the Gitea user is actually required, the webhook needs to know whether the Blender ID nickname actually changed or not.
Sybren A. Stüvel added 2 commits 2023-05-01 15:11:56 +02:00
3c6ba65e7b Refactor: simplify 'user changed' webhook payload construction
Instead of ternary `if`/`else` expression, use a small function.

No functional changes.
6ca096c4c8 User Changed webhook: add 'nickname' and 'old_nickname'
Monitor users' nicknames, send out a 'user changed' webhook when it
changes, and include the nickname in the webhook payload.

This also adds an `old_nickname` field to the 'user changed' webhook
payload. This is necessary for the Gitea user renaming logic. Since
Blender ID is more lenient with allowed characters, the username on
Gitea and the nickname on Blender ID will not exactly match. To detect
whether a rename of the Gitea user is actually required, the webhook
needs to know whether the Blender ID nickname actually changed or not.
Sybren A. Stüvel requested review from Francesco Siddi 2023-05-01 15:12:02 +02:00
Sybren A. Stüvel added the
Priority::High
label 2023-05-01 15:12:09 +02:00
Author
Owner

over-the-shoulder approved by @fsiddi

over-the-shoulder approved by @fsiddi
Sybren A. Stüvel merged commit 4f2f4129c2 into main 2023-05-01 15:38:14 +02:00
Sybren A. Stüvel deleted branch webhook/gitea-username 2023-05-01 15:38:14 +02:00
Sign in to join this conversation.
No description provided.