Skip to content

Commit c884bf6

Browse files
authored
Merge branch 'main' into henrymercer/reenable-swift-autobuild-checks
2 parents 7a14c3b + 2bee5fb commit c884bf6

File tree

2,165 files changed

+205201
-310807
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,165 files changed

+205201
-310807
lines changed

.eslintrc.json

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,29 +41,23 @@
4141
"ignoreTemplateLiterals": true
4242
}],
4343
"no-async-foreach/no-async-foreach": "error",
44-
"no-console": "off",
4544
"no-sequences": "error",
4645
"no-shadow": "off",
47-
"@typescript-eslint/no-shadow": ["error"],
46+
"@typescript-eslint/no-shadow": "error",
4847
"one-var": ["error", "never"]
4948
},
5049
"overrides": [{
5150
// "temporarily downgraded during transition to eslint
5251
"files": "**",
5352
"rules": {
54-
"@typescript-eslint/ban-types": "off",
55-
"@typescript-eslint/explicit-module-boundary-types": "off",
5653
"@typescript-eslint/no-explicit-any": "off",
5754
"@typescript-eslint/no-unsafe-assignment": "off",
58-
"@typescript-eslint/no-unsafe-call": "off",
5955
"@typescript-eslint/no-unsafe-member-access": "off",
60-
"@typescript-eslint/no-unsafe-return": "off",
6156
"@typescript-eslint/no-var-requires": "off",
6257
"@typescript-eslint/prefer-regexp-exec": "off",
6358
"@typescript-eslint/require-await": "off",
6459
"@typescript-eslint/restrict-template-expressions": "off",
65-
"func-style": "off",
66-
"sort-imports": "off"
60+
"func-style": "off"
6761
}
6862
}],
6963
"settings": {

.github/actions/check-codescanning-config/action.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,16 @@ inputs:
2929
tools:
3030
required: true
3131
description: |
32-
The url of codeql to use.
32+
The version of CodeQL passed to the `tools` input of the init action.
33+
This can be any of the following:
34+
35+
- A local path to a tarball containing the CodeQL tools, or
36+
- A URL to a GitHub release assets containing the CodeQL tools, or
37+
- A special value `linked` which is forcing the use of the CodeQL tools
38+
that the action has been bundled with.
39+
40+
If not specified, the Action will check in several places until it finds
41+
the CodeQL tools.
3342
3443
runs:
3544
using: composite

.github/actions/check-sarif/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@ inputs:
1616
Comma separated list of query ids that should NOT be included in this SARIF file.
1717
1818
runs:
19-
using: node16
19+
using: node20
2020
main: index.js

.github/actions/prepare-test/action.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: "Prepare test"
22
description: Performs some preparation to run tests
33
inputs:
44
version:
5-
description: "The version of the CodeQL CLI to use. Can be 'latest', 'default', 'nightly-latest', 'nightly-YYYY-MM-DD', or 'stable-YYYY-MM-DD'."
5+
description: "The version of the CodeQL CLI to use. Can be 'linked', 'default', 'nightly-latest', 'nightly-YYYY-MM-DD', or 'stable-YYYY-MM-DD'."
66
required: true
77
use-all-platform-bundle:
88
description: "If true, we output a tools URL with codeql-bundle.tar.gz file rather than platform-specific URL"
@@ -50,8 +50,8 @@ runs:
5050
elif [[ ${{ inputs.version }} == *"stable"* ]]; then
5151
version=`echo ${{ inputs.version }} | sed -e 's/^.*\-//'`
5252
echo "tools-url=https://github.com/github/codeql-action/releases/download/codeql-bundle-$version/$artifact_name" >> $GITHUB_OUTPUT
53-
elif [[ ${{ inputs.version }} == "latest" ]]; then
54-
echo "tools-url=latest" >> $GITHUB_OUTPUT
53+
elif [[ ${{ inputs.version }} == "linked" ]]; then
54+
echo "tools-url=linked" >> $GITHUB_OUTPUT
5555
elif [[ ${{ inputs.version }} == "default" ]]; then
5656
echo "tools-url=" >> $GITHUB_OUTPUT
5757
else

.github/actions/query-filter-test/action.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,16 @@ inputs:
2323
tools:
2424
required: true
2525
description: |
26-
The url of codeql to use.
26+
The version of CodeQL passed to the `tools` input of the init action.
27+
This can be any of the following:
28+
29+
- A local path to a tarball containing the CodeQL tools, or
30+
- A URL to a GitHub release assets containing the CodeQL tools, or
31+
- A special value `linked` which is forcing the use of the CodeQL tools
32+
that the action has been bundled with.
33+
34+
If not specified, the Action will check in several places until it finds
35+
the CodeQL tools.
2736
2837
runs:
2938
using: composite
@@ -39,7 +48,6 @@ runs:
3948
- uses: ./../action/analyze
4049
with:
4150
output: ${{ runner.temp }}/results
42-
upload-database: false
4351
upload: never
4452
env:
4553
CODEQL_ACTION_TEST_MODE: "true"
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: 'Release branches'
2+
description: 'Determine branches for release & backport'
3+
inputs:
4+
major_version:
5+
description: 'The version as extracted from the package.json file'
6+
required: true
7+
latest_tag:
8+
description: 'The most recent tag published to the repository'
9+
required: true
10+
outputs:
11+
backport_source_branch:
12+
description: "The release branch for the given tag"
13+
value: ${{ steps.branches.outputs.backport_source_branch }}
14+
backport_target_branches:
15+
description: "JSON encoded list of branches to target with backports"
16+
value: ${{ steps.branches.outputs.backport_target_branches }}
17+
runs:
18+
using: "composite"
19+
steps:
20+
- id: branches
21+
run: |
22+
python ${{ github.action_path }}/release-branches.py \
23+
--major-version ${{ inputs.major_version }} \
24+
--latest-tag ${{ inputs.latest_tag }}
25+
shell: bash
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
import argparse
2+
import json
3+
import os
4+
import configparser
5+
6+
# Name of the remote
7+
ORIGIN = 'origin'
8+
9+
script_dir = os.path.dirname(os.path.realpath(__file__))
10+
grandparent_dir = os.path.dirname(os.path.dirname(script_dir))
11+
12+
config = configparser.ConfigParser()
13+
with open(os.path.join(grandparent_dir, 'releases.ini')) as stream:
14+
config.read_string('[default]\n' + stream.read())
15+
16+
OLDEST_SUPPORTED_MAJOR_VERSION = int(config['default']['OLDEST_SUPPORTED_MAJOR_VERSION'])
17+
18+
def main():
19+
20+
parser = argparse.ArgumentParser()
21+
parser.add_argument("--major-version", required=True, type=str, help="The major version of the release")
22+
parser.add_argument("--latest-tag", required=True, type=str, help="The most recent tag published to the repository")
23+
args = parser.parse_args()
24+
25+
major_version = args.major_version
26+
latest_tag = args.latest_tag
27+
28+
print("major_version: " + major_version)
29+
print("latest_tag: " + latest_tag)
30+
31+
# If this is a primary release, we backport to all supported branches,
32+
# so we check whether the major_version taken from the package.json
33+
# is greater than or equal to the latest tag pulled from the repo.
34+
# For example...
35+
# 'v1' >= 'v2' is False # we're operating from an older release branch and should not backport
36+
# 'v2' >= 'v2' is True # the normal case where we're updating the current version
37+
# 'v3' >= 'v2' is True # in this case we are making the first release of a new major version
38+
consider_backports = ( major_version >= latest_tag.split(".")[0] )
39+
40+
with open(os.environ["GITHUB_OUTPUT"], "a") as f:
41+
42+
f.write(f"backport_source_branch=releases/{major_version}\n")
43+
44+
backport_target_branches = []
45+
46+
if consider_backports:
47+
for i in range(int(major_version.strip("v"))-1, 0, -1):
48+
branch_name = f"releases/v{i}"
49+
if i >= OLDEST_SUPPORTED_MAJOR_VERSION:
50+
backport_target_branches.append(branch_name)
51+
52+
f.write("backport_target_branches="+json.dumps(backport_target_branches)+"\n")
53+
54+
if __name__ == "__main__":
55+
main()
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: 'Prepare release job'
2+
description: 'Prepare for updating a release branch'
3+
4+
runs:
5+
using: "composite"
6+
steps:
7+
8+
- name: Dump environment
9+
run: env
10+
shell: bash
11+
12+
- name: Dump GitHub context
13+
env:
14+
GITHUB_CONTEXT: '${{ toJson(github) }}'
15+
run: echo "$GITHUB_CONTEXT"
16+
shell: bash
17+
18+
- name: Set up Python
19+
uses: actions/setup-python@v5
20+
with:
21+
python-version: 3.12
22+
23+
- name: Install dependencies
24+
run: |
25+
python -m pip install --upgrade pip
26+
pip install PyGithub==2.3.0 requests
27+
shell: bash
28+
29+
- name: Update git config
30+
run: |
31+
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
32+
git config --global user.name "github-actions[bot]"
33+
shell: bash

.github/actions/setup-swift/action.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,16 @@ runs:
2424
VERSION="5.7.0"
2525
elif [ $VERSION = "5.8" ]; then
2626
VERSION="5.8.0"
27-
# setup-swift does not yet support v5.8.1 Remove this when it does.
28-
elif [ $VERSION = "5.8.1" ]; then
29-
VERSION="5.8.0"
27+
elif [ $VERSION = "5.9" ]; then
28+
VERSION="5.9.0"
29+
# setup-swift does not yet support v5.9.1 Remove this when it does.
30+
elif [ $VERSION = "5.9.1" ]; then
31+
VERSION="5.9.0"
3032
fi
3133
fi
3234
echo "version=$VERSION" | tee -a $GITHUB_OUTPUT
3335
34-
- uses: swift-actions/setup-swift@f51889efb55dccf13be0ee727e3d6c89a096fb4c # Please update the corresponding SHA in the CLI's CodeQL Action Integration Test.
36+
- uses: redsun82/setup-swift@b2b6f77ab14f6a9b136b520dc53ec8eca27d2b99 # Please update the corresponding SHA in the CLI's CodeQL Action Integration Test.
3537
if: runner.os == 'Linux' && steps.get_swift_version.outputs.version != 'null'
3638
with:
3739
swift-version: "${{ steps.get_swift_version.outputs.version }}"

.github/dependabot.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ version: 2
22
updates:
33
- package-ecosystem: npm
44
directory: "/"
5+
reviewers:
6+
- "github/codeql-production-shield"
57
schedule:
68
interval: weekly
79
labels:
@@ -20,6 +22,8 @@ updates:
2022
- "*"
2123
- package-ecosystem: github-actions
2224
directory: "/"
25+
reviewers:
26+
- "github/codeql-production-shield"
2327
schedule:
2428
interval: weekly
2529
groups:
@@ -28,6 +32,8 @@ updates:
2832
- "*"
2933
- package-ecosystem: github-actions
3034
directory: "/.github/actions/setup-swift/" # All subdirectories outside of "/.github/workflows" must be explicitly included.
35+
reviewers:
36+
- "github/codeql-production-shield"
3137
schedule:
3238
interval: weekly
3339
groups:

0 commit comments

Comments
 (0)