Add emoji webhooks
What does this MR do and why?
Add emoji webhooks
Changelog: added
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
Before | After |
---|---|
{
"object_kind": "emoji",
"event_type": "award",
"user": {
"id": 1,
"name": "Blake Bergstrom",
"username": "root",
"avatar_url": "http://gdk.test:3000/uploads/-/system/user/avatar/1/avatar.png",
"email": "[REDACTED]"
},
"project_id": 6,
"project": {
"id": 6,
"name": "Flight",
"description": "Velit fugit aperiam illum deleniti odio sequi.",
"web_url": "http://gdk.test:3000/flightjs/Flight",
"avatar_url": null,
"git_ssh_url": "ssh://git@gdk.test:2222/flightjs/Flight.git",
"git_http_url": "http://gdk.test:3000/flightjs/Flight.git",
"namespace": "Flightjs",
"visibility_level": 20,
"path_with_namespace": "flightjs/Flight",
"default_branch": "master",
"ci_config_path": null,
"homepage": "http://gdk.test:3000/flightjs/Flight",
"url": "ssh://git@gdk.test:2222/flightjs/Flight.git",
"ssh_url": "ssh://git@gdk.test:2222/flightjs/Flight.git",
"http_url": "http://gdk.test:3000/flightjs/Flight.git"
},
"object_attributes": {
"user_id": 1,
"created_at": "2023-07-04 20:44:11 UTC",
"id": 1,
"name": "thumbsup",
"awardable_type": "Note",
"awardable_id": 363,
"updated_at": "2023-07-04 20:44:11 UTC",
"action": "award",
"url": "http://gdk.test:3000/flightjs/Flight/-/issues/42#note_363"
},
"note": {
"attachment": null,
"author_id": 1,
"change_position": null,
"commit_id": null,
"created_at": "2023-07-04 15:09:55 UTC",
"discussion_id": "c3d97fd471f210a5dc8b97a409e3bea95ee06c14",
"id": 363,
"line_code": null,
"note": "Testing 123",
"noteable_id": 635,
"noteable_type": "Issue",
"original_position": null,
"position": null,
"project_id": 6,
"resolved_at": null,
"resolved_by_id": null,
"resolved_by_push": null,
"st_diff": null,
"system": false,
"type": null,
"updated_at": "2023-07-04 19:58:46 UTC",
"updated_by_id": null,
"description": "Testing 123",
"url": "http://gdk.test:3000/flightjs/Flight/-/issues/42#note_363"
},
"issue": {
"author_id": 1,
"closed_at": null,
"confidential": false,
"created_at": "2023-07-04 14:59:43 UTC",
"description": "Issue description!",
"discussion_locked": null,
"due_date": null,
"id": 635,
"iid": 42,
"last_edited_at": null,
"last_edited_by_id": null,
"milestone_id": null,
"moved_to_id": null,
"duplicated_to_id": null,
"project_id": 6,
"relative_position": 18981,
"state_id": 1,
"time_estimate": 0,
"title": "New issue!",
"updated_at": "2023-07-04 15:09:55 UTC",
"updated_by_id": null,
"weight": null,
"health_status": null,
"url": "http://gdk.test:3000/flightjs/Flight/-/issues/42",
"total_time_spent": 0,
"time_change": 0,
"human_total_time_spent": null,
"human_time_change": null,
"human_time_estimate": null,
"assignee_ids": [
1
],
"assignee_id": 1,
"labels": [
],
"state": "opened",
"severity": "unknown"
}
}
Migrations
lee@Lees-MBP gitlab % bundle exec rake db:migrate:up VERSION=20230615200434 RAILS_ENV=development
main: == [advisory_lock_connection] object_id: 221540, pg_backend_pid: 33092
main: == 20230615200434 AddEmojiEventsToWebHooks: migrating =========================
main: -- add_column(:web_hooks, :emoji_events, :boolean, {:null=>false, :default=>false})
main: -> 0.0159s
main: == 20230615200434 AddEmojiEventsToWebHooks: migrated (0.0561s) ================
main: == [advisory_lock_connection] object_id: 221540, pg_backend_pid: 33092
lee@Lees-MBP gitlab % bundle exec rake db:migrate:down VERSION=20230615200434 RAILS_ENV=development
main: == [advisory_lock_connection] object_id: 221620, pg_backend_pid: 32589
main: == 20230615200434 AddEmojiEventsToWebHooks: reverting =========================
main: -- remove_column(:web_hooks, :emoji_events, :boolean, {:null=>false, :default=>false})
main: -> 0.0045s
main: == 20230615200434 AddEmojiEventsToWebHooks: reverted (0.0118s) ================
main: == [advisory_lock_connection] object_id: 221620, pg_backend_pid: 32589
How to set up and validate locally
- Setup a group and or project webhook (I normally use the address
https://example.local/test
)- be sure to selectEmoji events
- Award and revoke some emojis to issues/merge requests/snippets/notes
- Check the webhook logs
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Approvals
area | reviewer | maintainer |
---|---|---|
documentation | - |
|
database |
|
|
backend |
|
|
frontend |
|
|
groupimport and integrate | - |
|
test | - |
|
Related to #290773 (closed)
Edited by Lee Tickett