Repository navigation
Fix: 2 issues (#912, #913) - #936
Open
euniceamoni wants to merge 1 commit into
Open
euniceamoni wants to merge 1 commit into
euniceamoni wants to merge 1 commit into
Conversation
Co-authored-by: Simple Agent <agent@simple.dev>
|
@euniceamoni Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #912
Closes #913
Issues
#912 tests: add proptest coverage for the suppression-comment parser
#913 ci: add a scheduled mutation-testing job with cargo-mutants for the checks crate
Summary
The suppression-comment parser currently lives in crates/checks/src/annotations.rs, which in this snapshot contains the missing-contract-annotation check; confirm the actual parser location before adding tests and adjust the file path if it has moved. Keep proptest cases fixed at ~256 to meet the ~10s CI budget, and commit any generated proptest-regressions/ files. The mutation workflow must not be added to branch protection or PR triggers; pin the cargo-mutants version explicitly and keep the job summary step running even when mutants are found (use
if: always()).Changes
proptest = "1"under[dev-dependencies](alongside the existingwalkdir) so the new property tests for the suppression-comment parser can compile. Keep the dependency pinned to the 1.x series. (crates/checks/Cargo.toml)#[cfg(test)] mod proptest_tests(or extend the existing test module) in the suppression-comment parser file. UseProptestConfig { cases: 256, .. }so the suite stays under ~10s. Implement three properties: (1) parsing arbitraryStringinput never panics; (2) a strategy that generates a valid// soroban-guard: allow(...)annotation with random whitespace, case, and comma-separated check names, asserting the parsed set equals exactly the expected set; (3) suppressing check A never suppresses a finding for check B. Reference any discovered bugs (e.g.function_name_from_linefinds"fn "anywhere in a line — comments, strings, and type positions register bogus suppressions #409, analyzer: the suppression comment prefix is whitespace-exact and check names are never validated —//soroban-guard: allow(x)and typos silently do nothing #602) in comments and file them separately if found. (crates/checks/src/annotations.rs)crates/checks/tests/annotations_proptest.rsthat exercises the public suppression-comment parsing API with proptest: arbitrary-string no-panic, generated valid annotation round-trip to the expected name set, and non-interference between suppressions for different checks. Use a fixedProptestConfig { cases: 256, .. }and rely on the defaultproptest-regressions/persistence so failing seeds are committed. (crates/checks/tests/annotations_proptest.rs)proptest-regressions/directories are not ignored so failing seeds are persisted and committed. The current.gitignoredoes not exclude them; add an explicit comment/negation (e.g.!**/proptest-regressions/) only if a broader pattern would otherwise hide them, and verifytarget/remains ignored. (.gitignore).github/workflows/mutants.ymltriggered only byschedule(weekly cron) andworkflow_dispatch, never onpull_request, so it does not gate PRs. Settimeout-minutes(e.g. 60), check out the repo, install a pinnedcargo-mutantsversion (e.g.cargo install cargo-mutants --version <pinned> --locked), runcargo mutants -p soroban-guard-checks, uploadmutants.outviaactions/upload-artifact, and append the count of missed mutants to$GITHUB_STEP_SUMMARY. Useif: always()for artifact upload and summary steps. (.github/workflows/mutants.yml)cargo mutants -p soroban-guard-checkslocally and how to target a single check file with--file crates/checks/src/<check>.rs. Mention that the scheduled workflow is non-gating and that notable first-run survivors should be listed in the PR description. (CONTRIBUTING.md)