Skip to content

Commit ad7beb2

Browse files
1.2.0: one series, mcppls payloads by S6, test results as mcpp states them, ok images tested as they run (#5)
Co-authored-by: speak-agent <248744407+speak-agent@users.noreply.github.com>
1 parent 497becb commit ad7beb2

84 files changed

Lines changed: 3049 additions & 577 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/components.tsv‎

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# The components of this repository, by path (README "Versions"; .github/scripts/changes.sh). One
2+
# `<component>\t<pattern>` line each; a pattern is a shell `case` glob over the path from the
3+
# repository's root, in which `*` crosses `/`. The first line that matches a path names its component;
4+
# a path no line matches, and the component `all`, run every job.
5+
#
6+
# `@core <component>`: the component whose change reaches every other (each plugin is tested over it).
7+
@core backend
8+
# backend: the program every editor package carries, its protocol, the editors' declarations spec/
9+
# generates, the graph page, and their tests.
10+
backend src/*
11+
backend protocol/*
12+
backend spec/*
13+
backend webui/*
14+
backend testsupport/*
15+
backend tests/*
16+
backend mcpp.toml
17+
backend mcpp.lock
18+
backend build.mcpp
19+
# The editor plugins, each tested over the backend of the change it is made against.
20+
vscode mide-plugins/vscode/*
21+
clion mide-plugins/clion/*
22+
nvim mide-plugins/nvim/*
23+
# What only people read.
24+
docs docs/*
25+
docs agents/*
26+
docs *.md
27+
docs LICENSE
28+
# The workflows, the scripts and the pins every job runs with.
29+
all .github/*

‎.github/scripts/changes.sh‎

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
#!/usr/bin/env bash
2+
# The components a change reaches, from .github/components.tsv (README "Versions").
3+
#
4+
# changes.sh <changed-paths-file> prints `<component>=true|false`, `full=`, each flag, and `digest=`
5+
#
6+
# EVENT, BASE_REF and HEAD_REF (the workflow's event and a pull request's branches) decide a full run:
7+
# anything but a pull request, and a pull request from or into a release branch, reaches every component.
8+
# Otherwise each path reaches the component of the first line of the table that matches it; a path no
9+
# line matches, or one of `all`, reaches every component; and a change of the `@core` component reaches
10+
# every other, since each is tested over it. A `@flag` is a pull request's question: true when a changed
11+
# path matches it, or when the pull request is from or into a release branch; false for any other event.
12+
#
13+
# `digest` names the core's inputs (the blobs of every path of the core and of `all`), so a run that built
14+
# the core from the same inputs can lend what it built to a run that did not change them.
15+
set -euo pipefail
16+
root="$(cd "$(dirname "$0")/../.." && pwd)"
17+
table="$root/.github/components.tsv"
18+
changed="${1:?the file of changed paths}"
19+
20+
rows=(); flags=(); core=""; components=()
21+
while IFS= read -r line; do
22+
case "$line" in ''|'#'*) continue ;; esac
23+
case "$line" in
24+
@core$'\t'*) core="${line#*$'\t'}" ;;
25+
@flag\ *) flags+=("${line#@flag }") ;;
26+
*) rows+=("$line")
27+
name="${line%%$'\t'*}"
28+
[ "$name" = all ] || [[ " ${components[*]} " == *" $name "* ]] || components+=("$name") ;;
29+
esac
30+
done < "$table"
31+
32+
declare -A reached=() flagged=() printed=()
33+
full=false
34+
release=false
35+
case "${EVENT:-}" in pull_request) ;; *) full=true ;; esac
36+
case "${BASE_REF:-}" in release/*) full=true; release=true ;; esac
37+
case "${HEAD_REF:-}" in release/*) full=true; release=true ;; esac
38+
39+
while IFS= read -r path; do
40+
[ -n "$path" ] || continue
41+
component=""
42+
for row in "${rows[@]}"; do
43+
name="${row%%$'\t'*}"; pattern="${row#*$'\t'}"
44+
# shellcheck disable=SC2254
45+
case "$path" in $pattern) component="$name"; break ;; esac
46+
done
47+
if [ -z "$component" ] || [ "$component" = all ]; then
48+
echo "every component: $path" >&2
49+
full=true
50+
else
51+
reached[$component]=true
52+
fi
53+
for flag in "${flags[@]}"; do
54+
name="${flag%%$'\t'*}"; pattern="${flag#*$'\t'}"
55+
# shellcheck disable=SC2254
56+
case "$path" in $pattern) flagged[$name]=true ;; esac
57+
done
58+
done < "$changed"
59+
60+
if [ "$full" = true ] || { [ -n "$core" ] && [ "${reached[$core]:-}" = true ]; }; then
61+
for c in "${components[@]}"; do reached[$c]=true; done
62+
fi
63+
for c in "${components[@]}"; do echo "$c=${reached[$c]:-false}"; done
64+
echo "full=$full"
65+
for flag in "${flags[@]}"; do
66+
name="${flag%%$'\t'*}"
67+
[ "$release" = true ] && flagged[$name]=true
68+
[ "${EVENT:-}" = pull_request ] || flagged[$name]=false
69+
[ -n "${printed[$name]:-}" ] && continue
70+
printed[$name]=1
71+
echo "$name=${flagged[$name]:-false}"
72+
done
73+
74+
# The core's inputs: every tracked path the table gives to the core or to `all`.
75+
mapfile -t inputs < <(for row in "${rows[@]}"; do
76+
name="${row%%$'\t'*}"; pattern="${row#*$'\t'}"
77+
if [ "$name" = "$core" ] || [ "$name" = all ]; then echo "${pattern%%\**}"; fi
78+
done | sort -u)
79+
digest=$(cd "$root" && git ls-files -s -- "${inputs[@]}" | sha256sum | cut -c1-24)
80+
echo "digest=$digest"

‎.github/scripts/release-plan.sh‎

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
#!/usr/bin/env bash
2+
# release-plan.sh [TAG] -- the components a release tag publishes, and its version (design 2026-11-07, D15).
3+
#
4+
# A version is X.Y.Z: X.Y, the series, is shared by the backend and every editor plugin; Z is each
5+
# component's own patch. Two kinds of tag:
6+
#
7+
# vX.Y.0 a series release: every component, each at X.Y.0
8+
# <component>-vX.Y.Z one component's patch: backend, vscode, clion or nvim, at X.Y.Z
9+
#
10+
# Prints `components=...`, `version=...` and `title=...` for $GITHUB_OUTPUT. Without a tag it only
11+
# checks that every component states one series and the backend's two statements agree (CI).
12+
set -euo pipefail
13+
root="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
14+
declare -A version
15+
version[backend]="$(sed -n 's/^version *= *"\(.*\)"/\1/p' "$root/mcpp.toml" | head -1)"
16+
version[vscode]="$(sed -n 's/^ "version": "\(.*\)",$/\1/p' "$root/mide-plugins/vscode/package.json" | head -1)"
17+
version[clion]="$(sed -n 's/^pluginVersion *= *\(.*\)$/\1/p' "$root/mide-plugins/clion/gradle.properties" | head -1)"
18+
version[nvim]="$(sed -n "s/^M.version = '\(.*\)'$/\1/p" "$root/mide-plugins/nvim/lua/mcpp/session.lua" | head -1)"
19+
backend_source="$(sed -n 's/^inline constexpr std::string_view kVersion = "\(.*\)";$/\1/p' "$root/src/server.cppm" | head -1)"
20+
series_source="$(sed -n 's/^inline constexpr std::string_view kSeries = "\(.*\)";$/\1/p' "$root/src/server.cppm" | head -1)"
21+
fail() { echo "release-plan: $*" >&2; exit 1; }
22+
series() { [[ "$1" =~ ^([0-9]+)\.([0-9]+)\.[0-9]+$ ]] && echo "${BASH_REMATCH[1]}.${BASH_REMATCH[2]}"; }
23+
24+
for c in backend vscode clion nvim; do
25+
[ -n "${version[$c]}" ] && [ -n "$(series "${version[$c]}")" ] || fail "$c states no X.Y.Z version (${version[$c]:-none})"
26+
done
27+
[ "$backend_source" = "${version[backend]}" ] || fail "src/server.cppm says $backend_source and mcpp.toml ${version[backend]}"
28+
the_series="$(series "${version[backend]}")"
29+
[ "$series_source" = "$the_series" ] || fail "src/server.cppm's kSeries is $series_source, the backend's series $the_series"
30+
for c in vscode clion nvim; do
31+
[ "$(series "${version[$c]}")" = "$the_series" ] \
32+
|| fail "$c is ${version[$c]}, of another series than the backend's ${version[backend]}"
33+
done
34+
35+
tag="${1:-}"
36+
if [ -z "$tag" ]; then
37+
echo "one series $the_series: backend ${version[backend]}, vscode ${version[vscode]}, clion ${version[clion]}, nvim ${version[nvim]}"
38+
exit 0
39+
fi
40+
if [[ "$tag" =~ ^v([0-9]+\.[0-9]+\.0)$ ]]; then
41+
v="${BASH_REMATCH[1]}"
42+
for c in backend vscode clion nvim; do
43+
[ "${version[$c]}" = "$v" ] || fail "the series release $tag needs every component at $v; $c is ${version[$c]}"
44+
done
45+
echo "components=backend vscode clion nvim"
46+
echo "version=$v"
47+
echo "title=mcpp-ide $v"
48+
elif [[ "$tag" =~ ^(backend|vscode|clion|nvim)-v([0-9]+\.[0-9]+\.[0-9]+)$ ]]; then
49+
c="${BASH_REMATCH[1]}"; v="${BASH_REMATCH[2]}"
50+
[ "${version[$c]}" = "$v" ] || fail "the tag $tag names $c $v, and $c is ${version[$c]}"
51+
declare -A names=([backend]=mcpp-ide [vscode]=mcpp-vscode [clion]=mcpp-clion [nvim]=mcpp-nvim)
52+
echo "components=$c"
53+
echo "version=$v"
54+
echo "title=${names[$c]} $v"
55+
else
56+
fail "$tag is neither vX.Y.0 nor <backend|vscode|clion|nvim>-vX.Y.Z"
57+
fi

‎.github/scripts/test_changes.sh‎

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
#!/usr/bin/env bash
2+
# The classification of .github/scripts/changes.sh, on lists of paths.
3+
set -euo pipefail
4+
here="$(cd "$(dirname "$0")" && pwd)"
5+
failures=0
6+
check() { # check <description> <event> <expected key=value...> -- <paths...>
7+
local what="$1" event="$2"; shift 2
8+
local want=()
9+
while [ "$1" != -- ]; do want+=("$1"); shift; done
10+
shift
11+
local list; list=$(mktemp)
12+
printf '%s\n' "$@" > "$list"
13+
local base=main
14+
[ "$event" = pull_request_release ] && { event=pull_request; base=release/1.2.0; }
15+
local got; got=$(EVENT="$event" BASE_REF="$base" HEAD_REF=topic bash "$here/changes.sh" "$list" 2>/dev/null)
16+
rm -f "$list"
17+
for kv in "${want[@]}"; do
18+
if ! grep -qx "$kv" <<<"$got"; then
19+
echo "FAIL: $what: wanted $kv, got: $(tr '\n' ' ' <<<"$got")"
20+
failures=$((failures + 1))
21+
fi
22+
done
23+
}
24+
check "a plugin alone" pull_request backend=false clion=true vscode=false nvim=false full=false -- mide-plugins/clion/src/main/kotlin/X.kt
25+
check "its README is the plugin's" pull_request vscode=true docs=false backend=false -- mide-plugins/vscode/README.md
26+
check "documentation alone" pull_request docs=true backend=false vscode=false -- docs/x.md README.md
27+
check "the backend reaches every plugin" pull_request backend=true vscode=true clion=true nvim=true -- src/main.cpp
28+
check "spec/ is the backend's" pull_request backend=true vscode=true -- spec/test-frameworks.json
29+
check "a workflow reaches everything" pull_request full=true backend=true -- .github/workflows/ci.yml
30+
check "a path of no component reaches everything" pull_request full=true -- newdir/x
31+
check "a push reaches everything" push full=true backend=true -- docs/x.md
32+
check "a release branch reaches everything" pull_request_release full=true -- docs/x.md
33+
list=$(mktemp); echo docs/x.md > "$list"
34+
d=$(EVENT=pull_request bash "$here/changes.sh" "$list" 2>/dev/null | sed -n 's/^digest=//p'); rm -f "$list"
35+
[ "${#d}" -eq 24 ] || { echo "FAIL: no digest"; failures=$((failures + 1)); }
36+
[ "$failures" -eq 0 ] && echo "test_changes: every case held"
37+
exit "$failures"

‎.github/versions.env‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# The versions CI builds and tests with, in one file; .github/actions/setup-mcpp exports them.
22
# The published bootstrap; the project explicitly selects platform 0.24.
3-
MCPP_VERSION=2026.11.5.1
3+
MCPP_VERSION=2026.11.7.2
44
# A ref of mcpp-community/mcpp CI builds mcpp from and uses instead, for a contract not yet released.
55
# Empty: the release above is used.
66
MCPP_SOURCE_REF=
77
# The LLVM the backend builds with on macOS and Windows (the targets mcpp reaches there with it).
88
LLVM_VERSION=23.1.3
9-
# The xlings mcpp 2026.11.5.1 bundles, which reads the current index.
9+
# The xlings mcpp 2026.11.7.2 bundles, which reads the current index.
1010
XLINGS_VERSION=v2026.10.26.1
1111
# The oldest VS Code the extension supports (engines.vscode), which its tests run in.
1212
VSCODE_VERSION=1.91.0

0 commit comments

Comments
 (0)