Commit c31fcc99 authored by charlie ablett's avatar charlie ablett

Merge branch 'remove-owner-data-from-group-webhooks' into 'master'

Remove owner data from group webhooks

See merge request gitlab-org/gitlab!52071
parents 7f429106 12a3b63a
---
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`. ...@@ -300,15 +300,11 @@ If the user is blocked via LDAP, `state` is `ldap_blocked`.
"updated_at": "2012-07-21T07:38:22Z", "updated_at": "2012-07-21T07:38:22Z",
"event_name": "group_create", "event_name": "group_create",
"name": "StoreCloud", "name": "StoreCloud",
"owner_email": null,
"owner_name": null,
"path": "storecloud", "path": "storecloud",
"group_id": 78 "group_id": 78
} }
``` ```
`owner_name` and `owner_email` are always `null`. Please see <https://gitlab.com/gitlab-org/gitlab/-/issues/20011>.
**Group removed:** **Group removed:**
```json ```json
...@@ -317,15 +313,11 @@ If the user is blocked via LDAP, `state` is `ldap_blocked`. ...@@ -317,15 +313,11 @@ If the user is blocked via LDAP, `state` is `ldap_blocked`.
"updated_at": "2012-07-21T07:38:22Z", "updated_at": "2012-07-21T07:38:22Z",
"event_name": "group_destroy", "event_name": "group_destroy",
"name": "StoreCloud", "name": "StoreCloud",
"owner_email": null,
"owner_name": null,
"path": "storecloud", "path": "storecloud",
"group_id": 78 "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:** **Group renamed:**
```json ```json
...@@ -337,15 +329,11 @@ If the user is blocked via LDAP, `state` is `ldap_blocked`. ...@@ -337,15 +329,11 @@ If the user is blocked via LDAP, `state` is `ldap_blocked`.
"path": "better-name", "path": "better-name",
"full_path": "parent-group/better-name", "full_path": "parent-group/better-name",
"group_id": 64, "group_id": 64,
"owner_name": null,
"owner_email": null,
"old_path": "old-name", "old_path": "old-name",
"old_full_path": "parent-group/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:** **New Group Member:**
```json ```json
......
...@@ -14,8 +14,6 @@ module Gitlab ...@@ -14,8 +14,6 @@ module Gitlab
# :path=>"group1", # :path=>"group1",
# :full_path=>"group1", # :full_path=>"group1",
# :group_id=>1, # :group_id=>1,
# :owner_name=>nil,
# :owner_email=>nil,
# :old_path=>"old-path", # :old_path=>"old-path",
# :old_full_path=>"old-path" # :old_full_path=>"old-path"
# } # }
...@@ -32,15 +30,11 @@ module Gitlab ...@@ -32,15 +30,11 @@ module Gitlab
private private
def group_data def group_data
owner = group.owner
{ {
name: group.name, name: group.name,
path: group.path, path: group.path,
full_path: group.full_path, full_path: group.full_path,
group_id: group.id, group_id: group.id
owner_name: owner.try(:name),
owner_email: owner.try(:email)
} }
end end
......
...@@ -10,8 +10,7 @@ RSpec.describe Gitlab::HookData::GroupBuilder do ...@@ -10,8 +10,7 @@ RSpec.describe Gitlab::HookData::GroupBuilder do
let(:event_name) { data[:event_name] } let(:event_name) { data[:event_name] }
let(:attributes) do let(:attributes) do
[ [
:event_name, :created_at, :updated_at, :name, :path, :full_path, :group_id, :event_name, :created_at, :updated_at, :name, :path, :full_path, :group_id
:owner_name, :owner_email
] ]
end end
...@@ -24,8 +23,6 @@ RSpec.describe Gitlab::HookData::GroupBuilder do ...@@ -24,8 +23,6 @@ RSpec.describe Gitlab::HookData::GroupBuilder do
expect(data[:path]).to eq(group.path) expect(data[:path]).to eq(group.path)
expect(data[:full_path]).to eq(group.full_path) expect(data[:full_path]).to eq(group.full_path)
expect(data[:group_id]).to eq(group.id) 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[:created_at]).to eq(group.created_at.xmlschema)
expect(data[:updated_at]).to eq(group.updated_at.xmlschema) expect(data[:updated_at]).to eq(group.updated_at.xmlschema)
end end
......
...@@ -45,15 +45,13 @@ RSpec.describe SystemHooksService do ...@@ -45,15 +45,13 @@ RSpec.describe SystemHooksService do
it do it do
expect(event_data(group, :create)).to include( expect(event_data(group, :create)).to include(
:event_name, :name, :created_at, :updated_at, :path, :group_id, :event_name, :name, :created_at, :updated_at, :path, :group_id
:owner_name, :owner_email
) )
end end
it do it do
expect(event_data(group, :destroy)).to include( expect(event_data(group, :destroy)).to include(
:event_name, :name, :created_at, :updated_at, :path, :group_id, :event_name, :name, :created_at, :updated_at, :path, :group_id
:owner_name, :owner_email
) )
end 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