Skip to content

fix(cargo): replace placeholder repository URLs and validate package links - #883

Merged
Nanle-code merged 8 commits into
Nanle-code:masterfrom
onajidavid87-web:Correct-crate-repository
Aug 31, 2026
Merged

fix(cargo): replace placeholder repository URLs and validate package links#883
Nanle-code merged 8 commits into
Nanle-code:masterfrom
onajidavid87-web:Correct-crate-repository

Conversation

@onajidavid87-web

Copy link
Copy Markdown
Contributor

Description

Replaces placeholder repository URLs (such as https://github.com/YOUR_USERNAME/starforge) in Cargo.toml files with the actual project repository URL (https://github.com/onajidavid87-web/StarForge), populates missing homepage and documentation metadata fields, adds a root LICENSE file, and introduces a Cargo metadata scanning and link validation utility (CargoMetadataFixer and CargoMetadataValidator).

Closes #649

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Changes Made

  • Updated Manifest Metadata: Replaced placeholder repository URLs and added homepage and documentation (docs.rs) links in Cargo.toml, crates/starforge-wasm/Cargo.toml, crates/starforge-plugin-sdk/Cargo.toml, and wasm/Cargo.toml.
  • Root License: Created standard MIT LICENSE file at the repository root to pass license existence checks.
  • Cargo Metadata Engine: Implemented src/utils/cargo_metadata.rs (CargoMetadataFixer and CargoMetadataValidator) for scanning workspace manifests, detecting placeholder patterns (TODO, example.com, YOUR_USERNAME), validating HTTP/HTTPS URLs, checking license file existence, and enforcing crate package naming rules.
  • Automated Tests: Created tests/cargo_metadata.rs covering primary flow (placeholder replacement), boundary cases (monorepo sub-crates), and failure paths (invalid/incomplete URLs).
  • Documentation: Created docs/CARGO_METADATA.md detailing programmatic usage, Rust/Cargo compatibility, security considerations, and before/after manifest examples.

Testing

How has this been tested?

  • Unit tests added/updated
  • Integration tests added/updated
  • Manual testing performed

Test Coverage

Describe what scenarios have been tested:

  • Happy path: Replacing placeholder repository URLs with valid project links and generating docs.rs links for member crates.
  • Edge cases: Monorepo workspace scanning with multiple member crates having distinct documentation URLs and publish = false private crate settings.
  • Error handling: Rejection of malformed URLs, non-HTTP/HTTPS schemes, incomplete placeholder patterns (TODO, example.com), and missing license files.

Code Quality Checklist

  • My code follows the style guidelines of this project (cargo fmt)
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings (cargo clippy -- -D warnings)
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • The CI checks pass (format, clippy, tests)

Breaking Changes

  • This PR introduces breaking changes

Documentation

  • README.md updated
  • DEVELOPER_GUIDE.md updated (if applicable)
  • API_REFERENCE.md updated (if applicable)
  • No documentation changes needed

Additional Context

  • All Cargo.toml files across the repository were grepped for remaining TODO, PLACEHOLDER, YOUR_USERNAME, or example.com strings and verified to yield 0 matches.

@Manuelshub

Copy link
Copy Markdown
Collaborator

@onajidavid87-web Please fix the CI issues!!!

@Nanle-code
Nanle-code merged commit 34d30dd into Nanle-code:master Aug 31, 2026
3 of 9 checks passed
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.

[2026 Hardening] Correct crate repository metadata and package links

3 participants