feat(safeoutputs): add work-item filing to noop and missing-tool safe outputs#521
feat(safeoutputs): add work-item filing to noop and missing-tool safe outputs#521Copilot wants to merge 6 commits into
Conversation
…e outputs Agent-Logs-Url: https://github.com/githubnext/ado-aw/sessions/f7059573-7767-4cc5-b10c-53fac12aa232 Co-authored-by: jamesadevine <4742697+jamesadevine@users.noreply.github.com>
…D handling Agent-Logs-Url: https://github.com/githubnext/ado-aw/sessions/f7059573-7767-4cc5-b10c-53fac12aa232 Co-authored-by: jamesadevine <4742697+jamesadevine@users.noreply.github.com>
|
@copilot implement sensible defaults for the workitem. These safeoutputs always should now create or append to a work item. |
… items with sensible defaults Agent-Logs-Url: https://github.com/githubnext/ado-aw/sessions/e309e3af-fbce-4cfe-91d8-420be5233943 Co-authored-by: jamesadevine <4742697+jamesadevine@users.noreply.github.com>
Done in d0257b8. Both tools now always file or append to a work item with no config required:
The Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
🔍 Rust PR ReviewSummary: Has one correctness bug (silent config loss) that should be fixed before merge; everything else looks solid. Findings🐛 Bugs / Logic Issues
|
… file When create-work-item has no explicit assignee configured in front matter, Stage 3 now falls back to the email of the person who last committed changes to the agent source markdown file. The lookup uses git log -1 --format=%ae and degrades gracefully (no assignee set) when git history is unavailable (e.g. shallow clone). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
WorkItemReportConfig.title was a bare String with no serde default. When users provided a partial work-item config (e.g. only work-item-type: Bug), serde deserialization failed and get_tool_config's unwrap_or_default() silently discarded all overrides with no error or warning. Fix: change title to Option<String> with #[serde(default)]. Each caller (noop, missing-tool) passes its context-specific default title to file_or_append_work_item, which resolves the effective title via .unwrap_or(default_title). Add regression tests for partial work-item configs to both noop and missing-tool. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
🔍 Rust PR ReviewSummary: Has one meaningful bug that breaks the stated design guarantee — the "never blocks the pipeline" promise is violated in HTTP error paths. Findings🐛 Bugs / Logic Issues
|
🔍 Rust PR ReviewSummary: Looks good overall — the feature is well-structured and the graceful-degradation path is a solid design choice. Two findings worth addressing before merge. Findings🐛 Bugs / Logic Issues
|
Adds work-item filing behaviour to
noopandmissing-toolsafe outputs. The Stage 3 executor always files an Azure DevOps work item or appends a comment to an existing one when these diagnostic tools are invoked. All fields have sensible defaults so no front-matter configuration is required.Summary
src/safeoutputs/mod.rs— shared infrastructure:WorkItemReportConfig: configures title, work-item-type, area/iteration paths, tags, and stats inclusionwiql_find_work_item_by_title(): WIQL search for a non-closed item matching the configured titlefile_or_append_work_item(): comment on existing item if found; create new one otherwise. Returns a warning (not a failure) when ADO credentials are absent or the WIQL call fails, so these always-on tools never block the pipelinesrc/safeoutputs/noop.rs—NoopConfigwith awork_item: WorkItemReportConfigfield that defaults to a Task titled"Agent reported no operation"; executor always calls the shared helpersrc/safeoutputs/missing_tool.rs—MissingToolConfigwith awork_item: WorkItemReportConfigfield that defaults to a Task titled"Agent encountered missing tool"; executor always calls the shared helperdocs/safe-outputs.md— documents the always-on behaviour and all override optionsBoth tools work with zero configuration. Override any field in front matter to customise the work item:
Stage 3 runs a WIQL query to find any non-closed item with the configured title. If found, a comment is appended; otherwise a new work item is created. If ADO credentials are not available the executor succeeds with a warning instead of failing hard.
Test plan
cargo test— all existing and new unit tests pass. New tests cover config deserialization, default field values, and the graceful-warning fallback when ADO credentials are not present.