Skip to content

Commit a56457a

Browse files
alexr-bqjbrinkmanYury-Fridlyandgithub-actions[bot]ort-bot
authored
Release 0.9 backport (#127)
Signed-off-by: jbrinkman <[email protected]> Signed-off-by: Joseph Brinkman <[email protected]> Signed-off-by: ort-bot <[email protected]> Signed-off-by: Alex Rehnby-Martin <[email protected]> Signed-off-by: Edward Liang <[email protected]> Signed-off-by: Joey Brinkman <[email protected]> Co-authored-by: jbrinkman <[email protected]> Co-authored-by: Yury-Fridlyand <[email protected]> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: ort-bot <[email protected]>
1 parent d03dbe3 commit a56457a

28 files changed

+2783
-480
lines changed

.github/dependabot.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ updates:
99
day: "monday"
1010
time: "09:00"
1111
open-pull-requests-limit: 10
12+
ignore:
13+
- dependency-name: "StackExchange.Redis"
1214
groups:
1315
patch-updates:
1416
update-types:

.github/json_matrices/server-matrix.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
[
22
{
33
"type": "valkey",
4-
"version": "8.1",
4+
"version": "9.0",
55
"run": "always"
66
},
7+
{
8+
"type": "valkey",
9+
"version": "8.1"
10+
},
711
{
812
"type": "valkey",
913
"version": "8.0"

.github/workflows/api-compatibility.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@ name: API Compatibility (Valkey.Glide vs StackExchange.Redis)
22

33
on:
44
pull_request:
5-
branches: [main]
5+
branches:
6+
- main
7+
- release-*
8+
- v*
69
workflow_dispatch:
710
inputs:
811
ser_version:

.github/workflows/cd.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
workflow_dispatch:
88
inputs:
99
version:
10-
description: "The release version of GLIDE, formatted as *.*.* or *.*.*-rc*"
10+
description: "The release version of GLIDE, formatted as v*.*.* or v*.*.*-rc*"
1111
required: true
1212
nuget_publish:
1313
description: "Publish to NuGet"
@@ -54,12 +54,14 @@ jobs:
5454
shell: bash
5555
run: |
5656
if ${{ github.event_name == 'workflow_dispatch' }}; then
57-
R_VERSION="${{ env.INPUT_VERSION }}"
57+
RAW_VERSION="${{ env.INPUT_VERSION }}"
5858
else
59-
R_VERSION=${{ github.ref_name }}
59+
RAW_VERSION=${{ github.ref_name }}
6060
fi
61+
# Strip leading 'v' if present
62+
R_VERSION="${RAW_VERSION#v}"
6163
echo "RELEASE_VERSION=${R_VERSION}" >> $GITHUB_ENV
62-
echo "Release version detected: $R_VERSION"
64+
echo "Release version detected: $R_VERSION (raw: $RAW_VERSION)"
6365
echo "RELEASE_VERSION=$R_VERSION" >> $GITHUB_OUTPUT
6466
env:
6567
INPUT_VERSION: ${{ github.event.inputs.version }}

.github/workflows/report-failures.yml

Lines changed: 49 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,62 @@ jobs:
1717
if: ${{ github.event.workflow_run.conclusion == 'failure' && (github.event.workflow_run.event == 'schedule' || github.event.workflow_run.event == 'workflow_dispatch') }}
1818
runs-on: ubuntu-latest
1919
steps:
20+
- name: Download inputs.json artifact (if present)
21+
id: inputs
22+
uses: dawidd6/action-download-artifact@v6
23+
continue-on-error: true
24+
with:
25+
run_id: ${{ github.event.workflow_run.id }}
26+
name: inputs.json
27+
path: inputs_artifact
28+
29+
- name: Gate on full-matrix runs
30+
id: gate
31+
uses: actions/github-script@v7
32+
with:
33+
github-token: ${{ github.token }}
34+
script: |
35+
const {owner, repo} = context.repo;
36+
const runId = context.payload.workflow_run.id;
37+
const event = context.payload.workflow_run.event;
38+
const { data: run } = await github.rest.actions.getWorkflowRun({ owner, repo, run_id: runId });
39+
const title = run.display_title || run.name || '';
40+
// Prefer inputs.json when workflow_dispatch
41+
let should = false;
42+
if (event === 'schedule') {
43+
should = true;
44+
} else if (event === 'workflow_dispatch') {
45+
try {
46+
const fs = require('fs');
47+
const path = 'inputs_artifact/inputs.json';
48+
if (fs.existsSync(path)) {
49+
const data = JSON.parse(fs.readFileSync(path, 'utf8'));
50+
const fm = !!(data.inputs && data.inputs['full-matrix']);
51+
should = fm;
52+
core.info(`Gate via inputs.json: full-matrix=${fm}`);
53+
} else {
54+
core.info('inputs.json not found; falling back to title gate');
55+
should = title.startsWith('C# Matrix Tests');
56+
}
57+
} catch (e) {
58+
core.warning(`Failed to read inputs.json: ${e}`);
59+
should = title.startsWith('C# Matrix Tests');
60+
}
61+
}
62+
core.info(`Trigger event: ${event}; run title: ${title}; should process: ${should}`);
63+
return should;
64+
2065
- name: Download artifacts from triggering run
21-
uses: dawidd6/action-download-artifact@v11
66+
uses: dawidd6/action-download-artifact@v6
67+
if: ${{ steps.gate.outputs.result == 'true' }}
2268
with:
2369
run_id: ${{ github.event.workflow_run.id }}
2470
path: downloaded
2571

2672
- name: Aggregate failures
2773
id: aggregate
2874
shell: bash
75+
if: ${{ steps.gate.outputs.result == 'true' }}
2976
run: |
3077
set -euo pipefail
3178
sudo apt-get update -y >/dev/null 2>&1 || true
@@ -117,6 +164,7 @@ jobs:
117164
- name: Find or create rolling failure issue
118165
id: ensure_issue
119166
uses: actions/github-script@v7
167+
if: ${{ steps.gate.outputs.result == 'true' }}
120168
env:
121169
SUMMARY_PATH: ${{ steps.aggregate.outputs.summary_path }}
122170
with:
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: "Run Coverage"
2+
description: "Run code coverage collection and upload artifacts"
3+
outputs:
4+
line-coverage:
5+
description: "Line coverage percentage"
6+
value: ${{ steps.extract-coverage.outputs.line-coverage }}
7+
branch-coverage:
8+
description: "Branch coverage percentage"
9+
value: ${{ steps.extract-coverage.outputs.branch-coverage }}
10+
runs:
11+
using: "composite"
12+
steps:
13+
- name: Install Task
14+
shell: bash
15+
run: |
16+
sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d -b /usr/local/bin
17+
18+
- name: Install reportgenerator
19+
shell: bash
20+
run: |
21+
dotnet tool install --global dotnet-reportgenerator-globaltool --version 5.4.12
22+
23+
- name: Build and run coverage
24+
shell: bash
25+
run: |
26+
task coverage FRAMEWORK=net8.0
27+
28+
- name: Extract coverage metrics
29+
id: extract-coverage
30+
shell: bash
31+
run: |
32+
if [ -f "reports/Summary.json" ]; then
33+
LINE_COVERAGE=$(cat reports/Summary.json | jq -r '.summary.linecoverage')
34+
BRANCH_COVERAGE=$(cat reports/Summary.json | jq -r '.summary.branchcoverage')
35+
echo "line-coverage=${LINE_COVERAGE}" >> $GITHUB_OUTPUT
36+
echo "branch-coverage=${BRANCH_COVERAGE}" >> $GITHUB_OUTPUT
37+
echo "=== Coverage Summary ==="
38+
echo "Line Coverage: ${LINE_COVERAGE}%"
39+
echo "Branch Coverage: ${BRANCH_COVERAGE}%"
40+
else
41+
echo "No coverage summary found."
42+
exit 1
43+
fi
44+
45+
- name: Upload coverage report artifact
46+
uses: actions/upload-artifact@v4
47+
with:
48+
name: coverage-report
49+
path: reports/
50+
51+
- name: Upload coverage results artifact
52+
uses: actions/upload-artifact@v4
53+
with:
54+
name: test-results
55+
path: testresults/

.github/workflows/tests.yml

Lines changed: 99 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ on:
66
- main
77
- release-*
88
- v*
9-
paths:
9+
1010
pull_request:
11-
paths:
11+
1212
workflow_dispatch:
1313
inputs:
1414
full-matrix:
@@ -19,6 +19,7 @@ on:
1919
required: false
2020
type: string
2121
description: "(Optional) Test run name"
22+
2223
schedule:
2324
- cron: "0 3 * * *"
2425

@@ -30,8 +31,8 @@ concurrency:
3031
cancel-in-progress: true
3132

3233
run-name:
33-
# Set custom name if job is started manually and name is given
34-
${{ github.event_name == 'workflow_dispatch' && (inputs.name == '' && format('{0} @ {1} {2}', github.ref_name, github.sha, toJson(inputs)) || inputs.name) || '' }}
34+
# Use a distinct name for full-matrix or scheduled runs; otherwise keep manual-dispatch naming behavior
35+
${{ (github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && github.event.inputs['full-matrix'] == 'true')) && 'C# Matrix Tests' || (github.event_name == 'workflow_dispatch' && (inputs.name == '' && format('{0} @ {1} {2}', github.ref_name, github.sha, toJson(inputs)) || inputs.name)) || '' }}
3536

3637
env:
3738
CARGO_TERM_COLOR: always
@@ -44,6 +45,33 @@ jobs:
4445
host-matrix-output: ${{ steps.get-matrices.outputs.os-matrix-output }}
4546
version-matrix-output: ${{ steps.get-matrices.outputs.version-matrix-output }}
4647
steps:
48+
- name: Write inputs.json
49+
uses: actions/github-script@v7
50+
with:
51+
script: |
52+
const fs = require('fs');
53+
fs.mkdirSync('.run-meta', {recursive: true});
54+
const event = context.eventName;
55+
const out = {event};
56+
if (event === 'workflow_dispatch') {
57+
const inputs = context.payload.inputs || {};
58+
const raw = inputs['full-matrix'];
59+
const fm = (raw === true) || (String(raw).toLowerCase() === 'true');
60+
out.inputs = {
61+
'full-matrix': fm,
62+
name: inputs.name || ''
63+
};
64+
}
65+
fs.writeFileSync('.run-meta/inputs.json', JSON.stringify(out));
66+
core.info(`inputs.json => ${JSON.stringify(out)}`);
67+
68+
- name: Upload inputs.json
69+
uses: actions/upload-artifact@v4
70+
with:
71+
name: inputs.json
72+
path: .run-meta/inputs.json
73+
if-no-files-found: error
74+
4775
- uses: actions/checkout@v5
4876
- id: get-matrices
4977
uses: ./.github/workflows/create-test-matrices
@@ -97,7 +125,35 @@ jobs:
97125
key: rust-${{ matrix.host.TARGET }}
98126

99127
- name: Test dotnet ${{ matrix.dotnet }}
100-
run: dotnet test --configuration Debug --framework net${{ matrix.dotnet }} --logger "html;LogFileName=TestReport.html" --logger "console;verbosity=detailed" --results-directory .
128+
run: dotnet test --configuration Debug --framework net${{ matrix.dotnet }} --logger "html;LogFileName=TestReport.html" --logger "trx;LogFileName=TestResults.trx" --logger "console;verbosity=detailed" --results-directory .
129+
130+
- name: Derive failures.json (from TRX)
131+
if: always()
132+
shell: bash
133+
run: |
134+
set -euo pipefail
135+
SUMMARY_FILE=failures.json
136+
if command -v xmllint >/dev/null 2>&1 && command -v jq >/dev/null 2>&1; then
137+
FAILED_COUNT=$(xmllint --xpath "string(//Counters/@failed)" TestResults.trx 2>/dev/null || echo 0)
138+
PASSED_COUNT=$(xmllint --xpath "string(//Counters/@passed)" TestResults.trx 2>/dev/null || echo 0)
139+
TOTAL_COUNT=$(xmllint --xpath "string(//Counters/@total)" TestResults.trx 2>/dev/null || echo 0)
140+
SKIPPED_COUNT=$(xmllint --xpath "string(//Counters/@skipped)" TestResults.trx 2>/dev/null || echo 0)
141+
echo "{" > "$SUMMARY_FILE"
142+
echo " \"workflow\": \"C# tests\"," >> "$SUMMARY_FILE"
143+
echo " \"runId\": ${GITHUB_RUN_ID}," >> "$SUMMARY_FILE"
144+
echo " \"jobName\": \"net${{ matrix.dotnet }}, server ${{ matrix.server.version }}, ${{ matrix.host.TARGET }}\"," >> "$SUMMARY_FILE"
145+
echo " \"matrix\": {" >> "$SUMMARY_FILE"
146+
echo " \"dotnet\": \"${{ matrix.dotnet }}\"," >> "$SUMMARY_FILE"
147+
echo " \"server\": { \"type\": \"${{ matrix.server.type }}\", \"version\": \"${{ matrix.server.version }}\" }," >> "$SUMMARY_FILE"
148+
echo " \"host\": { \"OS\": \"${{ matrix.host.OS }}\", \"ARCH\": \"${{ matrix.host.ARCH }}\", \"RUNNER\": \"${{ matrix.host.RUNNER }}\" }" >> "$SUMMARY_FILE"
149+
echo " }," >> "$SUMMARY_FILE"
150+
echo " \"summary\": { \"total\": $TOTAL_COUNT, \"passed\": $PASSED_COUNT, \"failed\": $FAILED_COUNT, \"skipped\": $SKIPPED_COUNT }," >> "$SUMMARY_FILE"
151+
echo " \"failed\": []," >> "$SUMMARY_FILE"
152+
echo " \"links\": { \"runUrl\": \"${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}\" }" >> "$SUMMARY_FILE"
153+
echo "}" >> "$SUMMARY_FILE"
154+
else
155+
echo '{"workflow":"C# tests","summary":{"note":"Install xmllint+jq for rich failures"}}' > "$SUMMARY_FILE"
156+
fi
101157
102158
- name: Run benchmark
103159
if: ${{ contains(matrix.host.RUNNER, 'ubuntu') }}
@@ -107,6 +163,10 @@ jobs:
107163
redis-server --save "" --daemonize "yes"
108164
./install_and_test.sh -no-tls -minimal -only-glide -data 1 -tasks 10 -csharp -dotnet-framework net${{ matrix.dotnet }}
109165
166+
- name: Run coverage
167+
if: ${{ matrix.dotnet == '8.0' && contains(matrix.host.RUNNER, 'ubuntu') && matrix.host.ARCH == 'x64' && matrix.server.version == '8.1' }}
168+
uses: ./.github/workflows/run-coverage
169+
110170
- name: Upload test reports
111171
if: always()
112172
continue-on-error: true
@@ -115,6 +175,8 @@ jobs:
115175
name: test-reports-dotnet-${{ matrix.dotnet }}-${{ matrix.server.type }}-${{ matrix.server.version }}-${{ matrix.host.OS }}-${{ matrix.host.ARCH }}
116176
path: |
117177
TestReport.html
178+
TestResults.trx
179+
failures.json
118180
valkey-glide/benchmarks/results/*
119181
valkey-glide/utils/clusters/**
120182
@@ -182,16 +244,46 @@ jobs:
182244
key: rust-${{ matrix.host.IMAGE }}
183245

184246
- name: Test dotnet ${{ matrix.dotnet }}
185-
run: dotnet test --framework net${{ matrix.dotnet }} --logger "html;LogFileName=TestReport.html" --logger "console;verbosity=detailed" --results-directory .
247+
run: dotnet test --framework net${{ matrix.dotnet }} --logger "html;LogFileName=TestReport.html" --logger "trx;LogFileName=TestResults.trx" --logger "console;verbosity=detailed" --results-directory .
248+
249+
- name: Derive failures.json (from TRX)
250+
if: always()
251+
shell: bash
252+
run: |
253+
set -euo pipefail
254+
SUMMARY_FILE=failures.json
255+
if command -v xmllint >/dev/null 2>&1 && command -v jq >/dev/null 2>&1; then
256+
FAILED_COUNT=$(xmllint --xpath "string(//Counters/@failed)" TestResults.trx 2>/dev/null || echo 0)
257+
PASSED_COUNT=$(xmllint --xpath "string(//Counters/@passed)" TestResults.trx 2>/dev/null || echo 0)
258+
TOTAL_COUNT=$(xmllint --xpath "string(//Counters/@total)" TestResults.trx 2>/dev/null || echo 0)
259+
SKIPPED_COUNT=$(xmllint --xpath "string(//Counters/@skipped)" TestResults.trx 2>/dev/null || echo 0)
260+
echo "{" > "$SUMMARY_FILE"
261+
echo " \"workflow\": \"C# tests\"," >> "$SUMMARY_FILE"
262+
echo " \"runId\": ${GITHUB_RUN_ID}," >> "$SUMMARY_FILE"
263+
echo " \"jobName\": \"net${{ matrix.dotnet }}, server ${{ matrix.server.version }}, ${{ matrix.host.TARGET }}\"," >> "$SUMMARY_FILE"
264+
echo " \"matrix\": {" >> "$SUMMARY_FILE"
265+
echo " \"dotnet\": \"${{ matrix.dotnet }}\"," >> "$SUMMARY_FILE"
266+
echo " \"server\": { \"type\": \"${{ matrix.server.type }}\", \"version\": \"${{ matrix.server.version }}\" }," >> "$SUMMARY_FILE"
267+
echo " \"host\": { \"OS\": \"${{ matrix.host.OS }}\", \"ARCH\": \"${{ matrix.host.ARCH }}\", \"RUNNER\": \"${{ matrix.host.RUNNER }}\" }" >> "$SUMMARY_FILE"
268+
echo " }," >> "$SUMMARY_FILE"
269+
echo " \"summary\": { \"total\": $TOTAL_COUNT, \"passed\": $PASSED_COUNT, \"failed\": $FAILED_COUNT, \"skipped\": $SKIPPED_COUNT }," >> "$SUMMARY_FILE"
270+
echo " \"failed\": []," >> "$SUMMARY_FILE"
271+
echo " \"links\": { \"runUrl\": \"${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}\" }" >> "$SUMMARY_FILE"
272+
echo "}" >> "$SUMMARY_FILE"
273+
else
274+
echo '{"workflow":"C# tests","summary":{"note":"Install xmllint+jq for rich failures"}}' > "$SUMMARY_FILE"
275+
fi
186276
187277
- name: Upload test reports
188278
if: always()
189279
continue-on-error: true
190280
uses: actions/upload-artifact@v4
191281
with:
192-
name: test-reports-dotnet-${{ matrix.dotnet }}-${{ matrix.server.type }}-${{ matrix.server.version }}-${{ env.IMAGE }}-${{ matrix.host.ARCH }}
282+
name: test-reports-dotnet-${{ matrix.dotnet }}-${{ matrix.server.type }}-${{ matrix.server.version }}-${{ matrix.host.IMAGE }}-${{ matrix.host.ARCH }}
193283
path: |
194284
TestReport.html
285+
TestResults.trx
286+
failures.json
195287
valkey-glide/utils/clusters/**
196288
197289
lint:

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ x64/
3131
[Tt]est[Rr]esult*/
3232
[Bb]uild[Ll]og.*
3333

34+
# Code Coverage Reports
35+
[Rr]eports/
36+
3437
*_i.c
3538
*_p.c
3639
*_i.h

0 commit comments

Comments
 (0)