Skip to content

Commit 5465223

Browse files
committed
ci: apply and verify issue 974 final changes
1 parent 94f6ab2 commit 5465223

1 file changed

Lines changed: 151 additions & 0 deletions

File tree

Lines changed: 151 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,151 @@
1+
name: Apply and verify issue 974 final changes
2+
3+
on:
4+
push:
5+
branches:
6+
- feat/issue-974-client-response-cache
7+
paths:
8+
- .github/workflows/apply-verify-issue-974.yml
9+
10+
permissions:
11+
contents: write
12+
13+
jobs:
14+
apply-and-verify:
15+
runs-on: ubuntu-latest
16+
timeout-minutes: 180
17+
steps:
18+
- name: Check out implementation branch
19+
uses: actions/checkout@v7
20+
with:
21+
ref: feat/issue-974-client-response-cache
22+
fetch-depth: 0
23+
24+
- name: Install Node.js
25+
uses: actions/setup-node@v6
26+
with:
27+
node-version: '22'
28+
29+
- name: Install uv
30+
uses: astral-sh/setup-uv@v7
31+
32+
- name: Install Python
33+
run: |
34+
uv python install
35+
uv venv
36+
37+
- name: Install stable Rust
38+
uses: dtolnay/rust-toolchain@stable
39+
with:
40+
components: clippy, llvm-tools-preview
41+
42+
- name: Install nightly rustfmt
43+
run: rustup toolchain install nightly --component rustfmt
44+
45+
- name: Install verification tools
46+
uses: taiki-e/install-action@v2
47+
with:
48+
tool: cargo-semver-checks,cargo-public-api,cargo-llvm-cov,typos-cli
49+
50+
- name: Fetch upstream main
51+
run: |
52+
git remote add upstream https://github.com/modelcontextprotocol/rust-sdk.git
53+
git fetch upstream main
54+
test "$(git rev-parse origin/main)" = "$(git rev-parse upstream/main)"
55+
56+
- name: Apply source refinements
57+
run: |
58+
python3 ci/issue_974_apply.py
59+
cargo +nightly fmt --all
60+
git diff --check
61+
git config user.name "github-actions[bot]"
62+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
63+
git add \
64+
crates/rmcp/src/service/client.rs \
65+
crates/rmcp/src/service/client/cache.rs \
66+
crates/rmcp/tests/test_tool_disable_notification.rs \
67+
docs/CLIENT_CACHING.md
68+
git commit -m "fix(client): complete response cache semantics"
69+
git push origin HEAD:feat/issue-974-client-response-cache
70+
71+
- name: Run repository verification matrix
72+
shell: bash
73+
run: |
74+
set +e
75+
report=.issue-974-verification-result.txt
76+
full_log=.issue-974-verification.log
77+
: > "$report"
78+
: > "$full_log"
79+
failed=0
80+
81+
check() {
82+
name="$1"
83+
shift
84+
{
85+
echo
86+
echo "===== $name ====="
87+
printf 'command:'
88+
printf ' %q' "$@"
89+
echo
90+
} | tee -a "$full_log"
91+
"$@" 2>&1 | tee -a "$full_log"
92+
code=${PIPESTATUS[0]}
93+
if [ "$code" -eq 0 ]; then
94+
echo "$name=success" | tee -a "$report"
95+
else
96+
echo "$name=failed($code)" | tee -a "$report"
97+
failed=1
98+
fi
99+
}
100+
101+
check nightly_format cargo +nightly fmt --all -- --check
102+
check whitespace git diff --check
103+
check workspace_check cargo check --workspace --all-targets --all-features
104+
check clippy cargo clippy --all-targets --all-features -- -D warnings
105+
check all_feature_tests cargo test --all-features
106+
107+
FEATURES=$(cargo metadata --no-deps --format-version 1 \
108+
| jq -r '[.packages[] | select(.name == "rmcp") | .features | keys[] \
109+
| select(startswith("__") | not) \
110+
| select(. != "local")] | join(",")')
111+
check no_local_tests cargo test -p rmcp --features "$FEATURES"
112+
check focused_cache_tests cargo test -p rmcp --all-features service::client::tests -- --nocapture
113+
check notification_integration cargo test -p rmcp --all-features --test test_tool_disable_notification -- --nocapture
114+
check cache_hint_tests cargo test -p rmcp --all-features --test test_cache_hints -- --nocapture
115+
check doctests cargo test -p rmcp --doc --all-features
116+
check rustdoc env RUSTDOCFLAGS=-Dwarnings cargo doc -p rmcp --all-features --no-deps
117+
check conformance cargo test --manifest-path conformance/Cargo.toml --all-features
118+
check semver_default cargo semver-checks --package rmcp --baseline-rev upstream/main --release-type minor --only-explicit-features --features default
119+
check semver_non_local cargo semver-checks --package rmcp --baseline-rev upstream/main --release-type minor --only-explicit-features --features "$FEATURES"
120+
check public_api_default cargo public-api --package rmcp -ss diff --deny changed --deny removed --force upstream/main..HEAD
121+
check public_api_non_local cargo public-api --package rmcp --features "$FEATURES" -ss diff --deny changed --deny removed --force upstream/main..HEAD
122+
check coverage cargo llvm-cov -p rmcp --all-features --no-report
123+
check spelling typos
124+
125+
echo "tested_sha=$(git rev-parse HEAD)" >> "$report"
126+
echo "upstream_main=$(git rev-parse upstream/main)" >> "$report"
127+
if [ "$failed" -eq 0 ]; then
128+
echo "status=success" >> "$report"
129+
else
130+
echo "status=failed" >> "$report"
131+
{
132+
echo
133+
echo "--- failure log tail ---"
134+
tail -n 800 "$full_log"
135+
} >> "$report"
136+
fi
137+
exit "$failed"
138+
139+
- name: Publish successful verification
140+
if: success()
141+
run: |
142+
git add .issue-974-verification-result.txt
143+
git commit -m "ci: record successful issue 974 verification"
144+
git push origin HEAD:feat/issue-974-client-response-cache
145+
146+
- name: Publish failed verification
147+
if: failure()
148+
run: |
149+
git add .issue-974-verification-result.txt .issue-974-verification.log
150+
git commit -m "ci: record failed issue 974 verification" || true
151+
git push origin HEAD:feat/issue-974-client-response-cache || true

0 commit comments

Comments
 (0)