main 98594d0

README.md RawHistoryFolder

Running the runner's expression engine

runner.csproj compiles src/Sdk/DTExpressions2 (the Expressions2 engine the runner uses on github.com), its ContextData types and DTLogging from a clone of https://github.com/actions/runner, replacing the few assemblies they need by the stubs in Stubs.cs. Program.cs reads {"contexts": {...}, "cases": [{"e": "<expression>"}]} and prints one JSON line per case: {"k": kind, "s": string form, "j": toJSON of the result}, or {"err": {"t": "parse"|"eval", "m": message}}.

Requirements (checked, not assumed):

  • a clone of https://github.com/actions/runner at the commit in runner-commit.txt (5f0b3ddcc6ee9fe9441e00d55e85b94ea4aad798), clean in src/Sdk. RunnerSrc has no default: the build fails without it.
  • the .NET SDK (the project targets net9.0) and a 9.0.x runtime (dotnet --list-runtimes): number formatting and case folding come from the runtime, and env.mjs refuses to run on another line. No global.json pins the SDK because any SDK that can build net9.0 works (the author's machine has SDK 10 with the 9.0 runtime); the runtime is what matters and is asserted.

Build and run:

dotnet build -c Release expr/gen/runner -p:RunnerSrc=$RUNNER_CLONE/src/Sdk
RUNNER_CLONE=<clone> node expr/gen/runner/answers.mjs | gzip -9 -n > expr/testdata/runner.json.gz

The other scripts (goldens.mjs, ordinal_cases.mjs, number_cases.mjs, fromjson_cases.mjs) use the same environment (env.mjs); runner.dll input.json can also be run by hand. TestRunnerCommit checks that the recorded data, runner-commit.txt and PORTING.md name the same commit.

It is how the C# column of expr/PORTING.md was established: the 34 765 expressions of testdata/oracle.json.gz were run through it and compared with this package. Requires the .NET SDK; nothing in go test depends on it. The stubs are not the runner's code: JsonUtility.ToString is JsonConvert.SerializeObject and the error resources are copied texts.

source
1# Running the runner's expression engine
2
3`runner.csproj` compiles `src/Sdk/DTExpressions2` (the Expressions2 engine the
4runner uses on github.com), its `ContextData` types and `DTLogging` from a clone
5of https://github.com/actions/runner, replacing the few assemblies they need by
6the stubs in `Stubs.cs`. `Program.cs` reads
7`{"contexts": {...}, "cases": [{"e": "<expression>"}]}` and prints one JSON line
8per case: `{"k": kind, "s": string form, "j": toJSON of the result}`, or
9`{"err": {"t": "parse"|"eval", "m": message}}`.
10
11Requirements (checked, not assumed):
12
13- a clone of https://github.com/actions/runner at the commit in
14  `runner-commit.txt` (`5f0b3ddcc6ee9fe9441e00d55e85b94ea4aad798`), clean in
15  `src/Sdk`. `RunnerSrc` has no default: the build fails without it.
16- the .NET SDK (the project targets `net9.0`) and a **9.0.x runtime**
17  (`dotnet --list-runtimes`): number formatting and case folding come from the
18  runtime, and `env.mjs` refuses to run on another line. No `global.json` pins
19  the SDK because any SDK that can build `net9.0` works (the author's machine
20  has SDK 10 with the 9.0 runtime); the runtime is what matters and is asserted.
21
22Build and run:
23
24    dotnet build -c Release expr/gen/runner -p:RunnerSrc=$RUNNER_CLONE/src/Sdk
25    RUNNER_CLONE=<clone> node expr/gen/runner/answers.mjs | gzip -9 -n > expr/testdata/runner.json.gz
26
27The other scripts (`goldens.mjs`, `ordinal_cases.mjs`, `number_cases.mjs`,
28`fromjson_cases.mjs`) use the same environment (`env.mjs`); `runner.dll
29input.json` can also be run by hand. `TestRunnerCommit` checks that the
30recorded data, `runner-commit.txt` and `PORTING.md` name the same commit.
31
32It is how the C# column of `expr/PORTING.md` was established: the 34 765
33expressions of `testdata/oracle.json.gz` were run through it and compared with
34this package. Requires the .NET SDK; nothing in `go test` depends on it.
35The stubs are not the runner's code: `JsonUtility.ToString` is
36`JsonConvert.SerializeObject` and the error resources are copied texts.

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 1

Tags 3

↑↓ moveenter openesc close