Skip to content

Commit 5f519a3

Browse files
committed
Merge branch 'main' into henrymercer/zstd-stream
2 parents 7d365b9 + b0b722f commit 5f519a3

15 files changed

+115
-7
lines changed

.github/workflows/post-release-mergeback.yml

+24
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,17 @@ jobs:
108108
# - `--force` since we're overwriting the `vN` tag
109109
git push origin --atomic --force refs/tags/"${VERSION}" refs/tags/"${major_version_tag}"
110110
111+
- name: Prepare partial Changelog
112+
env:
113+
PARTIAL_CHANGELOG: "${{ runner.temp }}/partial_changelog.md"
114+
VERSION: "${{ steps.getVersion.outputs.version }}"
115+
run: |
116+
python .github/workflows/script/prepare_changelog.py CHANGELOG.md "$VERSION" > $PARTIAL_CHANGELOG
117+
118+
echo "::group::Partial CHANGELOG"
119+
cat $PARTIAL_CHANGELOG
120+
echo "::endgroup::"
121+
111122
- name: Create mergeback branch
112123
if: ${{ steps.check.outputs.exists != 'true' && endsWith(github.ref_name, steps.getVersion.outputs.latest_release_branch) }}
113124
env:
@@ -150,3 +161,16 @@ jobs:
150161
--body "${pr_body}" \
151162
--assignee "${GITHUB_ACTOR}" \
152163
--draft
164+
165+
- name: Create the GitHub release
166+
env:
167+
PARTIAL_CHANGELOG: "${{ runner.temp }}/partial_changelog.md"
168+
VERSION: "${{ steps.getVersion.outputs.version }}"
169+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
170+
run: |
171+
# Do not mark this release as latest. The most recent CLI release must be marked as latest.
172+
gh release create \
173+
"$VERSION" \
174+
--latest=false \
175+
--title "$VERSION" \
176+
--notes-file "$PARTIAL_CHANGELOG"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
import os
2+
import sys
3+
4+
EMPTY_CHANGELOG = 'No changes.\n\n'
5+
6+
# Prepare the changelog for the new release
7+
# This function will extract the part of the changelog that
8+
# we want to include in the new release.
9+
def extract_changelog_snippet(changelog_file, version_tag):
10+
output = ''
11+
if (not os.path.exists(changelog_file)):
12+
output = EMPTY_CHANGELOG
13+
14+
else:
15+
with open('CHANGELOG.md', 'r') as f:
16+
lines = f.readlines()
17+
18+
# Include everything up to, but excluding the second heading
19+
found_first_section = False
20+
for i, line in enumerate(lines):
21+
if line.startswith('## '):
22+
if found_first_section:
23+
break
24+
found_first_section = True
25+
output += line
26+
27+
output += f"See the full [CHANGELOG.md](https://github.com/github/codeql-action/blob/{version_tag}/CHANGELOG.md) for more information."
28+
29+
return output
30+
31+
32+
if len(sys.argv) < 3:
33+
raise Exception('Expecting argument: changelog_file version_tag')
34+
changelog_file = sys.argv[1]
35+
version_tag = sys.argv[2]
36+
37+
print(extract_changelog_snippet(changelog_file, version_tag))

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ Note that the only difference between `v2` and `v3` of the CodeQL Action is the
88

99
No user facing changes.
1010

11+
## 3.26.13 - 14 Oct 2024
12+
13+
No user facing changes.
14+
1115
## 3.26.12 - 07 Oct 2024
1216

1317
- _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)

lib/feature-flags.js

+8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/feature-flags.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/init-action.js

+8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/init-action.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/tools-features.js

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/tools-features.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

node_modules/.package-lock.json

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package-lock.json

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "codeql",
3-
"version": "3.26.13",
3+
"version": "3.26.14",
44
"private": true,
55
"description": "CodeQL action",
66
"scripts": {

src/feature-flags.ts

+7
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ export interface FeatureEnablement {
4747
export enum Feature {
4848
ArtifactV4Upgrade = "artifact_v4_upgrade",
4949
CleanupTrapCaches = "cleanup_trap_caches",
50+
CodeqlActionPythonDefaultIsToNotExtractStdlib = "codeql_action_python_default_is_to_not_extract_stdlib",
5051
CppDependencyInstallation = "cpp_dependency_installation_enabled",
5152
DisableCsharpBuildless = "disable_csharp_buildless",
5253
DisableJavaBuildlessEnabled = "disable_java_buildless_enabled",
@@ -98,6 +99,12 @@ export const featureConfig: Record<
9899
envVar: "CODEQL_ACTION_CLEANUP_TRAP_CACHES",
99100
minimumVersion: undefined,
100101
},
102+
[Feature.CodeqlActionPythonDefaultIsToNotExtractStdlib]: {
103+
defaultValue: false,
104+
envVar: "CODEQL_ACTION_DISABLE_PYTHON_STANDARD_LIBRARY_EXTRACTION",
105+
minimumVersion: undefined,
106+
toolsFeature: ToolsFeature.PythonDefaultIsToNotExtractStdlib,
107+
},
101108
[Feature.CppDependencyInstallation]: {
102109
defaultValue: false,
103110
envVar: "CODEQL_EXTRACTOR_CPP_AUTOINSTALL_DEPENDENCIES",

src/init-action.ts

+18
Original file line numberDiff line numberDiff line change
@@ -612,6 +612,24 @@ async function run() {
612612
);
613613
}
614614

615+
if (
616+
await codeql.supportsFeature(
617+
ToolsFeature.PythonDefaultIsToNotExtractStdlib,
618+
)
619+
) {
620+
// We are in the case where the default has switched to not extracting the stdlib.
621+
if (
622+
!(await features.getValue(
623+
Feature.CodeqlActionPythonDefaultIsToNotExtractStdlib,
624+
codeql,
625+
))
626+
) {
627+
// We are in a situation where the feature flag is not rolled out,
628+
// so we need to suppress the new default behavior.
629+
core.exportVariable("CODEQL_EXTRACTOR_PYTHON_EXTRACT_STDLIB", "true");
630+
}
631+
}
632+
615633
const sourceRoot = path.resolve(
616634
getRequiredEnvParam("GITHUB_WORKSPACE"),
617635
getOptionalInput("source-root") || "",

src/tools-features.ts

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ export enum ToolsFeature {
1010
TraceCommandUseBuildMode = "traceCommandUseBuildMode",
1111
SarifMergeRunsFromEqualCategory = "sarifMergeRunsFromEqualCategory",
1212
ForceOverwrite = "forceOverwrite",
13+
PythonDefaultIsToNotExtractStdlib = "pythonDefaultIsToNotExtractStdlib",
1314
}
1415

1516
/**

0 commit comments

Comments
 (0)