Merge ~rodrigo-zaiden/ubuntu-security-tools:fix-uaudit-coverity-report into ubuntu-security-tools:master

Proposed by Rodrigo Figueiredo Zaiden
Status: Merged
Merged at revision: 2e52337a30bdd4a8e1562a2015a0f227a8101d43
Proposed branch: ~rodrigo-zaiden/ubuntu-security-tools:fix-uaudit-coverity-report
Merge into: ubuntu-security-tools:master
Diff against target: 17 lines (+4/-0)
1 file modified
audits/uaudit (+4/-0)
Reviewer Review Type Date Requested Status
Steve Beattie Approve
Alex Murray Pending
Review via email: mp+424800@code.launchpad.net

Commit message

uaudit: add coverity defects in summary

 Static analysis results summary in JIRA.md has the coverity
 count number of defects missing, re-adding.
 In case coverity is not used, modify the text to say that.

Description of the change

in current scenario, the result summary for coverity in JIRA.md is as:

  ## Static analysis results summary
  - $coverity coverity defects
  - 37 warnings from bandit
  - 0 brakeman defects

I think this is because the details for coverity are not being added.
When coverity is not used, I'm suggesting to change the '$coverity' text to be 'Skip check for', resulting in "Skip check for coverity defects"
Maybe, and possible, there are better ways to make this change, if so, please let me know so I can update the merge.

Thanks again!

To post a comment you must log in.
Revision history for this message
Steve Beattie (sbeattie) wrote :

LGTM and works correctly in local testing, thanks!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/audits/uaudit b/audits/uaudit
2index 3cc87dd..75e9594 100755
3--- a/audits/uaudit
4+++ b/audits/uaudit
5@@ -1131,8 +1131,12 @@ if __name__ == "__main__":
6 replacements = ['version', 'release']
7 for tool in static_analysis_tools:
8 replacements.append(tool.name)
9+ if not opt.disable_coverity:
10+ replacements.append("coverity")
11 for key in replacements:
12 s = s.replace('$' + key, details[key])
13+ if opt.disable_coverity:
14+ s = s.replace("$coverity", "Skip check for")
15 f = open(txt, 'w')
16 f.write(s)
17 f.close()

Subscribers

People subscribed via source and target branches