Skip to content
This repository has been archived by the owner on Nov 11, 2019. It is now read-only.

Add an option to disable zero coverage analyzer #2115

Merged
merged 3 commits into from
May 20, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
staticanalysis/bot: Add an option to disable zero coverage analyzer, f…
…ixes #2109.
  • Loading branch information
Bastien Abadie committed May 20, 2019
commit 2bce8b9d1ba519bcd7f25aab22de8dbfacc384e4
3 changes: 2 additions & 1 deletion src/staticanalysis/bot/static_analysis_bot/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ def main(taskcluster_secret,
'APP_CHANNEL': 'development',
'REPORTERS': [],
'PUBLICATION': 'IN_PATCH',
'ZERO_COVERAGE_ENABLED': True,
'ALLOWED_PATHS': ['*', ],
},
taskcluster_client_id=taskcluster_client_id,
Expand Down Expand Up @@ -106,7 +107,7 @@ def main(taskcluster_secret,
)

# Run workflow according to source
w = Workflow(reporters, index_service, queue_service, phabricator_api)
w = Workflow(reporters, index_service, queue_service, phabricator_api, secrets['ZERO_COVERAGE_ENABLED'])
try:
w.run(revision)
except Exception as e:
Expand Down
6 changes: 4 additions & 2 deletions src/staticanalysis/bot/static_analysis_bot/workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,12 @@ class Workflow(object):
- find issues from remote tasks
- publish issues
'''
def __init__(self, reporters, index_service, queue_service, phabricator_api):
def __init__(self, reporters, index_service, queue_service, phabricator_api, zero_coverage_enabled=True):
assert settings.try_task_id is not None, \
'Cannot run without Try task id'
assert settings.try_group_id is not None, \
'Cannot run without Try task id'
self.zero_coverage_enabled = zero_coverage_enabled

# Use share phabricator API client
assert isinstance(phabricator_api, PhabricatorAPI)
Expand Down Expand Up @@ -213,7 +214,8 @@ def _in_group(dep_id):
return []

# Add zero-coverage task
dependencies.append(ZeroCoverageTask)
if self.zero_coverage_enabled:
dependencies.append(ZeroCoverageTask)

# Find issues and patches in dependencies
issues = []
Expand Down