Skip to content

Add Azure Pipelines warning and error annotations - #1037

Merged
Sun Haoran (haoranpb) merged 3 commits into
mainfrom
copilot/ado-log-annotations
Nov 27, 2026
Merged

Sun Haoran (haoranpb) merged 3 commits into
mainfrom
copilot/ado-log-annotations

Conversation

@haoranpb

@haoranpb Sun Haoran (haoranpb) commented Nov 27, 2026 •

Copy link
Copy Markdown
Collaborator

Emit warning and error logs as CI annotations on Azure Pipelines (##vso[task.logissue]), in addition to GitHub Actions.

  • setup_logging keeps its github_actions / azure_pipelines flags and raises ValueError if both are set.
  • A single stderr handler renders warnings and errors as annotations for the active platform and everything else as normal console output. The separate annotation handler and the skip filter are removed.
  • Annotations go to stderr, so stdout stays free for command results captured by pipelines (for example $versions = uv run bcbench bc-versions). Both the ADO agent and the GitHub runner process logging commands from stderr.
  • Azure Pipelines command neutralization and secret redaction still apply to all output, including annotations.

Not yet exercised in a live ADO pipeline.

@github-code-quality

github-code-quality Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

Code coverage overview

Languages: Python

Python / code-coverage/pytest

main 32877af copilot/ado-log-anno... 57b3f1d +/-
88% 88% 0%
View coverage of the 2 most impacted files.
File main 32877af copilot/ado-log-anno... 57b3f1d +/-
packages/bcbenc...ch_core/logs.py 100% 99% -1%
src/bcbench/eva...e/codereview.py 93% 94% +1%

ℹ️ Calculations represent line coverage. Results may change as calculations are updated.


Updated November 27, 2026 07:00 UTC

Replace the github_actions/azure_pipelines flags with one ci: CIPlatform | None parameter, since only one platform is active at a time. A single stderr handler formats warnings and errors as annotations, removing the extra handlers, record flag and skip filter, and keeping stdout free for command results captured by pipelines.

Co-authored-by: Copilot <[email protected]>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Live Azure Pipelines validation is needed to confirm stderr annotations are recognized while captured stdout remains usable by PowerShell pipeline consumers.

No open issues 🎉

What changed in this PR

Adds Azure Pipelines warning and error annotations to the shared logging library while preserving GitHub Actions support and keeping stdout available for command results.

Changes:

  • Uses a single stderr handler with platform-specific annotation formatters.
  • Rejects simultaneous CI platform flags and preserves secret redaction and Azure Pipelines command neutralization.
  • Updates tests and documentation for annotation formatting, stream routing, and configuration.
File Description
packages/​bcbench-core/​tests/​test_logs.py Tests annotation formatting, escaping, stderr routing, redaction, and mutually exclusive flags.
packages/​bcbench-core/​src/​bcbench_core/​logs.py Adds platform-specific formatters and consolidates logging into one stderr handler.
packages/​bcbench-core/​README.md Documents CI annotation flags and stderr output behavior.

Review effort: Balanced

@haoranpb
Sun Haoran (haoranpb) enabled auto-merge (squash) November 27, 2026 07:34
@haoranpb
Sun Haoran (haoranpb) merged commit 3d78751 into main Nov 27, 2026
17 of 18 checks passed
@haoranpb
Sun Haoran (haoranpb) deleted the copilot/ado-log-annotations branch November 27, 2026 08:04
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.

3 participants