Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into aeisenberg/enable-k…
Browse files Browse the repository at this point in the history
…otlin-tests
  • Loading branch information
aeisenberg committed Jun 14, 2024
2 parents 72f5fb9 + bd2ebac commit 3f41e06
Show file tree
Hide file tree
Showing 964 changed files with 67,177 additions and 77,357 deletions.
10 changes: 2 additions & 8 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,29 +41,23 @@
"ignoreTemplateLiterals": true
}],
"no-async-foreach/no-async-foreach": "error",
"no-console": "off",
"no-sequences": "error",
"no-shadow": "off",
"@typescript-eslint/no-shadow": ["error"],
"@typescript-eslint/no-shadow": "error",
"one-var": ["error", "never"]
},
"overrides": [{
// "temporarily downgraded during transition to eslint
"files": "**",
"rules": {
"@typescript-eslint/ban-types": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-unsafe-assignment": "off",
"@typescript-eslint/no-unsafe-call": "off",
"@typescript-eslint/no-unsafe-member-access": "off",
"@typescript-eslint/no-unsafe-return": "off",
"@typescript-eslint/no-var-requires": "off",
"@typescript-eslint/prefer-regexp-exec": "off",
"@typescript-eslint/require-await": "off",
"@typescript-eslint/restrict-template-expressions": "off",
"func-style": "off",
"sort-imports": "off"
"func-style": "off"
}
}],
"settings": {
Expand Down
11 changes: 10 additions & 1 deletion .github/actions/check-codescanning-config/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,16 @@ inputs:
tools:
required: true
description: |
The url of codeql to use.
The version of CodeQL passed to the `tools` input of the init action.
This can be any of the following:
- A local path to a tarball containing the CodeQL tools, or
- A URL to a GitHub release assets containing the CodeQL tools, or
- A special value `linked` which is forcing the use of the CodeQL tools
that the action has been bundled with.
If not specified, the Action will check in several places until it finds
the CodeQL tools.
runs:
using: composite
Expand Down
6 changes: 3 additions & 3 deletions .github/actions/prepare-test/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: "Prepare test"
description: Performs some preparation to run tests
inputs:
version:
description: "The version of the CodeQL CLI to use. Can be 'latest', 'default', 'nightly-latest', 'nightly-YYYY-MM-DD', or 'stable-YYYY-MM-DD'."
description: "The version of the CodeQL CLI to use. Can be 'linked', 'default', 'nightly-latest', 'nightly-YYYY-MM-DD', or 'stable-YYYY-MM-DD'."
required: true
use-all-platform-bundle:
description: "If true, we output a tools URL with codeql-bundle.tar.gz file rather than platform-specific URL"
Expand Down Expand Up @@ -54,8 +54,8 @@ runs:
elif [[ ${{ inputs.version }} == *"stable"* ]]; then
version=`echo ${{ inputs.version }} | sed -e 's/^.*\-//'`
echo "tools-url=https://github.com/github/codeql-action/releases/download/codeql-bundle-$version/$artifact_name" >> $GITHUB_OUTPUT
elif [[ ${{ inputs.version }} == "latest" ]]; then
echo "tools-url=latest" >> $GITHUB_OUTPUT
elif [[ ${{ inputs.version }} == "linked" ]]; then
echo "tools-url=linked" >> $GITHUB_OUTPUT
elif [[ ${{ inputs.version }} == "default" ]]; then
echo "tools-url=" >> $GITHUB_OUTPUT
else
Expand Down
12 changes: 10 additions & 2 deletions .github/actions/query-filter-test/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,16 @@ inputs:
tools:
required: true
description: |
The url of codeql to use.
The version of CodeQL passed to the `tools` input of the init action.
This can be any of the following:
- A local path to a tarball containing the CodeQL tools, or
- A URL to a GitHub release assets containing the CodeQL tools, or
- A special value `linked` which is forcing the use of the CodeQL tools
that the action has been bundled with.
If not specified, the Action will check in several places until it finds
the CodeQL tools.
runs:
using: composite
Expand All @@ -39,7 +48,6 @@ runs:
- uses: ./../action/analyze
with:
output: ${{ runner.temp }}/results
upload-database: false
upload: never
env:
CODEQL_ACTION_TEST_MODE: "true"
Expand Down
4 changes: 2 additions & 2 deletions .github/actions/release-initialise/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ runs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.8
python-version: 3.12

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install PyGithub==1.55 requests
pip install PyGithub==2.3.0 requests
shell: bash

- name: Update git config
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/setup-swift/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ runs:
fi
echo "version=$VERSION" | tee -a $GITHUB_OUTPUT
- uses: swift-actions/setup-swift@e1dca7c4a36344146bbc2803f0d538462477bb37 # Please update the corresponding SHA in the CLI's CodeQL Action Integration Test.
- uses: redsun82/setup-swift@b2b6f77ab14f6a9b136b520dc53ec8eca27d2b99 # Please update the corresponding SHA in the CLI's CodeQL Action Integration Test.
if: runner.os == 'Linux' && steps.get_swift_version.outputs.version != 'null'
with:
swift-version: "${{ steps.get_swift_version.outputs.version }}"
29 changes: 22 additions & 7 deletions .github/update-release-branch.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import argparse
import datetime
import fileinput
import re
from github import Github
import json
Expand Down Expand Up @@ -171,6 +172,19 @@ def get_current_version():
with open('package.json', 'r') as f:
return json.load(f)['version']

# `npm version` doesn't always work because of merge conflicts, so we
# replace the version in package.json textually.
def replace_version_package_json(prev_version, new_version):
prev_line_is_codeql = False
for line in fileinput.input('package.json', inplace = True, encoding='utf-8'):
if prev_line_is_codeql and f'\"version\": \"{prev_version}\"' in line:
print(line.replace(prev_version, new_version), end='')
else:
prev_line_is_codeql = False
print(line, end='')
if '\"name\": \"codeql\",' in line:
prev_line_is_codeql = True

def get_today_string():
today = datetime.datetime.today()
return '{:%d %b %Y}'.format(today)
Expand All @@ -186,16 +200,17 @@ def process_changelog_for_backports(source_branch_major_version, target_branch_m
with open('CHANGELOG.md', 'r') as f:

# until we find the first section, just duplicate all lines
while True:
found_first_section = False
while not found_first_section:
line = f.readline()
if not line:
raise Exception('Could not find any change sections in CHANGELOG.md') # EOF

output += line
if line.startswith('## '):
line = line.replace(f'## {source_branch_major_version}', f'## {target_branch_major_version}')
# we have found the first section, so now handle things differently
break
found_first_section = True

output += line

# found_content tracks whether we hit two headings in a row
found_content = False
Expand Down Expand Up @@ -373,9 +388,9 @@ def main():
run_git('commit', '--no-edit')

# Migrate the package version number from a vLatest version number to a vOlder version number
print(f'Setting version number to {version}')
subprocess.check_output(['npm', 'version', version, '--no-git-tag-version'])
run_git('add', 'package.json', 'package-lock.json')
print(f'Setting version number to {version} in package.json')
replace_version_package_json(get_current_version(), version) # We rely on the `Update dependencies` workflow to update package-lock.json
run_git('add', 'package.json')

# Migrate the changelog notes from vLatest version numbers to vOlder version numbers
print(f'Migrating changelog notes from v{source_branch_major_version} to v{target_branch_major_version}')
Expand Down
85 changes: 40 additions & 45 deletions .github/workflows/__all-platform-bundle.yml

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

Loading

0 comments on commit 3f41e06

Please sign in to comment.