Skip to content

Harden aw-portfolio-yield finalization and add Sentry OTel fallback#33739

Merged
mnkiefer merged 7 commits into
mainfrom
copilot/fix-github-actions-job-agent
May 21, 2026
Merged

Harden aw-portfolio-yield finalization and add Sentry OTel fallback#33739
mnkiefer merged 7 commits into
mainfrom
copilot/fix-github-actions-job-agent

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 21, 2026

The agent job in aw-portfolio-yield was failing during postcompute when agent-produced recommendation payloads contained malformed or non-canonical entries. This update makes postcompute resilient to untrusted recommendation shapes and ensures telemetry validation can continue via Sentry when Grafana is unavailable.

  • Postcompute resilience (root-cause fix)

    • scripts/aw_yield_postcompute.py now tolerates bad recommendation payloads instead of failing the job:
      • supports seed entries with either path or paths
      • ignores unknown workflow references
      • ignores conflicting multi-bucket assignments for the same workflow
    • Invalid entries are downgraded to notes so report generation can complete.
  • Telemetry backend usage

    • .github/workflows/aw-portfolio-yield.md now imports shared/mcp/sentry.md in addition to Grafana/OTLP components.
    • Prompt guidance now explicitly falls back to Sentry trace validation when Grafana lookup is unavailable.
  • Regression coverage

    • Added focused cases in tests/test_aw_yield_postcompute.py for:
      • unknown/conflicting recommendation entries
      • merge seed entries that provide paths lists
# aw_yield_postcompute.py (normalized behavior)
if path not in workflows:
    notes.append(f"Ignored unknown workflow in recommendations: {path}")
    continue

if other and other != bucket:
    notes.append(
        f"Ignored conflicting recommendation for '{path}' in bucket '{bucket}' "
        f"(already in '{other}')."
    )
    continue

Copilot AI and others added 3 commits May 21, 2026 10:31
Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
Copilot AI changed the title Fix aw-portfolio-yield agent failure and use OTel backends Harden aw-portfolio-yield finalization and add Sentry OTel fallback May 21, 2026
Copilot AI requested a review from mnkiefer May 21, 2026 10:35
@mnkiefer mnkiefer marked this pull request as ready for review May 21, 2026 11:05
Copilot AI review requested due to automatic review settings May 21, 2026 11:05
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request hardens aw-portfolio-yield postcompute finalization against malformed/untrusted recommendation payloads, and updates the workflow prompt/imports so telemetry validation can fall back to Sentry when Grafana is unavailable.

Changes:

  • Make postcompute tolerant of malformed agent recommendations by ignoring unknown workflows and conflicting multi-bucket assignments (recording notes instead of failing).
  • Extend recommendation seed parsing to support entries that provide paths lists (in addition to single path values).
  • Add regression tests for the new resilience behavior and update the aw-portfolio-yield workflow to import Sentry MCP + document the fallback.
Show a summary per file
File Description
scripts/aw_yield_postcompute.py Makes recommendation normalization resilient (unknown/conflicting entries become notes) and supports seed entries with paths.
tests/test_aw_yield_postcompute.py Adds regression tests for ignoring unknown/conflicting recommendations and for seed paths list handling.
.github/workflows/aw-portfolio-yield.md Imports shared/mcp/sentry.md and documents Sentry trace validation fallback when Grafana lookup is unavailable.
.github/workflows/workflow-health-manager.lock.yml Updates embedded awf-config model alias map (adds antigravity and newer Gemini aliases where applicable).
.github/workflows/workflow-generator.lock.yml Updates embedded awf-config model alias map (adds antigravity and newer Gemini aliases where applicable).
.github/workflows/video-analyzer.lock.yml Updates embedded awf-config model alias map (adds antigravity and newer Gemini aliases where applicable).
.github/workflows/test-workflow.lock.yml Updates embedded awf-config model alias map (adds antigravity and newer Gemini aliases where applicable).
.github/workflows/test-quality-sentinel.lock.yml Updates embedded awf-config model alias map (adds antigravity and newer Gemini aliases where applicable).
.github/workflows/test-project-url-default.lock.yml Updates embedded awf-config model alias map (adds antigravity and newer Gemini aliases where applicable).
.github/workflows/test-dispatcher.lock.yml Updates embedded awf-config model alias map (adds antigravity and newer Gemini aliases where applicable).
.github/workflows/super-linter.lock.yml Updates embedded awf-config model alias map (adds antigravity and newer Gemini aliases where applicable).
.github/workflows/slide-deck-maintainer.lock.yml Updates embedded awf-config model alias map (adds antigravity and newer Gemini aliases where applicable).
.github/workflows/security-review.lock.yml Updates embedded awf-config model alias map (adds antigravity and newer Gemini aliases where applicable).
.github/workflows/security-compliance.lock.yml Updates embedded awf-config model alias map (adds antigravity and newer Gemini aliases where applicable).
.github/workflows/repo-tree-map.lock.yml Updates embedded awf-config model alias map (adds antigravity and newer Gemini aliases where applicable).
.github/workflows/refiner.lock.yml Updates embedded awf-config model alias map (adds antigravity and newer Gemini aliases where applicable).
.github/workflows/q.lock.yml Updates embedded awf-config model alias map (adds antigravity and newer Gemini aliases where applicable).
.github/workflows/pr-description-caveman.lock.yml Updates embedded awf-config model alias map (adds antigravity and newer Gemini aliases where applicable).
.github/workflows/poem-bot.lock.yml Updates embedded awf-config model alias map (adds antigravity and newer Gemini aliases where applicable).
.github/workflows/plan.lock.yml Updates embedded awf-config model alias map (adds antigravity and newer Gemini aliases where applicable).
.github/workflows/pdf-summary.lock.yml Updates embedded awf-config model alias map (adds antigravity and newer Gemini aliases where applicable).
.github/workflows/metrics-collector.lock.yml Updates embedded awf-config model alias map (adds antigravity and newer Gemini aliases where applicable).
.github/workflows/mergefest.lock.yml Updates embedded awf-config model alias map (adds antigravity and newer Gemini aliases where applicable).
.github/workflows/lint-monster.lock.yml Updates embedded awf-config model alias map (adds antigravity and newer Gemini aliases where applicable).
.github/workflows/jsweep.lock.yml Updates embedded awf-config model alias map (adds antigravity and newer Gemini aliases where applicable).
.github/workflows/gpclean.lock.yml Updates embedded awf-config model alias map (adds antigravity and newer Gemini aliases where applicable).
.github/workflows/example-permissions-warning.lock.yml Updates embedded awf-config model alias map (adds antigravity and newer Gemini aliases where applicable).
.github/workflows/dev.lock.yml Updates embedded awf-config model alias map (adds antigravity and newer Gemini aliases where applicable).
.github/workflows/dev-hawk.lock.yml Updates embedded awf-config model alias map (adds antigravity and newer Gemini aliases where applicable).
.github/workflows/daily-team-status.lock.yml Updates embedded awf-config model alias map (adds antigravity and newer Gemini aliases where applicable).
.github/workflows/craft.lock.yml Updates embedded awf-config model alias map (adds antigravity and newer Gemini aliases where applicable).
.github/workflows/contribution-check.lock.yml Updates embedded awf-config model alias map (adds antigravity and newer Gemini aliases where applicable).
.github/workflows/code-simplifier.lock.yml Updates embedded awf-config model alias map (adds antigravity and newer Gemini aliases where applicable).
.github/workflows/ci-coach.lock.yml Updates embedded awf-config model alias map (adds antigravity and newer Gemini aliases where applicable).
.github/workflows/brave.lock.yml Updates embedded awf-config model alias map (adds antigravity and newer Gemini aliases where applicable).
.github/workflows/bot-detection.lock.yml Updates embedded awf-config model alias map (adds antigravity and newer Gemini aliases where applicable).
.github/workflows/archie.lock.yml Updates embedded awf-config model alias map (adds antigravity and newer Gemini aliases where applicable).
.github/workflows/ace-editor.lock.yml Updates embedded awf-config model alias map (adds antigravity and newer Gemini aliases where applicable).

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 121/236 changed files
  • Comments generated: 0

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 21, 2026

Design Decision Gate 🏗️ completed the design decision gate check.

No ADR enforcement needed: PR #33739 does not have the 'implementation' label and has 0 new lines of code in default business logic directories (threshold: 100).

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 21, 2026

🧪 Test Quality Sentinel completed test quality analysis.

No test files were added or modified in this PR. Test Quality Sentinel skipped. This PR only contains changes to workflow lock files (.lock.yml) and one workflow markdown file (.github/workflows/aw-portfolio-yield.md), with no test coverage changes.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 21, 2026

PR Code Quality Reviewer completed the code quality review.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 21, 2026

🧠 Matt Pocock Skills Reviewer failed during the skills-based review.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 21, 2026

🧠 Matt Pocock Skills Reviewer failed during the skills-based review.

@github-actions github-actions Bot mentioned this pull request May 21, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 21, 2026

Design Decision Gate 🏗️ completed the design decision gate check.

No ADR enforcement needed: PR #33739 does not have the 'implementation' label and has 0 new lines of code in business logic directories (threshold: 100).

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 21, 2026

🧪 Test Quality Sentinel completed test quality analysis.

No test files were added or modified in this PR. Test Quality Sentinel analysis skipped.

Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

Code Review Summary

This PR successfully addresses the root cause of aw-portfolio-yield agent job failures by making postcompute resilient to malformed agent recommendations. The changes demonstrate good defensive programming practices.

What was done well:

  • ✅ Error recovery strategy: failures downgraded to warnings with clear notes
  • ✅ Comprehensive test coverage for edge cases (unknown workflows, conflicting recommendations, paths lists)
  • ✅ Consistent pattern applied across both seed and agent recommendation handling
  • ✅ Telemetry fallback added (Sentry) when Grafana is unavailable

Minor suggestion:
One non-blocking observation about explicit None handling in the recommendation_buckets function to improve code clarity.

Approving as the changes are correct and well-tested.

🔎 Code quality review by PR Code Quality Reviewer · ● 905.9K

Comment thread scripts/aw_yield_postcompute.py Outdated
Comment thread scripts/aw_yield_postcompute.py
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 21, 2026

PR Code Quality Reviewer completed the code quality review.

Code review complete: PR code quality looks good with only one minor defensive programming suggestion already noted in existing review comments

@mnkiefer
Copy link
Copy Markdown
Collaborator

@copilot Address all review comments from github-actions.

Copilot AI and others added 3 commits May 21, 2026 13:33
Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 21, 2026

@copilot Address all review comments from github-actions.

Addressed the actionable github-actions review feedback in commit 88ab0b7 by adding explicit None handling for recommendation seed path values in scripts/aw_yield_postcompute.py before normalization. Targeted tests (tests/test_aw_yield_postcompute.py) pass, and final validation is clean.

@mnkiefer
Copy link
Copy Markdown
Collaborator

@copilot Resolve merge conflicts

Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
@mnkiefer mnkiefer merged commit e150c2f into main May 21, 2026
@mnkiefer mnkiefer deleted the copilot/fix-github-actions-job-agent branch May 21, 2026 13:58
Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 21, 2026

@copilot Resolve merge conflicts

Resolved by merging origin/main into this branch and fixing all lockfile conflicts in commit 3e02c72ea5.

Copilot AI restored the copilot/fix-github-actions-job-agent branch May 21, 2026 13:58
Copilot stopped work on behalf of mnkiefer due to an error May 21, 2026 13:59
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