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.

Copy link
Copy Markdown
Contributor

Maintainer validation note: the focused Cargo metadata and diagnostic tests are useful, but the PR body currently records 29 full-suite failures and 12 remaining repository typecheck diagnostics, with repository lint findings also outstanding. Please keep this PR unmerged until the current full CI matrix is green at the exact proposed head SHA, including full tests, typecheck, lint and the Linux smoke workflow. Focused passing tests do not replace repository-wide acceptance. No merge is approved by this comment.

Copy link
Copy Markdown
Contributor

Maintainer scope decision for #289:

The PR currently combines the #148 Smart Contract Cargo metadata conformance work with unrelated production fixes in the diagnostic timeout path (src/diagnostics/process.ts, src/diagnostics/git.ts), the protected output-redaction pipeline (src/output/redaction.ts), and the legacy generator type import.

Please keep #289 limited to the Cargo metadata conformance tests and their directly related documentation. Move the diagnostic timeout, redaction, and generator compilation repairs into separate, narrowly scoped PRs linked to their own issues (or request explicit maintainer approval for a clearly documented expanded scope before proceeding).

The protected src/output/redaction.ts change still requires the repository's protected-surface review/approval. The current #148 issue does not itself authorize that protected change. Do not weaken the guard or infer approval from the passing focused tests.

This is not merge approval. The PR must also satisfy the full current CI, typecheck, lint, and Linux smoke requirements at the exact proposed head SHA before merge is considered.

@dDevAhmed dDevAhmed left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the Cargo metadata coverage. Please narrow this PR to the #148 Smart Contract metadata work only.

The production compilation/diagnostic/redaction repairs in this PR overlap with the separate maintainer recovery track now being validated in PR #297. Please remove these overlapping production changes from this contributor PR:

  • src/diagnostics/process.ts
  • src/diagnostics/git.ts
  • src/output/redaction.ts
  • src/validate.ts
  • The diagnostic timeout tests and unrelated changeset entries that exist solely for those production fixes.

Keep the Cargo metadata tests and their focused contributor documentation. Do not remove or bypass protected-surface controls; #148 needs the required protected-surface classification/maintainer approval before protected paths are accepted. Please update the branch and request re-review when the diff is limited to #148.

No merge is authorized while this review is outstanding.

@github-actions github-actions Bot added the status: stale Needs contributor or maintainer follow-up label Nov 13, 2026
@github-actions

Copy link
Copy Markdown
Contributor

This Stellar Wave PR has no contributor commit or progress comment for 4 days. A maintainer should now review whether to retain or release the assignment. The automation does not close the PR or change the Drips assignment.

@github-actions

Copy link
Copy Markdown
Contributor

This Stellar Wave PR has no contributor commit or progress comment for 48 hours. Please post a concise update, push current progress, or tell the maintainer if the issue should be released.

Copy link
Copy Markdown
Contributor

Maintainer scope reconciliation: please split this into a Cargo metadata-only PR for #148 and a separate production-diagnostics/redaction PR with its own accurately scoped, open issue. The metadata PR should not modify src/output/redaction.ts, production timeout/diagnostic handling, or unrelated changeset files. Do not weaken the contributor guard or add protected-surface merely to bypass the scope check. Keep this PR open while the split is prepared; the current head remains blocked by the contributor guard and CI.

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

Labels

status: stale Needs contributor or maintainer follow-up

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SW-046 — Add Smart Contract Cargo metadata conformance

2 participants