Skip to content

feat: implement reporting storage repository with adapters and bulk backfill - #2488

Open
ashleyshaw with Copilot wants to merge 6 commits into
developfrom
copilot/reporting-agent-v2-storage-layer-implementation
Open

feat: implement reporting storage repository with adapters and bulk backfill#2488
ashleyshaw with Copilot wants to merge 6 commits into
developfrom
copilot/reporting-agent-v2-storage-layer-implementation

Conversation

Copilot AI commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

Feature Pull Request

This repository enforces changelog, release, and label automation for all PRs and issues.
See the organisation-wide Automation Governance & Release Strategy for contributor rules.

Linked issues

Changelog

Added

This PR introduces the Reporting Agent v2 Phase 3.2 storage layer for persisted metadata, including a repository abstraction, SQL/NoSQL adapter model, transactional semantics, and bulk historical backfill support.

  • New storage module: scripts/metrics/integrations/reporting-storage-adapter.js
  • New fixtures: scripts/metrics/integrations/__tests__/fixtures/reporting-storage-fixtures.json
  • New test suite: scripts/metrics/integrations/__tests__/reporting-storage-adapter.test.js (30+ coverage target addressed)

Changed

  • Repository abstraction
    • ReportingStorageRepository now encapsulates storage operations behind an adapter contract.
  • Adapter pattern (SQL/NoSQL)
    • Added SqlMetadataAdapter and NoSqlMetadataAdapter with a shared in-memory transactional base.
  • CRUD and query operations
    • Added create/read/update/delete plus criteria-based query with sort, offset, and limit handling.
  • Bulk backfill
    • Added batched backfill with upsert/non-upsert modes, atomic/non-atomic behaviour, and structured partial error reporting.
  • Transaction support
    • Added begin/commit/rollback with rollback-failure propagation and contextual error wrapping.

Example usage:

const repository = new ReportingStorageRepository({ adapter: "sql" });

repository.bulkBackfill(records, {
  batchSize: 100,
  transaction: true,
  atomic: true,
  upsert: true,
});

Fixed

  • Reduced duplicated adapter filtering logic by centralising criteria matching in the shared base adapter.
  • Clarified and hardened error behaviour for rollback/commit failure paths in bulk operations.

Removed

  • No removals.

Checklist (Global DoD / PR)

  • All AC met and demonstrated
  • Tests added/updated (unit/E2E as appropriate)
  • Accessibility checklist completed (where relevant):
    • Semantic HTML and heading order verified
    • Keyboard navigation and visible focus states verified
    • ARIA used only where needed
    • Contrast and non-colour cues reviewed (WCAG 2.2 AA or higher)
  • Docs/readme/changelog updated (if user-facing)
  • Security checklist completed (where relevant):
    • Untrusted input validated and sanitised
    • Output escaped for its rendering context
    • Privileged actions enforce nonce and capability checks
    • No secrets/sensitive data introduced; OWASP risks reviewed
  • Code/design reviews approved
  • CI green; linked issues closed; release notes prepared (if shipping)

Copilot AI changed the title [WIP] Implement storage layer with CRUD and bulk operations feat: implement reporting storage repository with adapters and bulk backfill Aug 29, 2026
Copilot AI requested a review from ashleyshaw August 29, 2026 15:28
@ashleyshaw
ashleyshaw requested a lite review from Copilot August 29, 2026 16:22

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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@ashleyshaw
ashleyshaw marked this pull request as ready for review August 29, 2026 16:30
@github-actions

Copy link
Copy Markdown
Contributor

🔍 Reviewer Summary for PR #2488

CI Status:pending
Files changed: 3

Recommendations

  • CI checks not green

1 similar comment
@github-actions

Copy link
Copy Markdown
Contributor

🔍 Reviewer Summary for PR #2488

CI Status:pending
Files changed: 3

Recommendations

  • CI checks not green

@ashleyshaw
ashleyshaw enabled auto-merge (squash) August 29, 2026 16:50
@github-actions

github-actions Bot commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

🚫 This PR description is missing required template content.

Missing required section(s): Linked issues, Global DoD checklist

Please update the PR body using one of the repository PR templates:

Empty placeholders, unchecked checklist boxes, and stub issue references do not count.

@ashleyshaw ashleyshaw added this to the v1.1 milestone Aug 30, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🔍 Reviewer Summary for PR #2488

CI Status:pending
Files changed: 3

Recommendations

  • CI checks not green

@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Branch Naming Issue

This PR's branch name copilot/reporting-agent-v2-storage-layer-implementation doesn't follow the standard pattern.

Standard pattern: {type}/{scope}-{title} (e.g., feat/something, fix/bug-name)

Based on linked issue type: feature

Correct template should be: pr_feature.md

No action required — this is informational. Future PRs should use the correct branch name.

See Branching Strategy for more info.

@claude claude Bot added area:ci Build and CI pipelines area:scripts Scripts & tooling area:tests Test suites & harnesses lang:js JavaScript/TypeScript lang:json JSON config/content type:bug Bug or defect labels Sep 2, 2026
@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

🔍 Reviewer Summary for PR #2488

CI Status:pending
Files changed: 3

Recommendations

  • CI checks not green

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:ci Build and CI pipelines area:scripts Scripts & tooling area:tests Test suites & harnesses lang:js JavaScript/TypeScript lang:json JSON config/content type:bug Bug or defect

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Reporting Agent v2 Phase 3.2: Storage Layer Implementation

3 participants