-
Notifications
You must be signed in to change notification settings - Fork 360
chore: add agent notes column to CVE remediation run summary #1620
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
brendan-kellam
wants to merge
6
commits into
main
Choose a base branch
from
claude/vuln-pipeline-notes-column-t2osul
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
9f65e3e
chore: add agent notes column to CVE remediation run summary
claude 330e117
docs: add changelog entry for #1620
claude 5c5d1f3
docs: remove changelog entry for workflow-only change
claude f62586a
chore: harden CVE remediation summary rendering
claude 96d9720
chore: execute remediation summary renderer from a pre-agent snapshot
claude 96897b2
test: assert renderer snapshot precedes the agent step
claude File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| #!/usr/bin/env bash | ||
| set -euo pipefail | ||
|
|
||
| # Renders the CVE remediation results table for the workflow run summary. | ||
| # Combines the issue metadata produced by the discovery job with the optional | ||
| # per-issue notes written by the remediation agent. A note is looked up by the | ||
| # issue's Linear identifier (SOU-123.md) or, as a fallback, its Linear UUID. | ||
| # | ||
| # Usage: render-cve-remediation-summary.sh <issues-json-file> <notes-directory> | ||
|
|
||
| ISSUES_FILE="${1:?issues JSON file is required}" | ||
| NOTES_DIR="${2:?notes directory is required}" | ||
|
|
||
| MAX_NOTE_LENGTH=500 | ||
|
|
||
| if ! jq -e 'type == "array"' "$ISSUES_FILE" >/dev/null 2>&1; then | ||
| echo "issues file '$ISSUES_FILE' is missing or is not a JSON array" >&2 | ||
| exit 1 | ||
| fi | ||
|
|
||
| escape_table_cell() { | ||
| local escaped="${1//\\/\\\\}" | ||
| printf '%s' "${escaped//|/\\|}" | ||
| } | ||
|
|
||
| echo '| Linear issue | Priority | Status | Title | Notes |' | ||
| echo '| --- | ---: | --- | --- | --- |' | ||
|
|
||
| while IFS= read -r issue; do | ||
| identifier=$(jq -r '.identifier' <<<"$issue") | ||
| id=$(jq -r '.id' <<<"$issue") | ||
| url=$(jq -r '.url' <<<"$issue") | ||
| priority=$(jq -r '.priority' <<<"$issue") | ||
| status=$(jq -r '.status' <<<"$issue") | ||
| title=$(jq -r '.title' <<<"$issue") | ||
|
|
||
| note="" | ||
| for note_key in "$identifier" "$id"; do | ||
| if [[ -z "$note_key" || "$note_key" == */* || "$note_key" == .* ]]; then | ||
| continue | ||
| fi | ||
| note_file="$NOTES_DIR/$note_key.md" | ||
| if [[ -f "$note_file" ]]; then | ||
| note=$(tr -s '[:space:]' ' ' < "$note_file") | ||
| note="${note# }" | ||
| note="${note% }" | ||
| break | ||
| fi | ||
| done | ||
| if (( ${#note} > MAX_NOTE_LENGTH )); then | ||
| note="${note:0:MAX_NOTE_LENGTH}…" | ||
| fi | ||
|
|
||
| printf '| [%s](%s) | %s | %s | %s | %s |\n' \ | ||
| "$identifier" "$url" "$priority" "$status" \ | ||
| "$(escape_table_cell "$title")" \ | ||
| "$(escape_table_cell "$note")" | ||
| done < <(jq -c '.[]' "$ISSUES_FILE") | ||
|
brendan-kellam marked this conversation as resolved.
|
||
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.