This PR adds a small fix to detect lineEnd=0 and replace it with the lineStart so that annotations properly show up on PRs.
Error Handling Improvements:
src/pr-gating/CIGate.ps1: Added a retry mechanism to the process of fetching alerts from the target branch. This ensures that if the CodeQL scanning of the target branch (which runs in a separate task) is not yet complete, the script will attempt to fetch the results up to 10 times with a 1-minute wait between each try. If the maximum number of retries is reached or an unexpected error occurs, an error message is logged and the exception is thrown.
The GHAzDO alerts APIs can return back a
lineEnd
of 0 when the finding occurs on a single line:This PR adds a small fix to detect lineEnd=0 and replace it with the lineStart so that annotations properly show up on PRs.
Error Handling Improvements:
src/pr-gating/CIGate.ps1
: Added a retry mechanism to the process of fetching alerts from the target branch. This ensures that if the CodeQL scanning of the target branch (which runs in a separate task) is not yet complete, the script will attempt to fetch the results up to 10 times with a 1-minute wait between each try. If the maximum number of retries is reached or an unexpected error occurs, an error message is logged and the exception is thrown.