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 — Use `github merge-results` command for merging SARIF files by koesie10 · Pull Request #2199 · github/codeql-action

Conversation

@koesie10

@koesie10 koesie10 commented Mar 15, 2024

Copy link
Copy Markdown
Member

This will use the github merge-results command when the cli_sarif_merge_enabled feature flag is enabled and all SARIF files were produced by CodeQL.

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
@koesie10
koesie10 force-pushed the koesie10/cli-sarif-merge branch from a924694 to 66fcc6a Compare March 18, 2024 13:19
@koesie10
koesie10 marked this pull request as ready for review March 20, 2024 14:21
@koesie10
koesie10 requested a review from a team as a code owner March 20, 2024 14:21
aeisenberg
aeisenberg reviewed Mar 20, 2024
View reviewed changes
Comment thread src/feature-flags.ts Resolved

Uh oh!

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

koesie10 added 5 commits March 22, 2024 14:14
@koesie10
Create feature flag for merging SARIF files using the CLI
a12b868
@koesie10
Use github merge-results command when feature flag is enabled
ccc609b
@koesie10
Use subdirectory for combined SARIF file
7e30c62
@koesie10
Upload debug artifacts for upload-sarif
2bbafcd
@koesie10
Use supportsFeature check for merging SARIF files
e20c273
@koesie10
koesie10 force-pushed the koesie10/cli-sarif-merge branch from 89a77d5 to e20c273 Compare March 22, 2024 13:15
henrymercer
henrymercer reviewed Mar 22, 2024
View reviewed changes

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

This looks generally great. Some initial comments:

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread src/codeql.ts Resolved

Uh oh!

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

Comment thread src/codeql.ts Resolved

Uh oh!

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

Comment thread src/feature-flags.ts
Comment on lines +64 to +65
// This is guarded by a `supportsFeature` check rather than by a version check.
minimumVersion: undefined,

@henrymercer henrymercer Mar 22, 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.

Going forwards, this will probably be the common case as we're preferring checking CLI features to checking version numbers. We should consider adding a toolVersion field to this record so callees can just check the feature.

Sorry, something went wrong.

Uh oh!

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

All reactions

@koesie10 koesie10 Mar 25, 2024

Copy link
Copy Markdown
Member 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.

Are you suggesting that I add a toolsFeature field to this object in this PR?

Sorry, something went wrong.

Uh oh!

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

All reactions

@henrymercer henrymercer Mar 25, 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.

I'm happy if you'd rather do this in a separate PR, but I think if we rely on checking manually we'll probably make a mistake soon enough.

Sorry, something went wrong.

Uh oh!

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

All reactions

@koesie10 koesie10 Mar 25, 2024

Copy link
Copy Markdown
Member 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'm not sure if it makes sense for this specific feature flag though since we usually do not have a CodeQL object available in the upload-sarif action, so we wouldn't be able to check the toolsFeature anyway. We probably also don't want to let the future deprecation behavior depend on which version of CodeQL is being used since the deprecation will happen in the Code Scanning API rather than in CodeQL.

Sorry, something went wrong.

Uh oh!

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

All reactions

@henrymercer henrymercer Mar 25, 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.

I'm not sure if it makes sense for this specific feature flag though since we usually do not have a CodeQL object available in the upload-sarif action, so we wouldn't be able to check the toolsFeature anyway.

That makes sense — if the feature flag is disabled via the API, there's no point downloading CodeQL.

We probably also don't want to let the future deprecation behavior depend on which version of CodeQL is being used since the deprecation will happen in the Code Scanning API rather than in CodeQL.

I think we'd probably want to time the deprecation such that the CLIs that can't merge SARIF runs are no longer supported by the time we deprecate the API.

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.

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.

Comment thread src/upload-sarif-action-post-helper.ts Resolved

Uh oh!

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

koesie10 added 6 commits March 25, 2024 10:13
@koesie10
Use options object instead of boolean for mergeResults
6ac5753
@koesie10
Use runTool for mergeResults
70aa50b
@koesie10
Introduce areAllRunsProducedByCodeQL function
3bd271c
@koesie10
Do not try merging a single SARIF file
a0a63a2
@koesie10
Change log levels
3c4b8bc
@koesie10
Only upload combined SARIF files when env var is set
82b82e5
henrymercer
henrymercer reviewed Mar 25, 2024
View reviewed changes

@henrymercer henrymercer 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 good to me — just a couple of final comments.

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread src/upload-sarif-action-post-helper.ts Resolved

Uh oh!

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

Comment thread src/analyze-action-post.ts Resolved

Uh oh!

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

Comment thread src/codeql.ts
Comment on lines +53 to +56
github?: {
"*"?: Options;
"merge-results"?: Options;
};

@henrymercer henrymercer Mar 25, 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.

Not for you to fix, but I don't think this addition does anything.

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.

@ramshad-sha ramshad-sha mentioned this pull request Mar 25, 2024
Update default bundle to 2.16.6 #2212
Closed
koesie10 added 3 commits March 26, 2024 11:05
@koesie10
Do not require debug mode for debugging uploads
58194bf
@koesie10
Rename run to uploadArtifacts
f835435
@koesie10
Refactor areAllRunsProducedByCodeQL to use Array.every
016720d
henrymercer
henrymercer approved these changes Mar 26, 2024
View reviewed changes

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

Great, thanks!

Sorry, something went wrong.

Uh oh!

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

All reactions
@koesie10
koesie10 merged commit 84ba7fb into main Mar 27, 2024
@koesie10
koesie10 deleted the koesie10/cli-sarif-merge branch March 27, 2024 13:39
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 left review comments
@henrymercer henrymercer henrymercer 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

@koesie10 @aeisenberg @henrymercer
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.