(scan: sqlite3.Row)
| 3139 | |
| 3140 | |
| 3141 | def remediation_availability(scan: sqlite3.Row) -> tuple[bool, str | None]: |
| 3142 | try: |
| 3143 | current_revision = git_revision(require_scan_target_identity(scan)) |
| 3144 | except SystemExit as exc: |
| 3145 | return False, str(exc) |
| 3146 | expected_revision = scan["target_revision"] |
| 3147 | if current_revision == expected_revision: |
| 3148 | return True, None |
| 3149 | return ( |
| 3150 | False, |
| 3151 | ( |
| 3152 | "Remediation is unavailable because the selected checkout is not at the revision " |
| 3153 | "that was scanned. Check out the scanned revision or start a new scan." |
| 3154 | ), |
| 3155 | ) |
| 3156 | |
| 3157 | |
| 3158 | def finding_occurrence_rows( |
no test coverage detected