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 — Allow workflow to be passed via an environment variable for default setup by henrymercer · Pull Request #1619 · github/codeql-action

Conversation

@henrymercer

@henrymercer henrymercer commented Mar 28, 2023 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor

The default setup workflow is not checked into the repository, but the Action relies on the workflow file to make features like reporting failed runs work. We'd like to move to a more robust method of making features like reporting failed runs work, but this is hard to do without making a breaking change to the workflow file, and we aren't currently in a good position to do that.

Therefore as a medium term solution, default setup will pass its workflow file to the Action via the CODE_SCANNING_WORKFLOW_FILE environment variable.

GitHub staff: see an example run and the resulting status page.

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
marcogario
marcogario reviewed Mar 29, 2023
View reviewed changes
Comment thread src/workflow.ts Resolved

Uh oh!

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

@henrymercer
henrymercer force-pushed the henrymercer/default-setup-workflow branch from 6bd6528 to eaf7e8c Compare April 11, 2023 17:25
marcogario
marcogario reviewed Apr 11, 2023
View reviewed changes
Comment thread src/workflow.ts Resolved

Uh oh!

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

@henrymercer
henrymercer force-pushed the henrymercer/default-setup-workflow branch from eaf7e8c to 41b19a1 Compare April 12, 2023 12:51
@henrymercer
Allow passing the workflow via an environment variable
599f492
@henrymercer
henrymercer force-pushed the henrymercer/default-setup-workflow branch from 41b19a1 to 599f492 Compare April 12, 2023 13:14
@henrymercer
henrymercer marked this pull request as ready for review April 12, 2023 13:21
@henrymercer
henrymercer requested a review from a team as a code owner April 12, 2023 13:21
@henrymercer
henrymercer requested a review from Daverlo April 12, 2023 13:21
@henrymercer henrymercer changed the title Update workflow path for default setup Allow workflow to be passed via an environment variable for default setup Apr 12, 2023
angelapwen
angelapwen previously approved these changes Apr 12, 2023
View reviewed changes

@angelapwen angelapwen 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 and found the appropriate debug log in the internal run (2nd attempt) linked, but assume you want @Daverlo's 👀 too!

A couple of questions:

  • will we add integration tests for default setup at a later point?
  • do we want to add a changenote since this is user facing?

Sorry, something went wrong.

Uh oh!

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

All reactions
@henrymercer

henrymercer commented Apr 12, 2023

Copy link
Copy Markdown
Contributor Author
  • will we add integration tests for default setup at a later point?

Yes! Tracking this internally.

  • do we want to add a changenote since this is user facing?

Good point, let's add a changenote for this.

All reactions

Sorry, something went wrong.

Uh oh!

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

@henrymercer
Add changelog note
e3210d8
@henrymercer
henrymercer dismissed angelapwen’s stale review via e3210d8 April 12, 2023 18:18
angelapwen
angelapwen approved these changes Apr 12, 2023
View reviewed changes

@angelapwen angelapwen left a comment •
edited
Loading

Uh oh!

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

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 sure why the PR check is failing though. Re-ran with debug mode.

Edit: looks like we might have a test flake, but because the re-run succeeded I'm not sure what it was!

Sorry, something went wrong.

Uh oh!

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

All reactions
Daverlo
Daverlo approved these changes Apr 13, 2023
View reviewed changes

@Daverlo Daverlo 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!

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread src/workflow.ts
* Get the path of the currently executing workflow.
* Get the path of the currently executing workflow relative to the repository root.
*/
export async function getWorkflowPath(): Promise<string> {

@Daverlo Daverlo Apr 13, 2023

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.

What is this this returning when using default setup?

I don't think it really matters as I only see it being used for getting the analysis key, and for default setup we are always passing a category, so this value should be overwritten.

But I'm wondering if this should highlight that there is no workflow file somehow?

Sorry, something went wrong.

Uh oh!

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

All reactions

@henrymercer henrymercer Apr 13, 2023

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.

For default setup, this will return dynamic/github-code-scanning/codeql, but as you say we get the analysis key directly from CODEQL_ACTION_ANALYSIS_KEY. I think this is a good thing to highlight though, as this is part of some work I'd like us to do around nailing down in the code what context the CodeQL Action expects from default setup, in terms of the github job context, environment variables, etc.

Sorry, something went wrong.

Uh oh!

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

All reactions

@henrymercer henrymercer Apr 13, 2023

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.

At the moment, I don't think we want to fail if the workflow file isn't found — we want to preserve the way we've been generating the analysis key to avoid breaking advanced setups where the workflow file doesn't exist, e.g. reusable workflows or workflows executing in other repositories.

Sorry, something went wrong.

Uh oh!

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

All reactions
@henrymercer
henrymercer merged commit d944b34 into main Apr 13, 2023
@henrymercer
henrymercer deleted the henrymercer/default-setup-workflow branch April 13, 2023 09:17
@github-actions github-actions Bot mentioned this pull request Apr 13, 2023
Merge main into releases/v2 #1646
Merged
4 of 6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@Daverlo Daverlo Daverlo approved these changes
+2 more reviewers
@marcogario marcogario marcogario left review comments
@angelapwen angelapwen angelapwen approved these changes
Reviewers whose approvals may not affect merge requirements

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.

4 participants

@henrymercer @marcogario @angelapwen @Daverlo
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.