Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: github/codeql-action
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.1.8
Choose a base ref
...
head repository: github/codeql-action
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v1.1.9
Choose a head ref
Loading
Showing with 6,069 additions and 251 deletions.
  1. +37 −18 .github/update-release-branch.py
  2. +2 −2 .github/workflows/__analyze-ref-input.yml
  3. +2 −2 .github/workflows/__debug-artifacts.yml
  4. +2 −2 .github/workflows/__extractor-ram-threads.yml
  5. +2 −2 .github/workflows/__go-custom-queries.yml
  6. +2 −2 .github/workflows/__go-custom-tracing-autobuild.yml
  7. +2 −2 .github/workflows/__go-custom-tracing.yml
  8. +2 −2 .github/workflows/__javascript-source-root.yml
  9. +2 −2 .github/workflows/__ml-powered-queries.yml
  10. +2 −2 .github/workflows/__multi-language-autodetect.yml
  11. +2 −2 .github/workflows/__packaging-config-inputs-js.yml
  12. +2 −2 .github/workflows/__packaging-config-js.yml
  13. +2 −2 .github/workflows/__packaging-inputs-js.yml
  14. +2 −2 .github/workflows/__remote-config.yml
  15. +2 −2 .github/workflows/__rubocop-multi-language.yml
  16. +2 −2 .github/workflows/__split-workflow.yml
  17. +67 −0 .github/workflows/__test-autobuild-working-dir.yml
  18. +2 −2 .github/workflows/__test-local-codeql.yml
  19. +2 −2 .github/workflows/__test-proxy.yml
  20. +2 −2 .github/workflows/__test-ruby.yml
  21. +2 −2 .github/workflows/__unset-environment.yml
  22. +2 −2 .github/workflows/__upload-ref-sha-input.yml
  23. +2 −2 .github/workflows/__with-checkout-path.yml
  24. +31 −0 .github/workflows/check-for-conflicts.yml
  25. +2 −2 .github/workflows/codeql.yml
  26. +44 −32 .github/workflows/post-release-mergeback.yml
  27. +1 −1 .github/workflows/pr-checks.yml
  28. +1 −1 .github/workflows/python-deps.yml
  29. +1 −1 .github/workflows/update-release-branch.yml
  30. +7 −0 CHANGELOG.md
  31. +2 −0 CODEOWNERS
  32. +9 −9 CONTRIBUTING.md
  33. +1 −1 README.md
  34. +1 −1 analyze/action.yml
  35. +7 −1 autobuild/action.yml
  36. +5 −0 lib/autobuild-action.js
  37. +1 −1 lib/autobuild-action.js.map
  38. +1 −1 lib/codeql.js
  39. +1 −1 lib/codeql.js.map
  40. +1 −1 lib/defaults.json
  41. +4 −12 lib/upload-lib.js
  42. +1 −1 lib/upload-lib.js.map
  43. +63 −5 node_modules/.package-lock.json
  44. +21 −0 node_modules/github-linguist/node_modules/glob/LICENSE
  45. +378 −0 node_modules/github-linguist/node_modules/glob/README.md
  46. +236 −0 node_modules/github-linguist/node_modules/glob/common.js
  47. +787 −0 node_modules/github-linguist/node_modules/glob/glob.js
  48. +52 −0 node_modules/github-linguist/node_modules/glob/package.json
  49. +483 −0 node_modules/github-linguist/node_modules/glob/sync.js
  50. +1 −7 node_modules/glob/LICENSE
  51. +3 −0 node_modules/glob/README.md
  52. +0 −67 node_modules/glob/changelog.md
  53. +4 −0 node_modules/glob/common.js
  54. +8 −6 node_modules/glob/glob.js
  55. +2 −0 node_modules/glob/node_modules/brace-expansion/.github/FUNDING.yml
  56. +21 −0 node_modules/glob/node_modules/brace-expansion/LICENSE
  57. +135 −0 node_modules/glob/node_modules/brace-expansion/README.md
  58. +203 −0 node_modules/glob/node_modules/brace-expansion/index.js
  59. +46 −0 node_modules/glob/node_modules/brace-expansion/package.json
  60. +15 −0 node_modules/glob/node_modules/minimatch/LICENSE
  61. +244 −0 node_modules/glob/node_modules/minimatch/README.md
  62. +4 −0 node_modules/glob/node_modules/minimatch/lib/path.js
  63. +901 −0 node_modules/glob/node_modules/minimatch/minimatch.js
  64. +32 −0 node_modules/glob/node_modules/minimatch/package.json
  65. +9 −4 node_modules/glob/package.json
  66. +8 −6 node_modules/glob/sync.js
  67. +21 −0 node_modules/rimraf/node_modules/glob/LICENSE
  68. +378 −0 node_modules/rimraf/node_modules/glob/README.md
  69. +236 −0 node_modules/rimraf/node_modules/glob/common.js
  70. +787 −0 node_modules/rimraf/node_modules/glob/glob.js
  71. +52 −0 node_modules/rimraf/node_modules/glob/package.json
  72. +483 −0 node_modules/rimraf/node_modules/glob/sync.js
  73. +115 −10 package-lock.json
  74. +2 −2 package.json
  75. +30 −0 pr-checks/checks/test-autobuild-working-dir.yml
  76. +1 −1 pr-checks/sync.py
  77. +5 −3 python-setup/auto_install_packages.py
  78. +8 −0 src/autobuild-action.ts
  79. +1 −1 src/codeql.ts
  80. +1 −1 src/defaults.json
  81. +5 −11 src/upload-lib.ts
  82. +12 −0 tests/java-repo/build.gradle
  83. +8 −0 tests/java-repo/src/main/java/Main.java
  84. +1 −1 upload-sarif/action.yml
55 changes: 37 additions & 18 deletions .github/update-release-branch.py
Original file line number Diff line number Diff line change
@@ -19,15 +19,19 @@
# Value of the mode flag for a v2 release
V2_MODE = 'v2-release'

SOURCE_BRANCH_FOR_MODE = { V1_MODE: 'releases/v2', V2_MODE: 'main' }
TARGET_BRANCH_FOR_MODE = { V1_MODE: 'releases/v1', V2_MODE: 'releases/v2' }

# Name of the remote
ORIGIN = 'origin'

# Runs git with the given args and returns the stdout.
# Raises an error if git does not exit successfully.
def run_git(*args):
# Raises an error if git does not exit successfully (unless passed
# allow_non_zero_exit_code=True).
def run_git(*args, allow_non_zero_exit_code=False):
cmd = ['git', *args]
p = subprocess.run(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
if (p.returncode != 0):
if not allow_non_zero_exit_code and p.returncode != 0:
raise Exception('Call to ' + ' '.join(cmd) + ' exited with code ' + str(p.returncode) + ' stderr:' + p.stderr.decode('ascii'))
return p.stdout.decode('ascii')

@@ -36,7 +40,9 @@ def branch_exists_on_remote(branch_name):
return run_git('ls-remote', '--heads', ORIGIN, branch_name).strip() != ''

# Opens a PR from the given branch to the target branch
def open_pr(repo, all_commits, source_branch_short_sha, new_branch_name, source_branch, target_branch, conductor, is_v2_release, labels):
def open_pr(
repo, all_commits, source_branch_short_sha, new_branch_name, source_branch, target_branch,
conductor, is_v2_release, labels, conflicted_files):
# Sort the commits into the pull requests that introduced them,
# and any commits that don't have a pull request
pull_requests = []
@@ -81,6 +87,12 @@ def open_pr(repo, all_commits, source_branch_short_sha, new_branch_name, source_

body.append('')
body.append('Please review the following:')
if len(conflicted_files) > 0:
body.append(' - [ ] You have added commits to this branch that resolve the merge conflicts ' +
'in the following files:')
body.extend([f' - [ ] `{file}`' for file in conflicted_files])
body.append(' - [ ] Another maintainer has reviewed the additional commits you added to this ' +
'branch to resolve the merge conflicts.')
body.append(' - [ ] The CHANGELOG displays the correct version and date.')
body.append(' - [ ] The CHANGELOG includes all relevant, user-facing changes since the last release.')
body.append(' - [ ] There are no unexpected commits being merged into the ' + target_branch + ' branch.')
@@ -191,8 +203,10 @@ def main():
type=str,
required=True,
choices=[V2_MODE, V1_MODE],
help=f"Which release to perform. '{V2_MODE}' uses main as the source branch and v2 as the target branch. " +
f"'{V1_MODE}' uses v2 as the source branch and v1 as the target branch."
help=f"Which release to perform. '{V2_MODE}' uses {SOURCE_BRANCH_FOR_MODE[V2_MODE]} as the source " +
f"branch and {TARGET_BRANCH_FOR_MODE[V2_MODE]} as the target branch. " +
f"'{V1_MODE}' uses {SOURCE_BRANCH_FOR_MODE[V1_MODE]} as the source branch and " +
f"{TARGET_BRANCH_FOR_MODE[V1_MODE]} as the target branch."
)
parser.add_argument(
'--conductor',
@@ -203,14 +217,8 @@ def main():

args = parser.parse_args()

if args.mode == V2_MODE:
source_branch = 'main'
target_branch = 'v2'
elif args.mode == V1_MODE:
source_branch = 'v2'
target_branch = 'v1'
else:
raise ValueError(f"Unexpected value for release mode: '{args.mode}'")
source_branch = SOURCE_BRANCH_FOR_MODE[args.mode]
target_branch = TARGET_BRANCH_FOR_MODE[args.mode]

repo = Github(args.github_token).get_repo(args.repository_nwo)
version = get_current_version()
@@ -246,10 +254,15 @@ def main():
# Create the new branch and push it to the remote
print('Creating branch ' + new_branch_name)

# The process of creating the v1 release can run into merge conflicts. We commit the unresolved
# conflicts so a maintainer can easily resolve them (vs erroring and requiring maintainers to
# reconstruct the release manually)
conflicted_files = []

if args.mode == V1_MODE:
# If we're performing a backport, start from the v1 branch
print(f'Creating {new_branch_name} from the {ORIGIN}/v1 branch')
run_git('checkout', '-b', new_branch_name, f'{ORIGIN}/v1')
# If we're performing a backport, start from the target branch
print(f'Creating {new_branch_name} from the {ORIGIN}/{target_branch} branch')
run_git('checkout', '-b', new_branch_name, f'{ORIGIN}/{target_branch}')

# Revert the commit that we made as part of the last release that updated the version number and
# changelog to refer to 1.x.x variants. This avoids merge conflicts in the changelog and
@@ -274,7 +287,12 @@ def main():
print(' Nothing to revert.')

print(f'Merging {ORIGIN}/{source_branch} into the release prep branch')
run_git('merge', f'{ORIGIN}/{source_branch}', '--no-edit')
# Commit any conflicts (see the comment for `conflicted_files`)
run_git('merge', f'{ORIGIN}/{source_branch}', allow_non_zero_exit_code=True)
conflicted_files = run_git('diff', '--name-only', '--diff-filter', 'U').splitlines()
if len(conflicted_files) > 0:
run_git('add', '.')
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}')
@@ -317,6 +335,7 @@ def main():
conductor=args.conductor,
is_v2_release=args.mode == V2_MODE,
labels=['Update dependencies'] if args.mode == V1_MODE else [],
conflicted_files=conflicted_files
)

if __name__ == '__main__':
4 changes: 2 additions & 2 deletions .github/workflows/__analyze-ref-input.yml

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

4 changes: 2 additions & 2 deletions .github/workflows/__debug-artifacts.yml

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

4 changes: 2 additions & 2 deletions .github/workflows/__extractor-ram-threads.yml

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

4 changes: 2 additions & 2 deletions .github/workflows/__go-custom-queries.yml

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

4 changes: 2 additions & 2 deletions .github/workflows/__go-custom-tracing-autobuild.yml

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

4 changes: 2 additions & 2 deletions .github/workflows/__go-custom-tracing.yml

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

4 changes: 2 additions & 2 deletions .github/workflows/__javascript-source-root.yml

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

4 changes: 2 additions & 2 deletions .github/workflows/__ml-powered-queries.yml

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

4 changes: 2 additions & 2 deletions .github/workflows/__multi-language-autodetect.yml

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

4 changes: 2 additions & 2 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.

4 changes: 2 additions & 2 deletions .github/workflows/__packaging-config-js.yml

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

4 changes: 2 additions & 2 deletions .github/workflows/__packaging-inputs-js.yml

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

4 changes: 2 additions & 2 deletions .github/workflows/__remote-config.yml

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

4 changes: 2 additions & 2 deletions .github/workflows/__rubocop-multi-language.yml

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

4 changes: 2 additions & 2 deletions .github/workflows/__split-workflow.yml

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

67 changes: 67 additions & 0 deletions .github/workflows/__test-autobuild-working-dir.yml

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

4 changes: 2 additions & 2 deletions .github/workflows/__test-local-codeql.yml

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

4 changes: 2 additions & 2 deletions .github/workflows/__test-proxy.yml

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

4 changes: 2 additions & 2 deletions .github/workflows/__test-ruby.yml

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

4 changes: 2 additions & 2 deletions .github/workflows/__unset-environment.yml

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

Loading