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 — Gracefully continue if `createStatusReportBase` throws by angelapwen · Pull Request #2225 · github/codeql-action

Conversation

@angelapwen

@angelapwen angelapwen commented Apr 4, 2024 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor

Previously, we weren't catching any possible exceptions in createStatusReportBase and runs would fail if any of the telemetry sub-items threw exceptions. As telemetry should not block the analysis, we continue here even if the status report throws.

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
@angelapwen
angelapwen force-pushed the angelapwen/audit-status-report-exceptions branch from 788a476 to 17bf96c Compare April 4, 2024 21:09
@angelapwen
Gracefully continue if createStatusReportBase throws
9e8cae9
Previously, we weren't catching any possible exceptions in `createStatusReportBase` and runs would fail if any of the telemetry sub-items threw exceptions. As telemetry should not block the analysis, we continue here even if the status report throws.
@angelapwen
angelapwen force-pushed the angelapwen/audit-status-report-exceptions branch from 17bf96c to 9e8cae9 Compare April 4, 2024 21:12
@angelapwen
angelapwen marked this pull request as ready for review April 4, 2024 21:25
@angelapwen
angelapwen requested a review from a team as a code owner April 4, 2024 21:25
aeisenberg
aeisenberg approved these changes Apr 4, 2024
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. A few comments inline. If the answer to my question is "no", then this can go in as-is.

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread src/analyze-action.ts
await statusReport.sendStatusReport(trapCacheUploadStatusReport);
} else {
await statusReport.sendStatusReport(report);
if (config && didUploadTrapCaches) {

@aeisenberg aeisenberg Apr 4, 2024

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.

Do we ever reasonably expect config to be falsy, but didUploadTrapCaches to be true? If so, we might want to still upload in that case:

Suggested change
if (config && didUploadTrapCaches) {
if (didUploadTrapCaches) {

And the change below. But only if this is not already an error state.

Sorry, something went wrong.

Uh oh!

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

All reactions

@angelapwen angelapwen Apr 4, 2024

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 don't think so — if config is undefined, we should be erroring out much earlier:

codeql-action/src/analyze-action.ts

Line 205 in f421cda

if (config === undefined) {
.

Sorry, something went wrong.

Uh oh!

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

aeisenberg reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
Comment thread src/analyze-action.ts
...report,
trap_cache_upload_duration_ms: Math.round(trapCacheUploadTime || 0),
trap_cache_upload_size_bytes: Math.round(
await getTotalCacheSize(config.trapCaches, logger),

@aeisenberg aeisenberg Apr 4, 2024

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.

Only if also adding above.

Suggested change
await getTotalCacheSize(config.trapCaches, logger),
await getTotalCacheSize(config?.trapCaches || {}, logger),

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread src/status-report.ts
status === "success" ||
status === "failure" ||
status === "aborted" ||
status === "user-error"

@aeisenberg aeisenberg Apr 4, 2024

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 change to configuration-error? (Not in this PR)

Sorry, something went wrong.

Uh oh!

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

All reactions

@angelapwen angelapwen Apr 4, 2024

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.

We could: the configuration-error was codified in the overall job status (rather than status for each action, which is what this is). It would be nice to have them use the same syntax. But we would want to make sure that everyone consuming the data are aware about the transition, because we likely have existing monitors/queries/dashboards using user-error. I can write up an internal issue for this.

Sorry, something went wrong.

Uh oh!

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

All reactions

@aeisenberg aeisenberg Apr 4, 2024

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.

Sure. I'd say it's low priority since it's just changing a name.

Sorry, something went wrong.

Uh oh!

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

angelapwen reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
aeisenberg
aeisenberg approved these changes Apr 4, 2024
View reviewed changes
@angelapwen
angelapwen merged commit 7df281f into main Apr 4, 2024
@angelapwen
angelapwen deleted the angelapwen/audit-status-report-exceptions branch April 4, 2024 22:26
This was referenced Apr 5, 2024
Merge main into releases/v3 #2226
Merged
Merge releases/v3 into releases/v2 #2228
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

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

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