Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to JiHu GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Chenhao Ma
core
Commits
72bd5e40
Commit
72bd5e40
authored
7 years ago
by
Megan Henning
Browse files
Options
Downloads
Patches
Plain Diff
Handle files with type of None
parent
ca6b0a8e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
api/jobs/rules.py
+7
-5
7 additions, 5 deletions
api/jobs/rules.py
with
7 additions
and
5 deletions
api/jobs/rules.py
+
7
−
5
View file @
72bd5e40
...
...
@@ -67,10 +67,11 @@ def eval_match(match_type, match_param, file_, container):
# Match the file's type
if
match_type
==
'
file.type
'
:
try
:
return
file_
[
'
type
'
].
lower
()
==
match_param
.
lower
()
except
KeyError
:
_log_file_key_error
(
file_
,
container
,
'
has no type key
'
)
file_type
=
file_
.
get
(
'
type
'
)
if
file_type
:
return
file_type
.
lower
()
==
match_param
.
lower
()
else
:
_log_file_key_error
(
file_
,
container
,
'
has no type
'
)
return
False
# Match a shell glob for the file name
...
...
@@ -91,7 +92,8 @@ def eval_match(match_type, match_param, file_, container):
# Match the container having any file (including this one) with this type
elif
match_type
==
'
container.has-type
'
:
for
c_file
in
container
[
'
files
'
]:
if
match_param
.
lower
()
==
c_file
.
get
(
'
type
'
).
lower
():
c_file_type
=
c_file
.
get
(
'
type
'
)
if
c_file_type
and
match_param
.
lower
()
==
c_file_type
.
lower
()
return
True
return
False
...
...
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