Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restore compatibility with GHES 3.1 #978

Merged
merged 3 commits into from
Mar 15, 2022

Conversation

cklin
Copy link
Contributor

@cklin cklin commented Mar 12, 2022

This PR fixes a few problems related to GHES compatibility.

  • Check whether the RUNNER_ARCH environment variable exists before accessing
  • Do not send status reports if the action is being used with GHES 3.1

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.

@cklin cklin requested a review from a team as a code owner March 12, 2022 00:22
Copy link
Contributor

@adityasharad adityasharad left a comment

Choose a reason for hiding this comment

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

Minor suggestions. Also did you mean to open this from your main branch?

CHANGELOG.md Outdated
@@ -2,7 +2,7 @@

## [UNRELEASED]

No user facing changes.
- Fix a bug where actions would fail when used with GHES 3.3 or earlier. [#978](https://github.com/github/codeql-action/pull/978)
Copy link
Contributor

Choose a reason for hiding this comment

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

I think there are two bugs fixed here: one on 3.3 and earlier due to RUNNER_ARCH, and one on 3.1 and earlier due to unexpected telemetry fields. Could you expand this a little bit so that users know which errors will go away by updating?

@@ -695,6 +694,10 @@ export async function createStatusReportBase(
if (matrix) {
statusReport.matrix_vars = matrix;
}
if ("RUNNER_ARCH" in process.env) {
// RUNNER_ARCH is available only in GHES 3.4 and later
Copy link
Contributor

Choose a reason for hiding this comment

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

Minor: worth commenting that the server will filter out unknown/unfamiliar values.

*
* @returns GitHub version
*/
export async function getGitHubVersion(): Promise<GitHubVersion> {
Copy link
Contributor

Choose a reason for hiding this comment

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

Minor: How about something like getGitHubVersionActionsOnly?

* Report the GitHub server version. This is a wrapper around
* util.getGitHubVersion() that automatically supplies GitHub API details using
* GitHub Action inputs. If you need to get the GitHub server version from the
* action runner, please call util.getGitHubVersion() instead.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
* action runner, please call util.getGitHubVersion() instead.
* Runner, please call util.getGitHubVersion() instead.

@cklin
Copy link
Contributor Author

cklin commented Mar 14, 2022

Also did you mean to open this from your main branch?

Good catch! And no, it was a screw-up on my part.

I don't think there is a way to switch the source branch of a PR, so I will just have to learn my lesson and put the main branch of my fork back in order afterwards.

@cklin
Copy link
Contributor Author

cklin commented Mar 14, 2022

@adityasharad
Thank you for your feedback; I think I addressed them all. Please take another look. Thank you!

@cklin cklin requested a review from adityasharad March 14, 2022 22:46
@cklin cklin merged commit 5b59d87 into github:main Mar 15, 2022
@cklin cklin deleted the restore-ghes-compatibility branch March 15, 2022 16:29
@github-actions github-actions bot mentioned this pull request Mar 15, 2022
5 tasks
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.

2 participants