Skip to content

Fix blocking alert sender address formatting - #49

Merged
amtwo merged 3 commits into
mainfrom
codex/issue-26-emailfrom-closing-angle-bracket
Nov 1, 2026
Merged

amtwo merged 3 commits into
mainfrom
codex/issue-26-emailfrom-closing-angle-bracket

Conversation

@amtwo

@amtwo amtwo commented Nov 1, 2026 •

Copy link
Copy Markdown
Owner

What does this change?

Fixes the blocking-alert sender address and hardens three existing paths in dbo.Alert_Blocking:

  • Closes the sender address with >.
  • Quotes the database identifier used by the OBJECT wait-resource query.
  • Stops after rejecting invalid threshold combinations.
  • Validates client-reported SQL Agent job IDs and resolves them without concatenating client-controlled text into dynamic SQL.

Related issue

Closes #26

Coding agent & Review agent disclosure

Coding agent details:

--Cody 🤖

Adversarial review details

  • Adversarial review agent(s), provider/model, and reasoning effort (if applicable): Separate reviewer agent; model and reasoning effort unavailable.
  • Reviewer/review approach and summary: Separate adversarial review of the complete updated PR diff and the full procedure, including dynamic SQL, thresholds, ProgramName parsing, and failure paths.
  • Findings resolved or left open (with reason): The three findings from the full-procedure review were addressed in this branch. The reviewer found no actionable findings in the updated diff.
  • Review had zero findings
  • All findings were reconciled with high confidence

How did you test it?

  • Checks performed: Compared the remote branch with current main; it changes only stored-procedures/dbo.Alert_Blocking.sql. Inspected the complete final diff and confirmed the added lines have no trailing whitespace.
  • SQL Server version / edition and isolated environment tested (if applicable): Not tested.
  • Runtime verification not performed / limitations (if applicable): Runtime testing was unavailable. Docker is installed, but Docker engine access was denied; sqlcmd is unavailable. The repository's SQL Edge smoke-test guidance was checked.
  • Sample call and result (for behavior changes):
-- Valid threshold input; invalid calls now raise an error and return before processing.
EXEC dbo.Alert_Blocking
    @BlockingDurationThreshold = NULL,
    @BlockedSessionThreshold = NULL;
-- Expected: severity-16 error, then return without logging or sending email.

Checklist

  • Follows the conventions in CONTRIBUTING.md (naming, header comment block, CREATE OR ALTER, lowercase data types, etc.)
  • One object per file, filename matches the object name
  • The header comment block is filled in (description, parameters, examples, modifications)
  • Re-running behavior was checked in an isolated development environment, or runtime verification is identified as not performed

@amtwo
amtwo marked this pull request as ready for review November 1, 2026 22:53
@amtwo
amtwo merged commit 01456f6 into main Nov 1, 2026
@amtwo
amtwo deleted the codex/issue-26-emailfrom-closing-angle-bracket branch November 1, 2026 22:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Needed to fix the @emailfrom

1 participant