Skip to content

test(templates): validate generated Smart Contract Cargo metadata - #289

Open
ademolabiyi92-design wants to merge 2 commits into
DigiNodes:mainfrom
ademolabiyi92-design:test/148-cargo-metadata
Open

ademolabiyi92-design wants to merge 2 commits into
DigiNodes:mainfrom
ademolabiyi92-design:test/148-cargo-metadata

Conversation

@ademolabiyi92-design

@ademolabiyi92-design ademolabiyi92-design commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Add Cargo metadata conformance coverage for generated Smart Contract projects, and repair the production compilation errors that prevented the linked CLI smoke job from running.

Related Issue

Closes #148

Scope

  • Preserve the five Cargo metadata tests and contributor documentation: generated manifests, inherited dependencies, target/source paths, credential-free output, and build/test command conformance.
  • Classify structured ETIMEDOUT results consistently and use the same timeout outcome in Git diagnostics; preserve required/optional Docker severity and safe messages.
  • Correct misspelled references in the existing redaction pipeline and point the legacy generation entry point at the existing generator types.
  • Add four timeout regression cases and a patch changeset. No dependency, CI-permission, subprocess-execution, or template changes.

Testing

  • Tests added/updated where applicable
  • Existing relevant tests pass
  • Repository-wide lint/type checks pass (remaining baseline findings below)

Windows / Node 24.21.0, Rust/Cargo 1.98.1:

  • npm ci --ignore-scripts --no-audit --no-fund: passed.
  • npm run build: passed; all 12 production TypeScript errors resolved.
  • Focused diagnostic, redaction, generation and Cargo/template suites: 73 passed, two Cargo checks initially skipped without Cargo on PATH. Reran Cargo/template and redaction suites with the retained toolchain: 23 passed, none skipped (including all seven Cargo/template checks).
  • ESLint and Prettier for changed TypeScript files: passed. git diff --check: passed.
  • Full Vitest suite (--maxWorkers=2): 1,757 passed, 29 failed, 5 skipped. Remaining failures are in unchanged suites, including Windows symlink permissions, workflow policy checks and other existing behavior; the previous run had 70 failures.
  • Repository typecheck: 12 diagnostics remain in unchanged test files; production compilation passes.
  • Repository lint: 19 findings on the first run; the edited redaction-file finding was subsequently fixed and its lint passes. Other findings are in unchanged tooling/tests.
  • Local smoke script passes help/version/doctor/generation/basic-test stages, then cannot launch its POSIX fake Stellar executable on Windows. Linux CI is the authoritative full smoke result.
  • Generated Soroban SDK compilation and live network/deployment behavior were not tested; Cargo metadata runs offline with no dependencies.

Security Impact

  • No security-sensitive behavior is changed
  • Security-sensitive behavior is changed and explained below

Restore references to the already-defined redaction expressions; existing secret-fixture tests pass. Timeout classification uses the structured error code and does not expose raw process output. The protected src/output/redaction.ts fix and changeset require maintainer scope review: issue #148 currently lacks the protected-surface label enforced by the PR guard. No guard or workflow is weakened.

Release Impact

  • No published/user-visible behavior change
  • Patch
  • Changeset included where required

Restore CLI compilation, diagnostic timeout guidance and the existing output-redaction pipeline.

Documentation

  • Documentation updated where applicable (Cargo conformance guide)

Checklist

  • Read the contributor architecture rules
  • Checked overlapping open PRs for the repaired source files; none found
  • No secrets or credentials included
  • No dependency updates
  • Failure paths covered by regression tests
  • Maintainer protected-surface scope approval

@coderabbitai

coderabbitai Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 1fab48c5-0020-4f14-bafc-bc8757d3329f
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SW-046 — Add Smart Contract Cargo metadata conformance

1 participant