Skip to content

Commit

Permalink
Never log exception/error verbatim into telemetry (#403)
Browse files Browse the repository at this point in the history
* Never log exception/error verbatim into telemetry

* Update version

* Update version

* Disable Bandit task until its results export correctly into the gardian repository

* Disable Bandit task until its results export correctly into the gardian repository
  • Loading branch information
marianan authored Nov 2, 2022
1 parent 49793e3 commit 4188872
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 23 deletions.
2 changes: 1 addition & 1 deletion iotedgehubdev/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
pkg_resources.declare_namespace(__name__)

__author__ = 'Microsoft Corporation'
__version__ = '0.14.15'
__version__ = '0.14.17'
__AIkey__ = '95b20d64-f54f-4de3-8ad5-165a75a6c6fe'
__production__ = 'iotedgehubdev'
2 changes: 1 addition & 1 deletion iotedgehubdev/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def _parse_params(*args, **kwargs):

def _send_failed_telemetry(e):
output.error(str(e))
telemetry.fail(str(e), 'Command failed')
telemetry.fail('Command failed')
telemetry.flush()


Expand Down
7 changes: 1 addition & 6 deletions iotedgehubdev/telemetry.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ def __init__(self, correlation_id=None):
self.parameters = []
self.result = 'None'
self.result_summary = None
self.exception = None
self.extra_props = {}
self.machineId = self._get_hash_mac_address()
self.events = defaultdict(list)
Expand All @@ -52,9 +51,6 @@ def generate_payload(self):
if self.result_summary:
props['ResultSummary'] = self.result_summary

if self.exception:
props['Exception'] = self.exception

props.update(self.extra_props)

self.events[_get_AI_key()].append({
Expand Down Expand Up @@ -105,8 +101,7 @@ def success():


@decorators.suppress_all_exceptions()
def fail(exception, summary):
_session.exception = exception
def fail(summary):
_session.result = 'Fail'
_session.result_summary = summary

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"""
from setuptools import find_packages, setup

VERSION = '0.14.15'
VERSION = '0.14.17'
# If we have source, validate that our version numbers match
# This should prevent uploading releases with mismatched versions.
try:
Expand Down
28 changes: 14 additions & 14 deletions vsts_ci/azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,20 +82,20 @@ jobs:
- template: linux/continuous-build-linux.yml


- job: ScanForVulnerabilities
pool:
vmImage: windows-latest
steps:
- task: Bandit@1
inputs:
targetsType: 'banditPattern'
targetsBandit: '$(Build.SourcesDirectory)'
targetsBanditRecursive: true
ruleset: 'guardian'
verbose: true
aggregate: 'file'
- script: |
for /f %%a IN ('dir /b /s "D:\a\1\.gdn\r\*"') DO cat %%a
# - job: ScanForVulnerabilities
# pool:
# vmImage: windows-latest
# steps:
# - task: Bandit@1
# inputs:
# targetsType: 'banditPattern'
# targetsBandit: '$(Build.SourcesDirectory)'
# targetsBanditRecursive: true
# ruleset: 'guardian'
# verbose: true
# aggregate: 'file'
# - script: |
# for /f %%a IN ('dir /b /s "D:\a\1\.gdn\r\*"') DO cat %%a

- job: LegalStatusPolicyCheck
pool:
Expand Down

0 comments on commit 4188872

Please sign in to comment.