Send init-post status report in absence of config#2751
Conversation
There was a problem hiding this comment.
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
Tip: Copilot only keeps its highest confidence comments to reduce noise and keep you focused. Learn more
| } else { | ||
| uploadFailedSarifResult = await initActionPostHelper.run( | ||
| debugArtifacts.tryUploadAllAvailableDebugArtifacts, | ||
| printDebugLogs, | ||
| config, | ||
| repositoryNwo, | ||
| features, | ||
| logger, | ||
| ); | ||
| } |
There was a problem hiding this comment.
Is this correct? I think this still doesn't send a status report if there's no config. Would this work?
| } else { | |
| uploadFailedSarifResult = await initActionPostHelper.run( | |
| debugArtifacts.tryUploadAllAvailableDebugArtifacts, | |
| printDebugLogs, | |
| config, | |
| repositoryNwo, | |
| features, | |
| logger, | |
| ); | |
| } | |
| } | |
| uploadFailedSarifResult = await initActionPostHelper.run( | |
| debugArtifacts.tryUploadAllAvailableDebugArtifacts, | |
| printDebugLogs, | |
| config, | |
| repositoryNwo, | |
| features, | |
| logger, | |
| ); |
There was a problem hiding this comment.
I think it's correct — the status report is sent later on in the file, but the original code was returning early so it was never sent.
The suggested change won't work because config is required to upload debug artifacts 😄
There was a problem hiding this comment.
The return is the problem. We won't be able to upload a failed SARIF file if we don't have a config, because we need CodeQL to do that. But we should still upload a status report, and the status report code comes at the end of the runWrapper function.
There was a problem hiding this comment.
Ah...got it. I only reviewed the changed bits, so I missed what's happening later. LGTM.
angelapwen
left a comment
There was a problem hiding this comment.
Thanks for the find!!
| } else { | ||
| uploadFailedSarifResult = await initActionPostHelper.run( | ||
| debugArtifacts.tryUploadAllAvailableDebugArtifacts, | ||
| printDebugLogs, | ||
| config, | ||
| repositoryNwo, | ||
| features, | ||
| logger, | ||
| ); | ||
| } |
There was a problem hiding this comment.
Ah...got it. I only reviewed the changed bits, so I missed what's happening later. LGTM.
This PR fixes a bug in the
init-postAction where we would not send a status report if the configuration was not available. This resulted in limited telemetry in cases where CodeQL was not initialized, for example if it could not be downloaded.Merge / deployment checklist