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

Merge releases/v2 into releases/v1 #1071

Merged
merged 41 commits into from May 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
0256599
Prompt customers to upgrade from v1 to v2
henrymercer Apr 26, 2022
016ec75
Update changelog and version after v2.1.9
invalid-email-address Apr 27, 2022
04f504c
Update checked-in dependencies
invalid-email-address Apr 27, 2022
6ed7f70
Merge pull request #1047 from github/mergeback/v2.1.9-to-main-7502d6e9
edoardopirovano Apr 28, 2022
5227afa
Tweak wording of message
henrymercer Apr 28, 2022
35ef6a2
Move `formatGitHubVersion` into util.test.ts
henrymercer Apr 28, 2022
02083c3
Add a comment to explain why we show the upgrade message on GHES 3.4
henrymercer Apr 28, 2022
2bf00f7
Merge branch 'main' into henrymercer/prompt-v1-to-v2-upgrades
henrymercer Apr 28, 2022
0c3c093
Merge pull request #1045 from github/henrymercer/prompt-v1-to-v2-upgr…
henrymercer Apr 28, 2022
7c2be06
Factor out test mode determination code
henrymercer Apr 28, 2022
ea676e3
Don't wait for processing in test mode
henrymercer Apr 28, 2022
06b15c2
Allow pack specifiers to include paths
aeisenberg Apr 27, 2022
ceeddf2
Merge pull request #1050 from github/henrymercer/dont-wait-for-proces…
henrymercer Apr 29, 2022
922dc2b
Use the `--resolve-query-specs` parameter of `pack download`
aeisenberg Apr 29, 2022
b11fe85
Merge branch 'main' into aeisenberg/packs-with-paths
aeisenberg Apr 29, 2022
a73e506
Fix syntax error in workflow
aeisenberg Apr 29, 2022
0235de0
Merge pull request #1049 from github/aeisenberg/packs-with-paths
aeisenberg May 2, 2022
9a6bf18
Update CONTRIBUTING.md
aeisenberg May 2, 2022
c9882be
Update CONTRIBUTING.md
aeisenberg May 2, 2022
8f84542
Merge pull request #1052 from github/aeisenberg/required-checks
aeisenberg May 2, 2022
b71f20d
Add workflow to regenerate required checks
aeisenberg May 2, 2022
0fb7838
Merge pull request #1053 from github/aeisenberg/update-checks
aeisenberg May 2, 2022
06d4e82
Add permissions block to workflow
aeisenberg May 2, 2022
7b66e72
Merge pull request #1054 from github/aeisenberg/update-checks
aeisenberg May 2, 2022
366e88c
Fix processing errors being caught and logged as a warning rather tha…
chrisgavin May 3, 2022
96bc9c3
Merge pull request #1055 from github/fix-status-error-being-caught
chrisgavin May 3, 2022
3c6dd30
Update codeql to 2.9.1
alexet May 3, 2022
dd56e95
Merge pull request #1056 from github/alexet/update-2.9.1
alexet May 5, 2022
827fd55
Create update-required-checks script
aeisenberg May 9, 2022
7cf0ed5
Merge pull request #1060 from github/aeisenberg/required-checks-script
aeisenberg May 10, 2022
f8eea91
Update changelog for v2.1.10
invalid-email-address May 10, 2022
75b4f1c
Merge pull request #1062 from github/update-v2.1.10-7cf0ed5e
alexet May 10, 2022
3bb6c41
Remove an extraneous commit during the release process
henrymercer May 11, 2022
03e2e3c
Merge pull request #1065 from github/henrymercer/remove-extraneous-co…
henrymercer May 11, 2022
4e0668d
Fix integration tests on v1
henrymercer May 11, 2022
2f58583
Merge pull request #1069 from github/henrymercer/fix-integration-test…
henrymercer May 11, 2022
c1672e5
Revert "Update version and changelog for v1.1.9"
invalid-email-address May 11, 2022
93c2093
Revert "Update checked-in dependencies"
invalid-email-address May 11, 2022
ab69202
Merge remote-tracking branch 'origin/releases/v2' into update-v1.1.10…
invalid-email-address May 11, 2022
46d6a93
Update version and changelog for v1.1.10
invalid-email-address May 11, 2022
ec7fba1
Update checked-in dependencies
invalid-email-address May 11, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/update-release-branch.py
Expand Up @@ -292,7 +292,7 @@ def main():
conflicted_files = run_git('diff', '--name-only', '--diff-filter', 'U').splitlines()
if len(conflicted_files) > 0:
run_git('add', '.')
run_git('commit', '--no-edit')
run_git('commit', '--no-edit')

# Migrate the package version number from a v2 version number to a v1 version number
print(f'Setting version number to {version}')
Expand Down
30 changes: 24 additions & 6 deletions .github/workflows/__packaging-config-inputs-js.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 23 additions & 5 deletions .github/workflows/__packaging-config-js.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 24 additions & 6 deletions .github/workflows/__packaging-inputs-js.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 14 additions & 6 deletions .github/workflows/__split-workflow.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

35 changes: 35 additions & 0 deletions .github/workflows/script/update-required-checks.sh
@@ -0,0 +1,35 @@
#!/usr/bin/env bash
# Update the required checks based on the current branch.
# Typically, this will be main.

if [ -z "$GITHUB_TOKEN" ]; then
echo "Failed: No GitHub token found. This script requires admin access to `github/codeql-action`."
exit 1
fi

if [ "$#" -eq 1 ]; then
# If we were passed an argument, pass it as a query to fzf
GITHUB_SHA="$@"
elif [ "$#" -gt 1 ]; then
echo "Usage: $0 [SHA]"
echo "Update the required checks based on the SHA, or main."
elif [ -z "$GITHUB_SHA" ]; then
# If we don't have a SHA, use main
GITHUB_SHA="$(git rev-parse main)"
fi

echo "Getting checks for $GITHUB_SHA"

# Ignore any checks with "https://", CodeQL, LGTM, and Update checks.
CHECKS="$(gh api repos/github/codeql-action/commits/${GITHUB_SHA}/check-runs --paginate | jq --slurp --compact-output --raw-output '[.[].check_runs | .[].name | select(contains("https://") or . == "CodeQL" or . == "LGTM.com" or contains("Update") | not)] | sort')"

echo "$CHECKS" | jq

echo "{\"contexts\": ${CHECKS}}" > checks.json

for BRANCH in main releases/v2 releases/v1; do
echo "Updating $BRANCH"
gh api --silent -X "PATCH" "repos/github/codeql-action/branches/$BRANCH/protection/required_status_checks" --input checks.json
done

rm checks.json
5 changes: 5 additions & 0 deletions CHANGELOG.md
@@ -1,5 +1,10 @@
# CodeQL Action Changelog

## 1.1.10 - 10 May 2022

- Update default CodeQL bundle version to 2.9.5. [#1056](https://github.com/github/codeql-action/pull/1056)
- When `wait-for-processing` is enabled, the workflow will now fail if there were any errors that occurred during processing of the analysis results.

## 1.1.9 - 27 Apr 2022

- Add `working-directory` input to the `autobuild` action. [#1024](https://github.com/github/codeql-action/pull/1024)
Expand Down
11 changes: 6 additions & 5 deletions CONTRIBUTING.md
Expand Up @@ -80,22 +80,23 @@ Here are a few things you can do that will increase the likelihood of your pull

## Keeping the PR checks up to date (admin access required)

Since the `codeql-action` runs most of its testing through individual Actions workflows, there are over two hundred jobs that need to pass in order for a PR to turn green. Managing these PR checks manually is time consuming and complex. Here is a semi-automated approach.
Since the `codeql-action` runs most of its testing through individual Actions workflows, there are over two hundred jobs that need to pass in order for a PR to turn green. You can regenerate the checks automatically by running the [Update required checks](.github/workflows/update-required-checks.yml) workflow.

To regenerate the PR jobs for the action:
Or you can use this semi-automated approach:

1. From a terminal, run the following commands (replace `SHA` with the sha of the commit whose checks you want to use, typically this should be the latest from `main`):
1. In a terminal check out the `SHA` whose checks you want to use as the base. Typically, this will be `main`.
2. From a terminal, run the following commands:

```sh
SHA= ####
SHA="$(git rev-parse HEAD)"
CHECKS="$(gh api repos/github/codeql-action/commits/${SHA}/check-runs --paginate | jq --slurp --compact-output --raw-output '[.[].check_runs | .[].name | select(contains("https://") or . == "CodeQL" or . == "LGTM.com" or . == "Update dependencies" or . == "Update Supported Enterprise Server Versions" | not)]')"
echo "{\"contexts\": ${CHECKS}}" > checks.json
gh api -X "PATCH" repos/github/codeql-action/branches/main/protection/required_status_checks --input checks.json
gh api -X "PATCH" repos/github/codeql-action/branches/releases/v2/protection/required_status_checks --input checks.json
gh api -X "PATCH" repos/github/codeql-action/branches/releases/v1/protection/required_status_checks --input checks.json
````

2. Go to the [branch protection rules settings page](https://github.com/github/codeql-action/settings/branches) and validate that the rules have been updated.
3. Go to the [branch protection rules settings page](https://github.com/github/codeql-action/settings/branches) and validate that the rules have been updated.

## Resources

Expand Down
3 changes: 1 addition & 2 deletions lib/actions-util.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/actions-util.js.map

Large diffs are not rendered by default.

10 changes: 7 additions & 3 deletions lib/analyze-action-env.test.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/analyze-action-env.test.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.