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 — Change category uniqueness test by aeisenberg · Pull Request #872 · github/codeql-action

Conversation

@aeisenberg

@aeisenberg aeisenberg commented Jan 12, 2022 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor

Turboscan only allows a single combination of tool name and automation
details id for testing category uniqueness.

Previously, the check in the action was not entirely correct since it
only looked at the category and not the combination of the category
and the tool name.

It's even more precise now since it is looking at the actual, computed
value of the automation details id, rather than an inputted value of
the category.

This change also includes a refactoring where the action is now avoiding
multiple parsing/stringifying of the sarif files. Instead, sarif is
parsed once at the start of the process and stringified once, after
sarif processing is completely finished.

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
@aeisenberg
Change category uniqueness test
8454e21
Turboscan only allows a single combination of tool name and automation
details id for testing category uniqueness.

Previously, the check in the action was not entirely correct since it
only looked at the _category_ and not the combination of the category
and the tool name.

It's even more precise now since it is looking at the actual, computed
value of the automation details id, rather than an inputted value of
the category.

This change also includes a refactoring where the action is now avoiding
multiple parsing/stringifying of the sarif files. Instead, sarif is
parsed once at the start of the process and stringified once, after
sarif processing is completely finished.
@aeisenberg
aeisenberg requested review from robertbrignull and starcke January 12, 2022 23:27
@aeisenberg
aeisenberg requested a review from a team as a code owner January 12, 2022 23:27
@aeisenberg

aeisenberg commented Jan 12, 2022

Copy link
Copy Markdown
Contributor Author

Interesting...quite a few failing tests, but all of these are legitimately trying to upload multiple times with the same tool/automation id. Here are the failing jobs and they are all failing since they are merging runs from multiple files into a single sarif.

  • __test-local-codeql.yml
  • __unset-environment.yml
  • __multi-language-autodetect.yml

I understand why this is happening, but I'm not sure if this is the best behaviour.

The default automation details id and tool are the same for all runs in a single job. So, we can't enforce uniqueness on them. However, since these really are analyses different languages, they really should have distinct categories. I guess it's too late now to change this without breaking existing users.

I think I need to change things so that identical automation ids/tools in different runs of the same sarif are tolerated.

All reactions

Sorry, something went wrong.

Uh oh!

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

@starcke

starcke commented Jan 13, 2022

Copy link
Copy Markdown

I dont think I a lot of knowledge about the action - so I have assigned @Daverlo instead as he did the initial category work here. Happy to sync more generally on the behavior. But since https://github.com/github/code-scanning/issues/1555#issuecomment-843367976 (which was after the initial category work) I think you might have more information on the wanted direction than me :)

All reactions

Sorry, something went wrong.

Uh oh!

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

@starcke
starcke requested review from Daverlo and removed request for starcke January 13, 2022 09:37
robertbrignull
robertbrignull approved these changes Jan 13, 2022
View reviewed changes

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

Up to you if you want to wait for further review, but I think this is good and implements the check correctly now.

The fact that the sanitization of the env var makes us throw the error is slightly more cases is fine I think. It's a corner case that you're using two categories that only differ in case or non-alphanumeric characters. I think we can just go with this for now and change it in the future if it ever becomes a problem.

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread src/upload-lib.ts Outdated
}
core.exportVariable(sentinelEnvVar, sentinelEnvVar);
}
}

@robertbrignull robertbrignull Jan 13, 2022

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 closing brace is indented one space too many? Not sure why the formatter isn't complaining about it as my editor spots it 🤔

Sorry, something went wrong.

Uh oh!

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

All reactions

@aeisenberg aeisenberg Jan 13, 2022

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.

That explains the failing linting PR check.

Sorry, something went wrong.

Uh oh!

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

All reactions
@aeisenberg
Allow duplicate categories in the same validation step
ab1f709
A single SARIF file should be allowed to have duplicated
categories.
@aeisenberg
aeisenberg force-pushed the aeisenberg/category-with-tool branch from 43018ce to ab1f709 Compare January 13, 2022 18:35
@aeisenberg

aeisenberg commented Jan 13, 2022

Copy link
Copy Markdown
Contributor Author

I'll keep this open for another day or two to see if @Daverlo has any comments, and then I'll merge if there's nothing else.

All reactions

Sorry, something went wrong.

Uh oh!

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

@aeisenberg
Merge branch 'main' into aeisenberg/category-with-tool
8de62be
@aeisenberg

aeisenberg commented Jan 17, 2022

Copy link
Copy Markdown
Contributor Author

Merging this based on prior approval.

All reactions

Sorry, something went wrong.

Uh oh!

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

@aeisenberg
aeisenberg enabled auto-merge January 17, 2022 17:08
@aeisenberg
aeisenberg merged commit b886234 into main Jan 17, 2022
@aeisenberg
aeisenberg deleted the aeisenberg/category-with-tool branch January 17, 2022 17:19
@github-actions github-actions Bot mentioned this pull request Jan 18, 2022
Merge main into v1 #874
Merged
4 of 5 tasks
This was referenced Oct 13, 2023
[Snyk] Security upgrade nyc from 12.0.2 to 13.1.0 aliscco/codeql-action#818
Open
[Snyk] Security upgrade nyc from 12.0.2 to 13.1.0 aliscco/codeql-action#819
Open
[Snyk] Security upgrade nyc from 12.0.2 to 13.1.0 aliscco/codeql-action#820
Open
This was referenced Nov 28, 2023
[Snyk] Fix for 4 vulnerabilities aliscco/codeql-action#863
Open
[Snyk] Security upgrade nyc from 11.9.0 to 13.0.1 aliscco/codeql-action#869
Open
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@robertbrignull robertbrignull robertbrignull approved these changes
@Daverlo Daverlo Awaiting requested review from Daverlo

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

@aeisenberg @starcke @robertbrignull
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.