Skip to content

test(api): read the expected MCP version dynamically instead of hardcoding it#4629

Merged
JSONbored merged 2 commits into
mainfrom
fix/mcp-version-dynamic-test-strings
Jul 10, 2026
Merged

test(api): read the expected MCP version dynamically instead of hardcoding it#4629
JSONbored merged 2 commits into
mainfrom
fix/mcp-version-dynamic-test-strings

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

Summary

  • test/integration/api.test.ts hardcoded "0.7.0" in 5 places asserting latestRecommendedMcpVersion/latestRecommendedVersion/latestPackageVersion, but src/services/mcp-compatibility.ts's LATEST_RECOMMENDED_MCP_VERSION derives live from packages/gittensory-mcp/package.json's version field.
  • Confirmed this breaks on every release: chore(release): cut mcp v0.7.1 #4204 (release-please's own automated 0.7.0→0.7.1 bump PR) fails validate-code on exactly these assertions.
  • Fix: import mcpPackageJson and reference mcpPackageJson.version, mirroring the pattern test/unit/mcp-cli-doctor.test.ts:178 already uses for the same field.

Test plan

  • npm run typecheck
  • npx vitest run test/integration/api.test.ts — 43/43 passing

…oding it

src/services/mcp-compatibility.ts derives LATEST_RECOMMENDED_MCP_VERSION live
from packages/gittensory-mcp/package.json, but these assertions hardcoded
"0.7.0" -- every release-please version bump silently breaks them (confirmed:
#4204's 0.7.0->0.7.1 bump fails validate-code on exactly these lines). Mirrors
the mcpPackageJson.version pattern test/unit/mcp-cli-doctor.test.ts already
uses, so this doesn't recur on the next release.
@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

@JSONbored JSONbored self-assigned this Jul 10, 2026
@codecov

codecov Bot commented Jul 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.11%. Comparing base (efcd25d) to head (61df6ba).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4629   +/-   ##
=======================================
  Coverage   94.11%   94.11%           
=======================================
  Files         432      432           
  Lines       38348    38348           
  Branches    13979    13979           
=======================================
  Hits        36091    36091           
  Misses       1600     1600           
  Partials      657      657           
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@gittensory-orb gittensory-orb Bot added the gittensor:bug Gittensor-scored bug fix — scores a 0.5x multiplier. label Jul 10, 2026
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 10, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
gittensory-ui 61df6ba Commit Preview URL

Branch Preview URL
Jul 10 2026, 08:26 AM

@gittensory-orb

gittensory-orb Bot commented Jul 10, 2026

Copy link
Copy Markdown

Warning

🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨

⏸️ Gittensory review result - manual review recommended

Review updated: 2026-07-10 08:38:32 UTC

1 file · 1 AI reviewer · 2 blockers · readiness 93/100 · CI green · unstable

⏸️ Suggested Action - Manual Review

  • No linked issue detected — If this PR is intended to solve an issue, link it explicitly in the PR body.
  • Maintainer requires a linked issue — Link the relevant issue (for example Closes #123) before opening the PR.

Review summary
This PR replaces five hardcoded `"0.7.0"` literals in test/integration/api.test.ts with `mcpPackageJson.version`, read from packages/gittensory-mcp/package.json, matching the live-derivation pattern already used in src/services/mcp-compatibility.ts (`LATEST_RECOMMENDED_MCP_VERSION`) and in test/unit/mcp-cli-doctor.test.ts:178. The relative import path (`../../packages/gittensory-mcp/package.json` from test/integration/) is consistent with the same-depth import in src/services/mcp-compatibility.ts, and JSON default-import of the version field is already an established, working pattern in this repo, so no new tsconfig/type risk is introduced. The change is a narrow, mechanical test fix with a clear rationale (recurring failure on every release-please version bump, e.g. #4204) and no functional code is touched.

Nits — 4 non-blocking
  • Consider naming the import `gittensoryMcpPackageJson` to match the existing convention in src/services/mcp-compatibility.ts rather than the shorter `mcpPackageJson`, for consistency across the test suite.
  • Worth a quick grep across test/integration/api.test.ts (and other integration tests) for any remaining hardcoded MCP version literals this PR didn't catch, so the next release bump doesn't hit a leftover assertion.
  • Confirm there are no other hardcoded `"0.7.0"` (or similar version-literal) assertions elsewhere in the integration/unit suites that reference MCP version fields, to fully close out the release-bump breakage described in chore(release): cut mcp v0.7.1 #4204.
  • Align the imported variable name with the `gittensoryMcpPackageJson` naming used in src/services/mcp-compatibility.ts for consistency.

Concerns raised — review before merging

  • No linked issue detected — If this PR is intended to solve an issue, link it explicitly in the PR body.
  • Maintainer requires a linked issue — Link the relevant issue (for example Closes #123) before opening the PR.
Signal Result Evidence
Code review ❌ 2 blockers 1 reviewer
Linked issue ⚠️ Missing No linked issue or no-issue rationale found.
Related work ✅ No active overlap found No same-issue or scoped active PR overlap found.
Change scope ✅ 20/20 Low review scope from cached public metadata (no linked issue context).
Validation posture ✅ 25/25 PR body includes validation/test evidence.
Contributor workload ✅ 10/10 Author activity: 48 registered-repo PR(s), 40 merged, 334 issue(s).
Contributor context ✅ Confirmed Gittensor contributor JSONbored; Gittensor profile; 48 PR(s), 334 issue(s).
Gate result ❌ Blocking Repo-configured hard blocker found.
Review context
  • Author: JSONbored
  • Role context: owner (maintainer lane)
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: not available
  • Official Gittensor activity: 48 PR(s), 334 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Treat this as maintainer-lane context rather than normal contributor-lane activity.
  • Explain no-issue PR.
  • Link the issue being solved, or explicitly explain why this is a no-issue PR.
Signal definitions
  • Related work = same linked issue, overlapping active PRs, or title/path similarity.
  • Change scope = cached public metadata such as size labels, draft state, and review-burden hints.
  • Validation posture = whether the PR provides enough public validation/test evidence for maintainer review.
  • Contributor workload = public contributor activity and cleanup pressure, not a repo-wide quality failure.
  • Contributor context = public GitHub/Gittensor identity context; non-Gittensor status is not a blocker.

🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed


💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →.

Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers.

  • Re-run Gittensory review

@gittensory-orb gittensory-orb Bot added the manual-review Gittensor contributor context label Jul 10, 2026
@JSONbored JSONbored merged commit a8f1ed6 into main Jul 10, 2026
12 checks passed
@JSONbored JSONbored deleted the fix/mcp-version-dynamic-test-strings branch July 10, 2026 08:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:bug Gittensor-scored bug fix — scores a 0.5x multiplier. manual-review Gittensor contributor context

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant