Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
fe8940d2
Commit
fe8940d2
authored
Oct 15, 2020
by
Arihant
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added multiple methods(webhook, scm, issue boards)
parent
b58d35dd
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
63 additions
and
4 deletions
+63
-4
doc/administration/troubleshooting/gitlab_rails_cheat_sheet.md
...dministration/troubleshooting/gitlab_rails_cheat_sheet.md
+63
-4
No files found.
doc/administration/troubleshooting/gitlab_rails_cheat_sheet.md
View file @
fe8940d2
...
...
@@ -222,11 +222,12 @@ namespace = Namespace.find_by_full_path("")
```
ruby
# ID will be the webhook_id
WebHookLog
.
where
(
web_hook_id:
ID
).
each_slice
(
ID
)
do
|
slice
|
slice
.
each
(
&
:destroy
)
end
hook
=
WebHook
.
find
(
ID
)
WebHooks
::
DestroyService
.
new
(
current_user
).
execute
(
hook
)
WebHook
.
find
(
ID
).
destroy
#In case the service gets timeout consider removing webhook_logs
hook
.
web_hook_logs
.
limit
(
BATCH_SIZE
).
delete_all
```
### Bulk update service integration password for _all_ projects
...
...
@@ -285,6 +286,16 @@ GitlabShellWorker.perform_in(0, :remove_repository, p.repository_storage, p.wiki
p
.
create_wiki
### creates the wiki project on the filesystem
```
## Issue boards
### In case of issue boards not loading properly and it's getting time out. We need to call the Issue Rebalancing service to fix this
```
ruby
p
=
Project
.
find_by_full_path
(
'PROJECT PATH'
)
IssueRebalancingService
.
new
(
p
.
issues
.
take
).
execute
```
## Imports / Exports
```
ruby
...
...
@@ -509,6 +520,54 @@ group = Group.find_by_path_or_name('group-name')
group
.
project_creation_level
=
0
```
## SCIM
### Fixing bad SCIM identities
```
ruby
def
delete_bad_scim
(
email
,
group_path
)
output
=
""
u
=
User
.
find_by_email
(
email
)
uid
=
u
.
id
g
=
Group
.
find_by_full_path
(
group_path
)
saml_prov_id
=
SamlProvider
.
find_by
(
group_id:
g
.
id
).
id
saml
=
Identity
.
where
(
user_id:
uid
,
saml_provider_id:
saml_prov_id
)
scim
=
ScimIdentity
.
where
(
user_id:
uid
,
group_id:
g
.
id
)
if
saml
[
0
]
saml_eid
=
saml
[
0
].
extern_uid
output
+=
"%s,"
%
[
email
]
output
+=
"SAML: %s,"
%
[
saml_eid
]
if
scim
[
0
]
scim_eid
=
scim
[
0
].
extern_uid
output
+=
"SCIM: %s"
%
[
scim_eid
]
if
saml_eid
==
scim_eid
output
+=
" Identities matched, not deleted
\n
"
else
scim
[
0
].
destroy
output
+=
" Deleted
\n
"
end
else
output
=
"ERROR No SCIM identify found for: [%s]
\n
"
%
[
email
]
puts
output
return
1
end
else
output
=
"ERROR No SAML identify found for: [%s]
\n
"
%
[
email
]
puts
output
return
1
end
puts
output
return
0
end
# In case of multiple emails
emails
=
[
email1
,
email2
]
emails
.
each
do
|
e
|
delete_bad_scim
(
e
,
'GROUPPATH'
)
end
```
## Routes
### Remove redirecting routes
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment