From 5655848f4994110a8886cf4b662e981ec2e32c66 Mon Sep 17 00:00:00 2001 From: Rahul Krishna Date: Wed, 22 Jul 2026 12:16:06 -0400 Subject: [PATCH 1/2] test: remove obsolete native-binary test (#290) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit test_get_codeanalyzer_exec asserted the old native invocation [sys.executable, -m, codeanalyzer_java], but there is no codeanalyzer-native build anymore — _get_codeanalyzer_exec() resolves a cached JDK and runs the bundled jar ([java, -jar, ]). The test failed in CI (masked by continue-on-error). Drop it and its now-unused `sys` import. --- tests/analysis/java/test_jcodeanalyzer.py | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/tests/analysis/java/test_jcodeanalyzer.py b/tests/analysis/java/test_jcodeanalyzer.py index f674c30..bec7931 100644 --- a/tests/analysis/java/test_jcodeanalyzer.py +++ b/tests/analysis/java/test_jcodeanalyzer.py @@ -19,7 +19,6 @@ """ import os -import sys import json from typing import Dict, List, Tuple from unittest.mock import patch, MagicMock @@ -197,27 +196,6 @@ def test_init_codeanalyzer_reuses_legacy_cache_when_compatible(test_fixture, cod assert compilation_unit.import_declarations[0].is_wildcard is False -def test_get_codeanalyzer_exec(test_fixture, analysis_json, tmp_path): - """Should resolve the codeanalyzer native binary command (packaged binary only).""" - - # Patch subprocess so that it does not run codeanalyzer - with patch("cldk.analysis.java.codeanalyzer.codeanalyzer.subprocess.run") as run_mock: - run_mock.return_value = MagicMock(stdout=analysis_json, returncode=0) - - code_analyzer = JCodeanalyzer( - project_dir=test_fixture, - source_code=None, - analysis_json_path=None, - analysis_level=AnalysisLevel.symbol_table, - eager_analysis=False, - target_files=None, - ) - - # The PyPI native binary, invoked via `python -m codeanalyzer_java`. There is no longer a - # backend-path override (the binary ships with the packaged dependency). - assert code_analyzer._get_codeanalyzer_exec() == [sys.executable, "-m", "codeanalyzer_java"] - - def test_generate_call_graph(test_fixture, analysis_json): """Should generate a graph""" From efd09bb0737d17b27b4c3e479d1771e19cdaac1f Mon Sep 17 00:00:00 2001 From: Rahul Krishna Date: Wed, 22 Jul 2026 12:16:06 -0400 Subject: [PATCH 2/2] ci: source release notes from CHANGELOG.md, fail on blank (#289) The label-based mikepenz changelog scraper emitted nothing for unlabeled release PRs ("Wrote 0 categorized pull requests"), blanking the GitHub release body and crashing the org-announcement step with 'Body can't be blank'. Extract the release body from the hand-written CHANGELOG.md section for the tag instead, and hard-fail the release if that section is empty. Drop the label-dependent scraper, the mis-wired changelog-reader step, and the orphaned release_config.json. --- .github/workflows/release.yml | 46 +++++++++++-------- .github/workflows/release_config.json | 65 --------------------------- 2 files changed, 27 insertions(+), 84 deletions(-) delete mode 100644 .github/workflows/release_config.json diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b8232c4..4768160 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -95,28 +95,36 @@ jobs: fi echo "codeanalyzer JAR present in wheel and sdist ✓" - - name: Read Changelog Entry - id: changelog_reader - uses: mindsers/changelog-reader-action@v2 - with: - validation_level: warn - version: ${{ steps.tag_name.outputs.current_version }} - path: ./CHANGELOG.md - - - name: Build Changelog - id: gen_changelog - uses: mikepenz/release-changelog-builder-action@v5 - with: - failOnError: "true" - configuration: .github/workflows/release_config.json - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Extract release notes from CHANGELOG.md + id: notes + # Source the release body from the hand-written CHANGELOG.md section for this tag — + # deterministic and independent of PR labels — and refuse to publish/announce a blank + # body. The previous label-based changelog scraper emitted nothing for unlabeled PRs, + # which blanked the release and crashed the org announcement. See issue #289. + run: | + set -euo pipefail + version="${GITHUB_REF#refs/tags/}" # e.g. v1.4.4 — matches the "## [v1.4.4]" heading + notes=$(awk -v h="## [$version]" ' + !seen && index($0, h) == 1 { seen = 1; next } + seen && index($0, "## [") == 1 { exit } + seen { print } + ' CHANGELOG.md | sed '/./,$!d' | tac | sed '/./,$!d' | tac) # strip blank edges + if [ -z "$notes" ]; then + echo "::error::No CHANGELOG.md entry for $version — refusing to publish a blank release." + exit 1 + fi + { + echo "notes<<__CHANGELOG_EOF__" + echo "$notes" + echo "__CHANGELOG_EOF__" + } >> "$GITHUB_OUTPUT" + echo "Release notes for $version:"; echo "$notes" - name: Publish Release on GitHub uses: softprops/action-gh-release@v2 with: files: dist/* - body: ${{ steps.gen_changelog.outputs.changelog }} + body: ${{ steps.notes.outputs.notes }} # Auto-open a repo-level Discussion linked to this release, seeded with # the same notes. Requires Discussions enabled and this category to exist. discussion_category_name: Announcements @@ -126,13 +134,13 @@ jobs: # Mirror the release announcement into the ORG-level discussions, which are # backed by codellm-devkit/.github. GITHUB_TOKEN can't write cross-repo, so # this uses a PAT (ORG_DISCUSSIONS_TOKEN) with repo scope, and posts via the - # createDiscussion GraphQL mutation. The body (the generated changelog) is + # createDiscussion GraphQL mutation. The body (the CHANGELOG.md notes) is # passed via env to avoid shell-injection, matching the repo-level post. - name: Announce in org-level discussions (codellm-devkit/.github) continue-on-error: true # a failed org post must not fail an otherwise-good release env: GH_TOKEN: ${{ secrets.ORG_DISCUSSIONS_TOKEN }} - BODY: ${{ steps.gen_changelog.outputs.changelog }} + BODY: ${{ steps.notes.outputs.notes }} run: | set -uo pipefail VERSION="${GITHUB_REF#refs/tags/v}" diff --git a/.github/workflows/release_config.json b/.github/workflows/release_config.json deleted file mode 100644 index 200120c..0000000 --- a/.github/workflows/release_config.json +++ /dev/null @@ -1,65 +0,0 @@ -{ - "categories": [ - { - "title": "## ✨ Release", - "labels": [ - "release" - ] - }, - { - "title": "## 🚀 Features", - "labels": [ - "kind/feature", - "enhancement" - ] - }, - { - "title": "## 🐛 Fixes", - "labels": [ - "fix", - "bug" - ] - }, - { - "title": "## ♻️ Refactoring", - "labels": [ - "refactoring" - ] - }, - { - "title": "## ⚡️ Performance Improvements", - "labels": [ - "performance" - ] - }, - { - "title": "## \uD83D\uDCDA Documentation", - "labels": [ - "documentation", - "doc" - ] - }, - { - "title": "## \uD83D\uDEA6 Tests", - "labels": [ - "test" - ] - }, - { - "title": "## \uD83D\uDEE0 Other Updates", - "labels": [ - "other", - "kind/dependency-change" - ] - }, - { - "title": "## 🚨 Breaking Changes", - "labels": [ - "breaking" - ] - } - ], - "ignore_labels": [ - "ignore" - ] -} \ No newline at end of file