Skip to content

Commit

Permalink
Merge branch 'main' into henrymercer/zstd-stream
Browse files Browse the repository at this point in the history
  • Loading branch information
henrymercer committed Oct 14, 2024
2 parents 7d365b9 + b0b722f commit 5f519a3
Show file tree
Hide file tree
Showing 15 changed files with 115 additions and 7 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/post-release-mergeback.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,17 @@ jobs:
# - `--force` since we're overwriting the `vN` tag
git push origin --atomic --force refs/tags/"${VERSION}" refs/tags/"${major_version_tag}"
- name: Prepare partial Changelog
env:
PARTIAL_CHANGELOG: "${{ runner.temp }}/partial_changelog.md"
VERSION: "${{ steps.getVersion.outputs.version }}"
run: |
python .github/workflows/script/prepare_changelog.py CHANGELOG.md "$VERSION" > $PARTIAL_CHANGELOG
echo "::group::Partial CHANGELOG"
cat $PARTIAL_CHANGELOG
echo "::endgroup::"
- name: Create mergeback branch
if: ${{ steps.check.outputs.exists != 'true' && endsWith(github.ref_name, steps.getVersion.outputs.latest_release_branch) }}
env:
Expand Down Expand Up @@ -150,3 +161,16 @@ jobs:
--body "${pr_body}" \
--assignee "${GITHUB_ACTOR}" \
--draft
- name: Create the GitHub release
env:
PARTIAL_CHANGELOG: "${{ runner.temp }}/partial_changelog.md"
VERSION: "${{ steps.getVersion.outputs.version }}"
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
# Do not mark this release as latest. The most recent CLI release must be marked as latest.
gh release create \
"$VERSION" \
--latest=false \
--title "$VERSION" \
--notes-file "$PARTIAL_CHANGELOG"
37 changes: 37 additions & 0 deletions .github/workflows/script/prepare_changelog.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import os
import sys

EMPTY_CHANGELOG = 'No changes.\n\n'

# Prepare the changelog for the new release
# This function will extract the part of the changelog that
# we want to include in the new release.
def extract_changelog_snippet(changelog_file, version_tag):
output = ''
if (not os.path.exists(changelog_file)):
output = EMPTY_CHANGELOG

else:
with open('CHANGELOG.md', 'r') as f:
lines = f.readlines()

# Include everything up to, but excluding the second heading
found_first_section = False
for i, line in enumerate(lines):
if line.startswith('## '):
if found_first_section:
break
found_first_section = True
output += line

output += f"See the full [CHANGELOG.md](https://github.com/github/codeql-action/blob/{version_tag}/CHANGELOG.md) for more information."

return output


if len(sys.argv) < 3:
raise Exception('Expecting argument: changelog_file version_tag')
changelog_file = sys.argv[1]
version_tag = sys.argv[2]

print(extract_changelog_snippet(changelog_file, version_tag))
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ Note that the only difference between `v2` and `v3` of the CodeQL Action is the

No user facing changes.

## 3.26.13 - 14 Oct 2024

No user facing changes.

## 3.26.12 - 07 Oct 2024

- _Upcoming breaking change_: Add a deprecation warning for customers using CodeQL version 2.14.5 and earlier. These versions of CodeQL were discontinued on 24 September 2024 alongside GitHub Enterprise Server 3.10, and will be unsupported by CodeQL Action versions 3.27.0 and later and versions 2.27.0 and later. [#2520](https://github.com/github/codeql-action/pull/2520)
Expand Down
8 changes: 8 additions & 0 deletions lib/feature-flags.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/feature-flags.js.map

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions lib/init-action.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/init-action.js.map

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions lib/tools-features.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/tools-features.js.map

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

2 changes: 1 addition & 1 deletion node_modules/.package-lock.json

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

4 changes: 2 additions & 2 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "codeql",
"version": "3.26.13",
"version": "3.26.14",
"private": true,
"description": "CodeQL action",
"scripts": {
Expand Down
7 changes: 7 additions & 0 deletions src/feature-flags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ export interface FeatureEnablement {
export enum Feature {
ArtifactV4Upgrade = "artifact_v4_upgrade",
CleanupTrapCaches = "cleanup_trap_caches",
CodeqlActionPythonDefaultIsToNotExtractStdlib = "codeql_action_python_default_is_to_not_extract_stdlib",
CppDependencyInstallation = "cpp_dependency_installation_enabled",
DisableCsharpBuildless = "disable_csharp_buildless",
DisableJavaBuildlessEnabled = "disable_java_buildless_enabled",
Expand Down Expand Up @@ -98,6 +99,12 @@ export const featureConfig: Record<
envVar: "CODEQL_ACTION_CLEANUP_TRAP_CACHES",
minimumVersion: undefined,
},
[Feature.CodeqlActionPythonDefaultIsToNotExtractStdlib]: {
defaultValue: false,
envVar: "CODEQL_ACTION_DISABLE_PYTHON_STANDARD_LIBRARY_EXTRACTION",
minimumVersion: undefined,
toolsFeature: ToolsFeature.PythonDefaultIsToNotExtractStdlib,
},
[Feature.CppDependencyInstallation]: {
defaultValue: false,
envVar: "CODEQL_EXTRACTOR_CPP_AUTOINSTALL_DEPENDENCIES",
Expand Down
18 changes: 18 additions & 0 deletions src/init-action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -612,6 +612,24 @@ async function run() {
);
}

if (
await codeql.supportsFeature(
ToolsFeature.PythonDefaultIsToNotExtractStdlib,
)
) {
// We are in the case where the default has switched to not extracting the stdlib.
if (
!(await features.getValue(
Feature.CodeqlActionPythonDefaultIsToNotExtractStdlib,
codeql,
))
) {
// We are in a situation where the feature flag is not rolled out,
// so we need to suppress the new default behavior.
core.exportVariable("CODEQL_EXTRACTOR_PYTHON_EXTRACT_STDLIB", "true");
}
}

const sourceRoot = path.resolve(
getRequiredEnvParam("GITHUB_WORKSPACE"),
getOptionalInput("source-root") || "",
Expand Down
1 change: 1 addition & 0 deletions src/tools-features.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export enum ToolsFeature {
TraceCommandUseBuildMode = "traceCommandUseBuildMode",
SarifMergeRunsFromEqualCategory = "sarifMergeRunsFromEqualCategory",
ForceOverwrite = "forceOverwrite",
PythonDefaultIsToNotExtractStdlib = "pythonDefaultIsToNotExtractStdlib",
}

/**
Expand Down

0 comments on commit 5f519a3

Please sign in to comment.