GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Submit SARIF for failed runs too by henrymercer · Pull Request #1393 · github/codeql-action

Conversation

@henrymercer

@henrymercer henrymercer commented Nov 23, 2022 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

This PR helps us better surface failed code scanning workflow runs by attempting to submit a SARIF file containing executionSuccessful: false in some of these cases. We take special care to ensure that we respect SARIF categories and upload: false options to avoid stale tips. This is made more difficult by the fact that these are only passed to the analyze Action. We want to handle cases where the workflow fails before the analyze step, and we don't have access to these inputs in the post-init step. Therefore we resort to a best-effort attempt at working out what the inputs were based on the workflow file and the variables we do have access to in the post-init step.

We don't to cover every case where the workflow fails here. Cases where the workflow run is cancelled or times out won't be possible to handle — we'd need a different mechanism to notify Code Scanning about these. However this PR will cover many of the cases where workflows fail so we can start providing a better experience.

Merge / deployment checklist

  • Confirm this change is backwards compatible with existing workflows.
  • Confirm the readme has been updated if necessary.
  • Confirm the changelog has been updated if necessary.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@henrymercer
henrymercer force-pushed the henrymercer/report-failed-runs branch from 39c59d2 to 7cef3cf Compare November 25, 2022 16:17
henrymercer added 11 commits November 25, 2022 17:47
@henrymercer
Add diagnostics export command
e233806
@henrymercer
Add a workflow to test reporting a failed run
44ae944
@henrymercer
Log matrix input
9de6c31
@henrymercer
Use a matrix in testing workflow
4d4e250
@henrymercer
Add function for retrieving the "upload" input
3cf2a1b
@henrymercer
Add feature flag for uploading failed SARIF
3afc2b1
@henrymercer
Upload failed SARIF files to Code Scanning
5296a76
@henrymercer
Only upload failed SARIF if the run failed
8337c2b
@henrymercer
Add an integration test for uploading SARIF when the run fails
122b180
@henrymercer
Handle API versions that reject unsuccessful executions
37b4358
@henrymercer
Ensure we finish the log group when waiting for processing
d0517be
@henrymercer
henrymercer force-pushed the henrymercer/report-failed-runs branch from 91edebd to 61ec68f Compare November 25, 2022 18:00
henrymercer added 2 commits November 25, 2022 18:18
@henrymercer
Generate the "Submit SARIF after failure" workflow
24fd4c0
@henrymercer
Add changelog note
7fc3c60
@henrymercer
henrymercer force-pushed the henrymercer/report-failed-runs branch from 61ec68f to 7fc3c60 Compare November 25, 2022 18:18
@henrymercer
henrymercer marked this pull request as ready for review November 25, 2022 18:25
@henrymercer
henrymercer requested a review from a team as a code owner November 25, 2022 18:25
@henrymercer henrymercer mentioned this pull request Nov 28, 2022
Add functionality for parsing Action inputs from a workflow file #1392
Merged
3 tasks done
aeisenberg
aeisenberg reviewed Nov 29, 2022
View reviewed changes

@aeisenberg aeisenberg left a comment

Copy link
Copy Markdown
Contributor

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.

Partial review only.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread CHANGELOG.md Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread pr-checks/checks/submit-sarif-failure.yml Resolved

Uh oh!

There was an error while loading. Please reload this page.

aeisenberg
aeisenberg reviewed Nov 29, 2022
View reviewed changes
Comment thread src/feature-flags.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/init-action-post-helper.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/workflow.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

henrymercer added 5 commits November 29, 2022 16:25
@henrymercer
Push unsuccessful execution API error detection into upload library
e628ee0
@henrymercer
Always wait for processing when uploading a failed SARIF file
00a3c45
@henrymercer
Explicitly mention surrounding by try/catch in JSDoc
e0dec83
@henrymercer
Add unit test for typical workflow
58b2ab0
@henrymercer
Merge branch 'henrymercer/parse-category' into henrymercer/report-fai…
6c5cad7
…led-runs
aeisenberg
aeisenberg reviewed Nov 29, 2022
View reviewed changes
Comment thread src/init-action-post-helper.test.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/upload-lib.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/upload-lib.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

henrymercer added 2 commits November 30, 2022 11:27
@henrymercer
Improve error message when failed SARIF file doesn't process as expected
3d90c4f
@henrymercer
Add testing environment to submit SARIF after failure PR check
77cda4d
Base automatically changed from henrymercer/parse-category to main December 1, 2022 18:26
@henrymercer
Merge branch 'main' into henrymercer/report-failed-runs
98b2ddc
@henrymercer
henrymercer requested a review from aeisenberg December 1, 2022 20:43
aeisenberg
aeisenberg reviewed Dec 1, 2022
View reviewed changes
Comment thread src/upload-lib.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

henrymercer added 2 commits December 2, 2022 14:31
@henrymercer
Merge branch 'main' into henrymercer/report-failed-runs
e0ff272
@henrymercer
Only print the full error message in debug mode
375daca
@henrymercer
henrymercer requested a review from aeisenberg December 2, 2022 14:39
aeisenberg
aeisenberg approved these changes Dec 2, 2022
View reviewed changes

@aeisenberg aeisenberg left a comment

Copy link
Copy Markdown
Contributor

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.

Nice!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@henrymercer
henrymercer merged commit 4acf201 into main Dec 2, 2022
@henrymercer
henrymercer deleted the henrymercer/report-failed-runs branch December 2, 2022 17:08
This was referenced Dec 8, 2022
Merge main into releases/v2 #1428
Merged
Merge releases/v2 into releases/v1 #1430
Merged
@henrymercer henrymercer mentioned this pull request Dec 9, 2022
Add telemetry for uploading failed runs #1432
Merged
3 tasks done
This was referenced Apr 25, 2023
[Snyk] Fix for 44 vulnerabilities aliscco/codeql-action#144
Open
[Snyk] Fix for 44 vulnerabilities aliscco/codeql-action#265
Open
[Snyk] Fix for 22 vulnerabilities aliscco/codeql-action#288
Open
[Snyk] Fix for 44 vulnerabilities aliscco/codeql-action#375
Open
@aliscco aliscco mentioned this pull request Jun 25, 2023
[Snyk] Security upgrade browserify from 4.2.3 to 12.0.0 aliscco/codeql-action#729
Open
@aliscco aliscco mentioned this pull request Jul 4, 2023
[Snyk] Security upgrade browserify from 9.0.3 to 12.0.0 aliscco/codeql-action#783
Open
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@aeisenberg aeisenberg aeisenberg approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@henrymercer @aeisenberg
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.