Skip to content

feat(api): add episode QA and data ops APIs#89

Merged
shark0F0497 merged 7 commits into
mainfrom
feat/quality-check
Jun 9, 2026
Merged

feat(api): add episode QA and data ops APIs#89
shark0F0497 merged 7 commits into
mainfrom
feat/quality-check

Conversation

@shark0F0497

Copy link
Copy Markdown
Collaborator

Pull Request Checklist

Please ensure your PR meets the following requirements:

  • Code follows the style guidelines
  • Tests pass locally
  • Code is formatted
  • Documentation updated if needed
  • Commit messages follow conventional commits
  • PR description is complete and clear

Summary

This PR adds episode-level MCAP QA checks, a data-ops episode details API, and filtered bulk QA/cloud-sync preview and execution APIs.


Motivation

  • Give admins a single backend surface for episode details, latest QA state, latest sync state, and operational actions.
  • Support asynchronous bulk QA and cloud-sync actions based on the current filtered data set.
  • Prevent stale preview counts and SQL NULL edge cases from producing misleading bulk sync eligibility.

Changes

Modified Files

  • internal/server/server.go - Wires QA and data-ops handlers and registers data-ops admin routes.
  • internal/api/handlers/episode_qa_check.go - Adds episode MCAP integrity QA checks and QA run/history APIs.
  • internal/api/handlers/episode.go - Extends episode detail data for QA/sync workflows.
  • internal/api/handlers/data_ops.go - Adds the data details list endpoint and response assembly.
  • internal/api/handlers/data_ops_bulk.go - Adds filtered bulk QA/cloud-sync preview and asynchronous execution endpoints.
  • internal/api/handlers/transfer.go - Enqueues new episodes for QA after upload completion and checks insert ID errors.
  • internal/services/sync_worker.go - Enforces QA approval before manual cloud sync/resync.
  • internal/api/handlers/data_production_statistics.go - Aligns stats filters with data details needs.
  • internal/api/handlers/*_test.go - Adds/updates unit coverage for QA, data-ops filtering, bulk preview, sync eligibility, and stats filters.

Added Files

  • docs/designs/episode-qa-checks-mcap-integrity.zh.html - QA integrity-check design document.
  • docs/designs/data-details-center.zh.html - Data details API/page design document.
  • docs/designs/data-ops-bulk-actions-api.zh.html - Bulk QA/cloud-sync API design document.
  • internal/api/handlers/data_ops.go - Data details handler implementation.
  • internal/api/handlers/data_ops_bulk.go - Bulk action handler implementation.

Deleted Files

  • None

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update (documentation changes only)
  • Refactoring (code improvement without functional changes)
  • Performance improvement (code changes that improve performance)
  • Test changes (adding, modifying, or removing tests)

Impact Analysis

Breaking Changes

None

Backward Compatibility

Fully backward compatible. Existing episode, transfer, and sync APIs remain available.


Testing

Test Environment

  • Local development environment
  • Go test cache: /tmp/go-build-cache

Test Cases

  • Unit tests pass locally
  • Integration tests pass locally
  • E2E tests pass (if applicable)
  • Manual testing completed

Manual Testing Steps

  • Logged in as admin locally and verified data-ops list and bulk-sync preview behavior for QA approved episodes.
  • Reproduced and fixed the bulk sync preview NULL handling issue for episodes without sync logs.

Test Coverage

  • New tests added
  • Existing tests updated
  • Coverage maintained or improved

Commands run:

GOCACHE=/tmp/go-build-cache go test ./...
git diff --check

Screenshots / Recordings

Not applicable for backend-only changes.


Performance Impact

  • Memory usage: No material change
  • CPU usage: No material change
  • Throughput: No material change expected
  • Lock contention: No material change expected

Bulk actions intentionally run asynchronously. The first version does not add a persistent batch job table or progress tracker.


Documentation


Related Issues

  • Fixes #
  • Related to #
  • Refers to #

Additional Notes

  • The branch contains earlier commit scopes qa and data-ops; Keystone CONTRIBUTING lists narrower allowed scopes. I did not rewrite history after review because that requires explicit approval.
  • Swagger generated files are present locally but are not tracked in this repository checkout.

Reviewers

@reviewer1 @reviewer2


Notes for Reviewers

  • Please focus on internal/api/handlers/episode_qa_check.go, internal/api/handlers/data_ops.go, and internal/api/handlers/data_ops_bulk.go.
  • Please review sync eligibility semantics, especially approved QA gating and already-synced behavior.
  • Please verify the lightweight async bulk-action behavior is acceptable for v1.

Checklist for Reviewers

  • Code changes are correct and well-implemented
  • Tests are adequate and pass
  • Documentation is updated and accurate
  • No unintended side effects
  • Performance impact is acceptable
  • Backward compatibility maintained (if applicable)

@shark0F0497 shark0F0497 merged commit 00b9dc5 into main Jun 9, 2026
5 checks passed
@shark0F0497 shark0F0497 deleted the feat/quality-check branch June 9, 2026 05:58
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.

1 participant