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 — Fix running tests on forks, and handle invalid URIs when fingerprinting by jsoref · Pull Request #1694 · github/codeql-action

Conversation

@jsoref

@jsoref jsoref commented May 23, 2023 •
edited by henrymercer
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor
  • closes Error: URI malformed should report the input / offset #1542
  • fixes tests on forks (organizations with restrictive permissions and repositories not named github/codeql-action)

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
@jsoref
jsoref requested a review from a team as a code owner May 23, 2023 06:03
henrymercer
henrymercer reviewed May 23, 2023
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.

Thanks for the contribution, most of the changes here look good to me. To help us when we release the Action and when we're going through PRs in the future, would you mind giving your PR a more descriptive title, for instance "Fix running tests on forks, and handle invalid URIs when fingerprinting"?

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread pr-checks/checks/analyze-ref-input.yml 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.

Comment thread src/fingerprints.ts Resolved

Uh oh!

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

@jsoref jsoref changed the title Fixes Fix running tests on forks, and handle invalid URIs when fingerprinting May 23, 2023
@jsoref

jsoref commented May 23, 2023

Copy link
Copy Markdown
Contributor Author

One final pain point: rate limits: https://github.com/check-spelling/github-codeql-action/actions/runs/5053027012 ... I'm not quite sure how to address this and thus I've left it out of scope, but it's problem.

All reactions

Sorry, something went wrong.

Uh oh!

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

jsoref added 2 commits May 24, 2023 18:14
@jsoref
Clarify how to update workflows
8f9b20b
@jsoref
Grant security-events: write permissions
dba4f66
@jsoref
jsoref force-pushed the fixes branch from 0dd593b to 6ded3a4 Compare May 24, 2023 22:54
@jsoref
jsoref requested a review from henrymercer May 24, 2023 23:47
github-advanced-security[bot]
github-advanced-security AI found potential problems May 25, 2023
View reviewed changes
Comment thread src/init-action-post-helper.ts Fixed

Uh oh!

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

henrymercer
henrymercer reviewed May 25, 2023
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.

Thanks again for the contribution. This LGTM once you've addressed the linter warnings. If you could make sure npm run build && npm test && npm run lint succeeds locally before submitting we should be good to go.

Re rate limits, we have an item on the backlog to reduce the number of concurrent jobs that run with our PR checks. We could also look at skipping certain PR checks when we run on forks, but that leaves a gap in test coverage I'm not entirely happy with.

Sorry, something went wrong.

Uh oh!

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

All reactions
@jsoref

jsoref commented May 25, 2023

Copy link
Copy Markdown
Contributor Author

I'll try to do that this morning.

Note that:

  • The read me file doesn't link to Contributing
  • Contributing mentions node 14 which is almost certainly wrong

I really did look for a build file but didn't find one. I was trying to figure out if the project was npm or yarn.

All reactions

Sorry, something went wrong.

Uh oh!

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

@jsoref

jsoref commented May 25, 2023

Copy link
Copy Markdown
Contributor Author

Yes, disabling checks in forks is not what I'd want.

You could use a "variable" to specify a portion of the matrix to run for each test. That'd at least result in not starving forks of running capacity and allow users to change which set they're running between runs.

GitHub should allow running workflows to easily check on runner capacity and declaratively wait for capacity before starting a workflow. (This is very far beyond the scope of this PR, but I'm hoping you can send feedback to some internal team.)

It's probably possible to use workflow dispatch and have workflows chain from one to another. Sure it'd mean that things would be slower, but it's really painful to manually discover individual workflows that have failed and need to be rerun and then run then again. Again, this could be gated on a variable to allow the current behavior for people who have the capacity or tolerance.

All reactions

Sorry, something went wrong.

Uh oh!

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

jsoref added 3 commits May 25, 2023 09:14
@jsoref
Tolerate forks of github/codeql-action
a5879b7
@jsoref
Improving handling of uploadFailedSarifResult -> [Object object]
789f65c
@jsoref
Gracefully handle decodeURIComponent failure
cc5f2fb
@jsoref
jsoref force-pushed the fixes branch from 6ded3a4 to cc5f2fb Compare May 25, 2023 13:16
henrymercer
henrymercer approved these changes May 25, 2023
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.

Thanks for making the updates and your further suggestions around the contribution documentation and PR checks. The .github/workflows/pr-checks.yml workflow does something similar to the chaining behaviour you suggest — I could see us doing something like that for other checks too.

Sorry, something went wrong.

Uh oh!

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

jsoref reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@henrymercer
henrymercer merged commit 1023a08 into github:main May 25, 2023
@jsoref
jsoref deleted the fixes branch May 25, 2023 14:52
@henrymercer henrymercer mentioned this pull request May 25, 2023
Contributing documentation updates #1704
Merged
3 tasks done
@github-actions github-actions Bot mentioned this pull request May 25, 2023
Merge main into releases/v2 #1706
Merged
6 tasks done
@jsoref

jsoref commented May 28, 2023

Copy link
Copy Markdown
Contributor Author

Fwiw, this change resulted in:
https://github.com/jsoref/examples-testing/actions/runs/5102140844/jobs/9171515485#step:2:1127

Warning: 'this # file ( is 5) evil.txt' is not a valid URI in 'instance.runs[0].results[2].locations[0].physicalLocation.artifactLocation.uri'.

Which is a huge improvement.

I'd love for that to be surfaced, either by a problem-matcher or a ::warning. If you're amenable to either, I can make a PR.

All reactions

Sorry, something went wrong.

Uh oh!

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

@aeisenberg

aeisenberg commented May 29, 2023

Copy link
Copy Markdown
Contributor

Thanks for the suggestion, but I don't think that would be a good UX. There are some users of the upload-sarif action that rely on generating an invalid URL to signal that a certain file that is expected doesn't exist. See #1703. Using a problem matcher would mean that all users of this action will receive warnings when their workflow finds alerts.

There are things they could do differently to avoid using an invalid URL and we are going to work with them to fix it. But, until then I don't think there should be a warning here.

All reactions

Sorry, something went wrong.

Uh oh!

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

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

Error: URI malformed should report the input / offset

Uh oh!

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

4 participants

@jsoref @aeisenberg @henrymercer @github-advanced-security
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.