FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Add `resolve-environment` action by mbg · Pull Request #1684 · github/codeql-action · GitHub

Add resolve-environment action - #1684

Merged
mbg merged 33 commits into
mainfrom
mbg/add-resolve-environment
Jun 15, 2023
Merged

mbg merged 33 commits into
mainfrom
mbg/add-resolve-environment

Conversation

mbg commented May 18, 2023
edited
Loading

Copy link
Copy Markdown
Member

Summary

This PR adds a new resolve-environment action which calls the new CLI resolve build-environment command to try and infer a configuration for the build environment that is suitable for the autobuilder. Example workflow (assuming a repository with a Go project):

jobs:
  analyze-linux:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v3

      - uses: github/codeql-action/resolve-environment@mbg/add-resolve-environment
        id: resolve-environment
        with:
          language: go

      - run: echo "${{ steps.resolve-environment.outputs.environment }}"

The action performs the following work:

  • Downloads the CodeQL CLI (optionally from the tools input); same behaviour as the init action.
  • Runs the resolve build-environment command and stores the JSON result received from that in the environment output

mbg self-assigned this May 18, 2023
mbg force-pushed the mbg/add-resolve-environment branch from 1dca7fb to bbaaef5 Compare May 26, 2023 10:40

henrymercer left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

This is looking in good shape!

  • I think it's worth writing a CHANGELOG note for observant customers who are watching the repo to say that this Action is an internal experiment, is subject to change and shouldn't be used in production.
  • It'd be good to have a basic integration test of this once we have a CLI to test it against, just to make sure everything is wired up correctly.
  • We will need to make some internal changes to start capturing telemetry properly — for instance we need to add resolve-environment to an allowlist in the monolith. Though there's no rush to make this change.

Comment thread resolve-environment/action.yml Outdated
Comment thread resolve-environment/action.yml Outdated
Comment thread src/resolve-environment-action.ts Outdated
Comment thread src/resolve-environment.ts Outdated
Comment thread src/codeql.ts Outdated
Comment thread src/resolve-environment-action.ts Outdated
mbg force-pushed the mbg/add-resolve-environment branch 3 times, most recently from a01d376 to f95520d Compare June 6, 2023 11:22
mbg force-pushed the mbg/add-resolve-environment branch from 6a72d37 to f95520d Compare June 13, 2023 11:06
mbg marked this pull request as ready for review June 13, 2023 11:11
mbg requested a review from a team as a code owner June 13, 2023 11:11
Comment thread CHANGELOG.md Outdated
);
core.setOutput("environment", result);
} catch (unwrappedError) {
const error = wrapError(unwrappedError);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Are there any known user errors that we should ignore? Eg- trying to resolve an unknown language? Trying to avoid spurious triggers of our SLOs.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I think this will probably get addressed by the proposed handling of CLI errors in general: #1684 (comment)

Comment thread src/resolve-environment-action.ts Outdated

henrymercer left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Nice! Some minor suggestions to improve this before we merge.

Comment thread CHANGELOG.md Outdated
Comment thread resolve-environment/action.yml Outdated
Comment thread resolve-environment/action.yml Outdated
Comment thread src/codeql.ts Outdated
Comment thread src/resolve-environment-action.ts Outdated
Comment thread src/resolve-environment-action.ts Outdated
Comment thread src/resolve-environment-action.ts Outdated
Comment thread src/resolve-environment.ts Outdated
Comment thread src/resolve-environment.ts Outdated
mbg force-pushed the mbg/add-resolve-environment branch from fa9ebea to 0485950 Compare June 13, 2023 19:15
mbg force-pushed the mbg/add-resolve-environment branch from 0485950 to c878505 Compare June 13, 2023 19:47

mbg commented Jun 13, 2023

Copy link
Copy Markdown
Member Author

In addition to the basic integration test included in this PR, we also have an internal repo with a more comprehensive test matrix which covers most cases that the Go autobuilder distinguishes between when resolving build environments. That forms an end-to-end test for all the new components related to this work.

mbg requested review from aeisenberg and henrymercer June 14, 2023 15:04

henrymercer left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

One improvement around better CLI error handling for old CLIs, otherwise this LGTM.

mbg requested a review from henrymercer June 15, 2023 09:15
henrymercer previously approved these changes Jun 15, 2023

henrymercer left a comment
edited
Loading

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Checks are currently failing since nightly-latest doesn't have a version number of 2.13.4+ yet. I suggest we point to the new 2.13.4 bundle directly (stable-v2.13.4) or alternatively wait until #1721 is merged and use latest in the checks.

henrymercer left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Thanks for addressing the feedback on the naming of the check step! This LGTM

mbg merged commit 0ac1815 into main Jun 15, 2023
mbg deleted the mbg/add-resolve-environment branch June 15, 2023 16:50
github-actions Bot mentioned this pull request Jun 21, 2023
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants


Back | FazBrowse Home | New Git URL