The CI/CD pipeline is failing on one or more of the feature branches. This guide helps identify and fix the issues.
Issue: VerificationRecord struct was updated with new fields (expires_at, last_renewed_at) but not all initialization sites were updated.
Solution: Added initialization of new fields in verification_registry.rs line 180-191:
let record = VerificationRecord {
project_id,
requester: requester.clone(),
status: VerificationStatus::Pending,
evidence_cid: evidence_cid.clone(),
timestamp: now,
fee_amount: config.verification_fee,
revoke_reason: None,
expires_at: 0, // ← ADDED
last_renewed_at: 0, // ← ADDED
};Status: ✅ FIXED in commit 92aec15
Issue: cargo fmt detects formatting differences.
Solution:
- Run
cargo fmtlocally to auto-fix formatting - Check for trailing whitespace
- Ensure consistent spacing around operators
Files to Check:
- src/tests/indexer.rs
- src/tests/verification.rs
- src/tests/fee.rs
Issue: cargo clippy detects potential code improvements.
Common Issues:
- Unused variables
- Unnecessary clones
- Inefficient patterns
Solution:
- Review clippy warnings
- Fix issues or add
#[allow(...)]attributes if intentional
Issue: Unit tests or integration tests failing.
Common Causes:
- Missing imports
- Incorrect error types
- Uninitialized fields
- Logic errors
Solution:
- Check test output for specific error messages
- Verify all new methods are properly implemented
- Ensure all error types are defined
- All new structs have all fields initialized
- All new methods are properly implemented
- All imports are correct
- All error types are defined
- All tests compile and run
- Code is properly formatted (
cargo fmt) - No clippy warnings (
cargo clippy) - All acceptance criteria are met
- ProjectBySlug storage key is used correctly
- Slug validation is working
- get_project_by_slug() returns correct results
- Duplicate slug detection works
- Test fixtures include slug parameter
- Review struct has hidden and report_count fields
- list_reviews() excludes hidden reviews
- Stats are recalculated when reviews are hidden/restored
- ReviewReport storage key tracks duplicates
- Admin-only access control is enforced
- VerificationRecord has expires_at and last_renewed_at fields ✅ FIXED
- VerificationRenewalRecord is properly defined
- Renewal history is tracked correctly
- Expiry checking works
- Admin-only access control is enforced
cd dongle-smartcontract
cargo fmt --all -- --checkcargo clippy -p dongle-contract --target wasm32-unknown-unknown -- -D warningscargo test -p dongle-contractcargo build -p dongle-contract --target wasm32-unknown-unknown --releaseFix: Initialize new VerificationRecord fields (expires_at, last_renewed_at)
Changes:
- Added
expires_at: 0to VerificationRecord initialization - Added
last_renewed_at: 0to VerificationRecord initialization
Branch: feature/verification-renewal
- Check CI/CD Logs: Look at the GitHub Actions workflow logs to see specific error messages
- Review Error Messages: The CI output will show exactly which tests are failing
- Apply Fixes: Use this guide to identify and fix issues
- Re-run Tests: Push fixes and verify CI passes
- Create PRs: Once all tests pass, create pull requests
The CI runs these checks in order:
-
Formatting (
cargo fmt --all -- --check)- Checks code formatting
- Must pass before other checks
-
Linting (
cargo clippy)- Checks for code quality issues
- Must pass before tests
-
Tests (
cargo test)- Runs all unit and integration tests
- Must pass before build
-
Build (
cargo build --target wasm32-unknown-unknown --release)- Builds WASM contract
- Only runs if all previous checks pass
- Check for missing fields in struct initialization
- Verify all imports are correct
- Check for typos in method names
- Add
#[allow(dead_code)]if intentional - Or remove unused field
- Add
.clone()where needed - Or restructure code to avoid move
- Check test output for specific assertion failures
- Verify test setup is correct
- Check for missing mock_all_auths()
If you encounter issues not covered here:
- Check the GitHub Actions logs for specific error messages
- Review the test output carefully
- Compare with working code in other branches
- Check for recent changes that might have broken things
Last Updated: June 1, 2026
Latest Fix: Commit 92aec15 - VerificationRecord field initialization
All Branches: Ready for testing and PR creation