Security alerts and updates name work items in the contracts
Vulnerability, SecurityUpdate and CodeAlert carry item (a work item's number in the workspace) where they carried issue, and the security service is sent work.migrated to rewrite the numbers it kept.
- G1T-Session:
- ses_01m566357hejh9yeqjbetx23f3
5 files+26−170/5 viewed
| 396 | 396 | /// A newer security update replaced it, or the package is no longer | |
| 397 | 397 | /// vulnerable; g1t closed it. | |
| 398 | 398 | Superseded, | |
| 399 | − | /// An earlier update g1t opened an issue for, when the version could | |
| 399 | + | /// An earlier update g1t opened a work item for, when the version could | |
| 400 | 400 | /// not be raised without changing code. New updates no longer reach it: | |
| 401 | 401 | /// they fail with why, or their pull request stays open. | |
| 402 | 402 | NeedsCode, | |
| ⋯ | |||
| 448 | 448 | pub branch: Option<String>, | |
| 449 | 449 | /// The pull request g1t opened. | |
| 450 | 450 | pub pull: Option<u32>, | |
| 451 | − | /// The issue opened for g1t, when the upgrade needs code changes. | |
| 452 | − | pub issue: Option<u32>, | |
| 451 | + | /// The work item opened for g1t, by number in the workspace, when the | |
| 452 | + | /// upgrade needs code changes. | |
| 453 | + | pub item: Option<u32>, | |
| 453 | 454 | /// Why it failed, when it did. | |
| 454 | 455 | pub error: Option<String>, | |
| 455 | 456 | /// RFC 3339. | |
| ⋯ | |||
| 495 | 496 | pub severity: String, | |
| 496 | 497 | pub fixed_version: Option<String>, | |
| 497 | 498 | pub status: VulnStatus, | |
| 498 | − | /// The issue opened to upgrade the package, when g1t was put on | |
| 499 | − | /// it: the upgrade needs code changes, or predates security updates. | |
| 500 | − | pub issue: Option<u32>, | |
| 499 | + | /// The work item opened to upgrade the package, by number in the | |
| 500 | + | /// workspace, when g1t was put on it: the upgrade needs code changes, | |
| 501 | + | /// or predates security updates. | |
| 502 | + | pub item: Option<u32>, | |
| 501 | 503 | /// RFC 3339. | |
| 502 | 504 | pub found_at: String, | |
| 503 | 505 | pub fixed_at: Option<String>, | |
| ⋯ | |||
| 573 | 575 | pub actor: Option<String>, | |
| 574 | 576 | pub reason: Option<DismissReason>, | |
| 575 | 577 | pub comment: Option<String>, | |
| 576 | − | /// The pull request or issue it concerns. | |
| 578 | + | /// The pull request or work item it concerns. | |
| 577 | 579 | pub number: Option<u32>, | |
| 578 | 580 | /// RFC 3339. | |
| 579 | 581 | pub at: String, | |
| 664 | 664 | pub dismissed_reason: Option<DismissReason>, | |
| 665 | 665 | pub dismissed_comment: Option<String>, | |
| 666 | 666 | pub dismissed_at: Option<String>, | |
| 667 | − | /// The issue g1t was put on to fix it. | |
| 668 | − | pub issue: Option<u32>, | |
| 667 | + | /// The work item g1t was put on to fix it, by number in the workspace. | |
| 668 | + | pub item: Option<u32>, | |
| 669 | 669 | } | |
| 670 | 670 | ||
| 671 | 671 | /// One upload's run of one tool on one commit. |
| 149 | 149 | // Usage rows that follow a renamed workspace or repository. | |
| 150 | 150 | ("SUBSCRIBER_BILLING", &[]), | |
| 151 | 151 | // Secret and dependency scans, and version update pull requests | |
| 152 | − | // (security/src/lib.rs on_event). | |
| 152 | + | // (security/src/lib.rs on_event). `work.migrated` rewrites the work | |
| 153 | + | // items kept by their old issue numbers. | |
| 153 | 154 | ( | |
| 154 | 155 | "SUBSCRIBER_SECURITY", | |
| 155 | 156 | &[ | |
| ⋯ | |||
| 162 | 163 | "comment.created", | |
| 163 | 164 | "repo.created", | |
| 164 | 165 | "repo.visibility_changed", | |
| 166 | + | "work.migrated", | |
| 165 | 167 | ], | |
| 166 | 168 | ), | |
| 167 | 169 | // The site-wide search index (search/src/index.rs). | |
| 187 | 187 | dismissedReason: DismissReason | null; | |
| 188 | 188 | dismissedComment: string | null; | |
| 189 | 189 | dismissedAt: string | null; | |
| 190 | − | issue: number | null; | |
| 190 | + | /** The work item g1t was put on to fix it, by number in the workspace. */ | |
| 191 | + | item: number | null; | |
| 191 | 192 | }; | |
| 192 | 193 | ||
| 193 | 194 | export const CODE_DISMISS_REASONS: { reason: DismissReason; label: string; about: string }[] = [ |
| 8 | 8 | ||
| 9 | 9 | /** | |
| 10 | 10 | * The security service: secrets found in pushes and in history, vulnerable | |
| 11 | − | * dependencies, and the upgrade issues g1t opens for them. Members of a | |
| 11 | + | * dependencies, and the updates g1t opens for them. Members of a | |
| 12 | 12 | * workspace see its findings; nobody else does. Mirrors | |
| 13 | 13 | * `g1t_contracts::security`. | |
| 14 | 14 | */ | |
| ⋯ | |||
| 130 | 130 | severity: Severity; | |
| 131 | 131 | fixedVersion: string | null; | |
| 132 | 132 | status: "open" | "fixed" | "dismissed"; | |
| 133 | − | /** The issue opened for g1t, when upgrading needs code changes. */ | |
| 134 | − | issue: number | null; | |
| 133 | + | /** | |
| 134 | + | * The work item opened for g1t, by number in the workspace, when upgrading | |
| 135 | + | * needs code changes. | |
| 136 | + | */ | |
| 137 | + | item: number | null; | |
| 135 | 138 | foundAt: string; | |
| 136 | 139 | fixedAt: string | null; | |
| 137 | 140 | state: AlertState; | |
| ⋯ | |||
| 147 | 150 | * Where a security update stands. `requested`: a sandbox is making the | |
| 148 | 151 | * change. `open`: its pull request is going through the required checks. | |
| 149 | 152 | * `superseded`: a newer update replaced it, or the package is no longer | |
| 150 | − | * vulnerable. `needs_code`: an earlier update g1t opened an issue for; new | |
| 153 | + | * vulnerable. `needs_code`: an earlier update g1t opened a work item for; new | |
| 151 | 154 | * updates no longer reach it. `failed`: see `error`. | |
| 152 | 155 | */ | |
| 153 | 156 | export type UpdateState = "requested" | "open" | "merged" | "closed" | "superseded" | "needs_code" | "failed"; | |
| ⋯ | |||
| 160 | 163 | /** `g1t/security/<package>-<version>`. */ | |
| 161 | 164 | branch: string | null; | |
| 162 | 165 | pull: number | null; | |
| 163 | − | issue: number | null; | |
| 166 | + | /** The work item opened for g1t, by number in the workspace. */ | |
| 167 | + | item: number | null; | |
| 164 | 168 | error: string | null; | |
| 165 | 169 | updatedAt: string; | |
| 166 | 170 | }; | |
| ⋯ | |||
| 191 | 195 | actor: string | null; | |
| 192 | 196 | reason: DismissReason | null; | |
| 193 | 197 | comment: string | null; | |
| 194 | − | /** The pull request or issue it concerns. */ | |
| 198 | + | /** The pull request or work item it concerns. */ | |
| 195 | 199 | number: number | null; | |
| 196 | 200 | at: string; | |
| 197 | 201 | }; | |
Comments
Sign in to comment.