feat(marketplace-auditor): Wire up the auditor to take actions#6161
Conversation
Codecov Report❌ Patch coverage is ❌ Your patch status has failed because the patch coverage (38.09%) is below the target coverage (75.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## develop #6161 +/- ##
===========================================
- Coverage 55.89% 55.88% -0.01%
===========================================
Files 908 908
Lines 75448 75450 +2
Branches 515 515
===========================================
Hits 42168 42168
- Misses 33253 33255 +2
Partials 27 27
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| """Email the app publisher a structured audit report with all failing checks.""" | ||
| marketplace_app_team, marketplace_app_title = frappe.db.get_value( | ||
| "Marketplace App", self.marketplace_app, ["team", "title"] | ||
| ) | ||
| publisher_email = frappe.db.get_value("Team", marketplace_app_team, "user") |
There was a problem hiding this comment.
Maybe auto send report if the app is marked as "Attention Required"
There was a problem hiding this comment.
Will add this later, need to first monitor whether the template being sent is correct or not. Will keep track for a week and then add this.
Rework the marketplace audit flow
What this changes
Removes Code Screening entirely. The old static-analysis screener is gone — dashboard components (
CodeReview.vue,NewComment.vue), API endpoints, theApp Release Approval Code Commentschild DocType, screening fields onApp Release Approval Request, and thereview_stagefield onMarketplace App. The Auditor now owns that responsibility.Makes the Auditor an active decision-maker. On audit completion with a
Failresult (and whenenable_audit_actionsis on in Marketplace Settings - feature flag), it now:Prevents approval requests for already-yanked releases. New guard in
AppReleaseApprovalRequest.before_insertavoids resurrecting bad releases into the review queue.Adds a "Send Report to Publisher" action. Visible on the audit Desk form when result is
Fail/Warn/Needs Improvement. Sends a structured Jinja email listing each failing check with severity, category, semgrep occurrences (file, line, rule-id, message), and remediation guidance. A CC option lets reviewers keep a copy(behind feature flag).Simplifies status ownership. Status now lives in one place per concept —
Marketplace App.statusfor listing lifecycle,App Release.statusfor release state,Marketplace App Audit.audit_resultfor audit outcome. No more duplicated/overlapping fields.Data migration
Added
cleanup_code_screening_datapatch that nulls legacy screening fields and clears orphaned code-comment rows beforebench trim-tablesdrops the unused columns/tables.