Skip to content

[WIP] Fix trend data collection in api consumption report#32638

Merged
pelikhan merged 7 commits into
mainfrom
copilot/fix-trend-data-collection
May 16, 2026
Merged

[WIP] Fix trend data collection in api consumption report#32638
pelikhan merged 7 commits into
mainfrom
copilot/fix-trend-data-collection

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 16, 2026

  • Locate api-consumption-report workflow source and related context
  • Inspect referenced workflow run details/log context from GitHub Actions
  • Run baseline build/lint/test commands before making changes
  • Implement minimal workflow prompt updates for first-run trend backfill behavior
  • Add or update focused tests/fixtures if needed
  • Run targeted validation for changed area
  • Run final security/review validation and summarize

Copilot AI and others added 6 commits May 16, 2026 14:54
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
@pelikhan pelikhan marked this pull request as ready for review May 16, 2026 14:58
Copilot AI review requested due to automatic review settings May 16, 2026 14:58
@pelikhan pelikhan merged commit b5ed7fa into main May 16, 2026
@pelikhan pelikhan deleted the copilot/fix-trend-data-collection branch May 16, 2026 14:58
Copilot stopped work on behalf of pelikhan due to an error May 16, 2026 14:59
Copilot AI requested a review from pelikhan May 16, 2026 14:59
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

Updates the api-consumption-report workflow prompt to improve trend/history data collection, especially on first run or when cache history is sparse.

Changes:

  • Adds a cache-history “entry count” check to choose between incremental (-1d) and backfill (-90d) log collection.
  • Introduces a backfill_entries.json artifact format for per-day summaries when running in backfill mode.
  • Replaces “append” guidance with explicit merge/upsert-by-date logic and adds discussion metadata fields for collection mode/start date.
Show a summary per file
File Description
.github/workflows/api-consumption-report.md Enhances the prompt to support backfill collection and deterministic merging of daily trend history.

Copilot's findings

Tip

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

  • Files reviewed: 1/1 changed files
  • Comments generated: 3

Comment on lines +58 to +66
Before calling `logs`, inspect the cache state to choose a collection window:

```bash
history_file="/tmp/gh-aw/cache-memory/trending/api-consumption/history.jsonl"
entry_count=0
if [ -f "$history_file" ]; then
if ! entry_count=$(wc -l < "$history_file"); then
echo "warning: unable to count existing history entries; defaulting to 0"
entry_count=0
Comment on lines +71 to 74
Use the `agentic-workflows` MCP `logs` tool with this rule (assuming one deduplicated row per day after Step 3 merge; 30 entries is roughly 30 days of daily points, enough for stable 7-day and 30-day trend visuals):

- If `entry_count >= 30` (history is already rich): collect only incremental data:

Comment on lines +163 to +169
Structure:

```json
[
{
"date": "2024-01-14",
"recorded_at": "2024-01-14-23-59-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.

[q] fix trend data collection in api-consumption-report

3 participants