-
Notifications
You must be signed in to change notification settings - Fork 348
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Send init-post
status report in absence of config
#2751
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah...got it. I only reviewed the changed bits, so I missed what's happening later. LGTM.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the find!!
} else { | ||
uploadFailedSarifResult = await initActionPostHelper.run( | ||
debugArtifacts.tryUploadAllAvailableDebugArtifacts, | ||
printDebugLogs, | ||
config, | ||
repositoryNwo, | ||
features, | ||
logger, | ||
); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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-post
Action 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