Commit 12a3b63a authored by Manoj M J's avatar Manoj M J

Remove group owner data from webhooks

Remove group owner data from webhooks
parent 77f7a265
---
title: Remove group owner data from webhooks
merge_request: 52071
author:
type: changed
......@@ -300,15 +300,11 @@ If the user is blocked via LDAP, `state` is `ldap_blocked`.
"updated_at": "2012-07-21T07:38:22Z",
"event_name": "group_create",
"name": "StoreCloud",
"owner_email": null,
"owner_name": null,
"path": "storecloud",
"group_id": 78
}
```
`owner_name` and `owner_email` are always `null`. Please see <https://gitlab.com/gitlab-org/gitlab/-/issues/20011>.
**Group removed:**
```json
......@@ -317,15 +313,11 @@ If the user is blocked via LDAP, `state` is `ldap_blocked`.
"updated_at": "2012-07-21T07:38:22Z",
"event_name": "group_destroy",
"name": "StoreCloud",
"owner_email": null,
"owner_name": null,
"path": "storecloud",
"group_id": 78
}
```
`owner_name` and `owner_email` are always `null`. Please see [issue #20011](https://gitlab.com/gitlab-org/gitlab/-/issues/20011).
**Group renamed:**
```json
......@@ -337,15 +329,11 @@ If the user is blocked via LDAP, `state` is `ldap_blocked`.
"path": "better-name",
"full_path": "parent-group/better-name",
"group_id": 64,
"owner_name": null,
"owner_email": null,
"old_path": "old-name",
"old_full_path": "parent-group/old-name"
}
```
`owner_name` and `owner_email` are always `null`. Please see <https://gitlab.com/gitlab-org/gitlab/-/issues/20011>.
**New Group Member:**
```json
......
......@@ -14,8 +14,6 @@ module Gitlab
# :path=>"group1",
# :full_path=>"group1",
# :group_id=>1,
# :owner_name=>nil,
# :owner_email=>nil,
# :old_path=>"old-path",
# :old_full_path=>"old-path"
# }
......@@ -32,15 +30,11 @@ module Gitlab
private
def group_data
owner = group.owner
{
name: group.name,
path: group.path,
full_path: group.full_path,
group_id: group.id,
owner_name: owner.try(:name),
owner_email: owner.try(:email)
group_id: group.id
}
end
......
......@@ -10,8 +10,7 @@ RSpec.describe Gitlab::HookData::GroupBuilder do
let(:event_name) { data[:event_name] }
let(:attributes) do
[
:event_name, :created_at, :updated_at, :name, :path, :full_path, :group_id,
:owner_name, :owner_email
:event_name, :created_at, :updated_at, :name, :path, :full_path, :group_id
]
end
......@@ -24,8 +23,6 @@ RSpec.describe Gitlab::HookData::GroupBuilder do
expect(data[:path]).to eq(group.path)
expect(data[:full_path]).to eq(group.full_path)
expect(data[:group_id]).to eq(group.id)
expect(data[:owner_name]).to eq(nil)
expect(data[:owner_email]).to eq(nil)
expect(data[:created_at]).to eq(group.created_at.xmlschema)
expect(data[:updated_at]).to eq(group.updated_at.xmlschema)
end
......
......@@ -45,15 +45,13 @@ RSpec.describe SystemHooksService do
it do
expect(event_data(group, :create)).to include(
:event_name, :name, :created_at, :updated_at, :path, :group_id,
:owner_name, :owner_email
:event_name, :name, :created_at, :updated_at, :path, :group_id
)
end
it do
expect(event_data(group, :destroy)).to include(
:event_name, :name, :created_at, :updated_at, :path, :group_id,
:owner_name, :owner_email
:event_name, :name, :created_at, :updated_at, :path, :group_id
)
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment