Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Gepetto
dashboard
Commits
b6dd0c69
Commit
b6dd0c69
authored
Feb 26, 2020
by
Guilhem Saurel
Browse files
some projects are not available on gitlab
parent
035f6cad
Pipeline
#8507
passed with stage
in 1 minute and 6 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
gh/views.py
View file @
b6dd0c69
...
...
@@ -98,6 +98,10 @@ def push(request: HttpRequest, rep: str) -> HttpResponse:
else
:
git_repo
.
create_head
(
ref_s
,
commit
=
data
[
'after'
])
if
gl_remote_s
not
in
git_repo
.
remotes
:
print
(
f
'project
{
project
}
not available on
{
gl_remote_s
}
'
)
return
HttpResponse
(
rep
)
gl_remote
=
git_repo
.
remotes
[
gl_remote_s
]
gl_remote
.
fetch
()
if
ref_s
not
in
gl_remote
.
refs
or
str
(
gl_remote
.
refs
[
ref_s
].
commit
)
!=
data
[
'after'
]:
...
...
@@ -114,8 +118,8 @@ def pipeline(request: HttpRequest, rep: str) -> HttpResponse:
namespace
=
get_object_or_404
(
Namespace
,
slug
=
slugify
(
data
[
'project'
][
'namespace'
]))
project
=
get_object_or_404
(
Project
,
main_namespace
=
namespace
,
slug
=
slugify
(
data
[
'project'
][
'name'
]))
branch
,
commit
,
status
=
(
data
[
'object_attributes'
][
key
]
for
key
in
[
'ref'
,
'sha'
,
'status'
])
print
(
namespace
,
project
,
branch
,
commit
)
p
print
(
data
)
# status in ['pending', 'running', 'success', 'failed']
print
(
namespace
,
project
,
branch
,
commit
,
status
)
return
HttpResponse
(
rep
)
...
...
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