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 — Add an option to allow waiting until an analysis has been processed before finishing the Action. by chrisgavin · Pull Request #781 · github/codeql-action

Conversation

@chrisgavin

@chrisgavin chrisgavin commented Oct 18, 2021

Copy link
Copy Markdown
Contributor

This adds an option to allow waiting until the analysis has succeeded before continuing. This will be used to allow surfacing errors that have occurred while processing the uploaded SARIF file.

When this option is enabled, after uploading the SARIF file the Action will call the status endpoint every 5 seconds until the processing is complete. After 2 minutes, it will give up and continue anyway. I felt that there should be a timeout in case there is some issue with processing and that it shouldn't fail the Action since it's possible the analysis will eventually be processed.

I've not added the option to enable this behavior to the readme, as our hope is to test this out a bit and eventually make it the default at which point we'll remove the option.

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
@chrisgavin
chrisgavin force-pushed the wait-for-processing branch 3 times, most recently from dd9d5e4 to d423c8d Compare October 18, 2021 13:40
aeisenberg
aeisenberg reviewed Oct 18, 2021
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.

Looks reasonable to me.

Sorry, something went wrong.

Uh oh!

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

All reactions
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.

cannist
cannist reviewed Oct 25, 2021
View reviewed changes

@cannist cannist 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.

I wonder if we should decouple the check from the actual upload. If we did that we could, for example, upload the codeql database in the analyze action before we start checking the status.

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread analyze/action.yml 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.

@chrisgavin
chrisgavin force-pushed the wait-for-processing branch from d423c8d to 218d7f0 Compare October 26, 2021 09:15
chrisgavin and others added 3 commits November 17, 2021 12:14
@chrisgavin
Add an option to allow waiting until an analysis has been processed b…
316ad9d
…efore finishing the Action.
@chrisgavin @aeisenberg
Improve a log message.
21a786f
Co-authored-by: Andrew Eisenberg <[email protected]>
@chrisgavin @aeisenberg
Reduce log message level.
49fc4c9
Co-authored-by: Andrew Eisenberg <[email protected]>
@chrisgavin
chrisgavin force-pushed the wait-for-processing branch 3 times, most recently from 9688a32 to a2b0a22 Compare November 17, 2021 12:30
chrisgavin added 2 commits November 17, 2021 12:33
@chrisgavin
Add a default value for wait-for-processing.
823bb21
@chrisgavin
Check for errors in the analysis status response.
e0b9b9a
@chrisgavin
chrisgavin force-pushed the wait-for-processing branch from a2b0a22 to e0b9b9a Compare November 17, 2021 12:33
@chrisgavin
chrisgavin marked this pull request as ready for review November 17, 2021 13:02
@chrisgavin
chrisgavin requested a review from a team as a code owner November 17, 2021 13:02
@chrisgavin
Split out waiting for processing.
4eef7ef
cannist
cannist reviewed Nov 17, 2021
View reviewed changes

@cannist cannist 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.

LGTM, just some minor details.

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread analyze/action.yml
default: "true"
wait-for-processing:
description: If true, the Action will wait for the uploaded SARIF to be processed before completing.
required: true

@cannist cannist Nov 17, 2021

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.

Should this be false since we're providing a default value?

Sorry, something went wrong.

Uh oh!

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

All reactions

@chrisgavin chrisgavin Nov 17, 2021

Copy link
Copy Markdown
Contributor Author

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 believe it being required means it cannot be null, which it won't be if we're providing a default.

Sorry, something went wrong.

Uh oh!

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

All reactions

@cannist cannist Nov 17, 2021

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.

Hmm, I always understood required here as "must be specified by the user". If it does not matter if we use true or false in the presence of a default, I think false still is less confusing to the reader.
That would also be in line with the example given in the docs.

Sorry, something went wrong.

Uh oh!

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

All reactions

@chrisgavin chrisgavin Nov 17, 2021

Copy link
Copy Markdown
Contributor Author

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.

There are also other docs that show the opposite pattern; a required argument with a default value.

I tried in a test repository, and it seems like Actions doesn't really care about whether the value is "required" or not. Possibly it's a planned future feature, but without knowing how it will interpret the property it's hard to say if one way is any better than the other.

Sorry, something went wrong.

Uh oh!

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

All reactions

@cannist cannist Nov 18, 2021

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.

OK, it is your PR. 🙂
I still prefer the other value but if actions do not fall over if the parameter is left unspecified by the user I do not mind too much.

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread upload-sarif/action.yml 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.

chrisgavin added 2 commits November 17, 2021 15:51
@chrisgavin
Move the delay to the end of the loop.
215c4f5
@chrisgavin
Add a clarifying comment to a break.
b9bd459
aeisenberg
aeisenberg approved these changes Nov 17, 2021
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.

Looks reasonable to me, but maybe @cannist should have a look, too.

Sorry, something went wrong.

Uh oh!

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

All reactions
cannist
cannist approved these changes Nov 18, 2021
View reviewed changes
@chrisgavin
chrisgavin merged commit 3e36cdd into main Nov 18, 2021
@chrisgavin
chrisgavin deleted the wait-for-processing branch November 18, 2021 12:02
This was referenced Nov 22, 2021
Merge main into v1 #826
Closed
Merge main into v1 #828
Merged
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
@cannist cannist cannist 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.

3 participants

@chrisgavin @aeisenberg @cannist
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.