Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
gitlab-deps
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pipelines
tools
gitlab-deps
Commits
669e2c79
Commit
669e2c79
authored
4 years ago
by
ale
Browse files
Options
Downloads
Patches
Plain Diff
Catch errors when listing branches
For projects that do not have an associated repository.
parent
7b79c9d1
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
gitlab_deps/deps.py
+9
-1
9 additions, 1 deletion
gitlab_deps/deps.py
with
9 additions
and
1 deletion
gitlab_deps/deps.py
+
9
−
1
View file @
669e2c79
import
logging
import
re
...
...
@@ -18,6 +19,7 @@ def list_projects(gl, search_pattern):
search_namespaces
=
True
,
as_list
=
False
,
simple
=
True
,
archived
=
False
,
)
for
p
in
projects
:
yield
p
.
path_with_namespace
...
...
@@ -26,7 +28,13 @@ def list_projects(gl, search_pattern):
def
get_branches
(
gl
,
project_names
):
for
path_with_namespace
in
project_names
:
p
=
gl
.
projects
.
get
(
path_with_namespace
)
for
b
in
p
.
branches
.
list
():
try
:
branches
=
p
.
branches
.
list
()
except
Exception
as
e
:
logging
.
error
(
'
error getting branches for %s: %s
'
,
path_with_namespace
,
e
)
continue
for
b
in
branches
:
yield
(
path_with_namespace
,
b
.
name
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment