feat(logging): Bug 2039779 Copy chain_of_trust.log to live_backing.log on CoT verification failure#796
feat(logging): Bug 2039779 Copy chain_of_trust.log to live_backing.log on CoT verification failure#796hneiva wants to merge 1 commit into
Conversation
| # Surface CoT verification output in live_backing.log so Taskcluster/Treeherder show it | ||
| cot_log = get_chain_of_trust_log_filename(context) | ||
| if os.path.exists(cot_log): | ||
| shutil.copyfile(cot_log, get_log_filename(context)) |
There was a problem hiding this comment.
Instead of copying the file we can create a link or redirect artifact?
There was a problem hiding this comment.
What does redirecting the artifact mean? Just moving instead of copying? Do we know for a fact that there's nothing externally pointing to chain_of_trust.log?
What is the benefit of either vs just copying the file?
There was a problem hiding this comment.
https://docs.taskcluster.net/docs/reference/platform/queue/api#createArtifact describes link and redirect artifacts. The benefit is to make it obvious that they're the same artifact, just like on generic-worker live.log redirects to live_backing.log.
| await run_cancellable(verify_chain_of_trust(chain)) | ||
| try: | ||
| await run_cancellable(verify_chain_of_trust(chain)) | ||
| except Exception: |
There was a problem hiding this comment.
That would make it skip unforeseeable exceptions, which we don't want.
scriptworker/src/scriptworker/cot/verify.py
Lines 2053 to 2074 in 0ae448c
This block in
verify_chain_of_trust() only captures a set of expected exceptions, but doesn't capture json, OS, Value or aiohttp errors.
…g on CoT verification failure When verify_chain_of_trust fails, run_task never runs and live_backing.log is never created. Taskcluster/Treeherder surface live_backing.log as the task's failure log, so users could not see why CoT verification failed. Link chain_of_trust.log to live_backing.log on verification failure so the verification output is visible to users.
When verify_chain_of_trust fails, run_task never runs and live_backing.log is never created. Treeherder parses live_backing.log as the task's failure log, so users could not see why CoT verification failed.
Copy chain_of_trust.log to live_backing.log on verification failure so the verification output is visible from TH.