Skip to content

Add endpoint to revert a failed ingestion job - #669

Merged
vish-cs merged 1 commit into
datacommonsorg:masterfrom
vish-cs:rollback
Jul 30, 2026
Merged

Add endpoint to revert a failed ingestion job#669
vish-cs merged 1 commit into
datacommonsorg:masterfrom
vish-cs:rollback

Conversation

@vish-cs

@vish-cs vish-cs commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Adds a new POST /imports/revert endpoint and rollback helper to revert dataset imports to their previous version in Spanner and reset state to STAGING.

Changes

  • New Endpoint: Added POST /imports/revert (RevertImportRequest/RevertImportResponse) supporting single and batch dataset reversions with dryRun mode.
  • Rollback Helper: Created utils/rollback_helper.py to query version history and revert datasets to their last known good version.
  • Spanner Client: Added get_import_version_history, get_import_latest_version, revert_import_state, and check_failed_imports.
  • Tests: Added utils/rollback_helper_test.py and updated Spanner client tests (38/38 unit tests passing).

@codacy-production

codacy-production Bot commented Jul 20, 2026

Copy link
Copy Markdown

Not up to standards ⛔

🔴 Issues 2 high · 3 medium · 20 minor

Alerts:
⚠ 25 issues (≤ 0 issues of at least minor severity)

Results:
25 new issues

Category Results
UnusedCode 2 medium
Documentation 12 minor
ErrorProne 2 high
CodeStyle 8 minor
Complexity 1 medium

View in Codacy

🟢 Metrics 68 complexity

Metric Results
Complexity 68

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

gemini-code-assist[bot]

This comment was marked as outdated.

Comment thread pipeline/workflow/spanner-ingestion-workflow.yaml
@vish-cs vish-cs changed the title WIP rollback Add rollback logic to the ingestion workflow Jul 21, 2026
@vish-cs
vish-cs requested a review from gmechali July 21, 2026 14:45
@vish-cs
vish-cs force-pushed the rollback branch 2 times, most recently from 5749b85 to 73c9a02 Compare July 28, 2026 16:30
@vish-cs
vish-cs requested a review from rohitkumarbhagat July 28, 2026 16:32
@vish-cs vish-cs changed the title Add rollback logic to the ingestion workflow Add endpoint to revert a failed ingestion job Jul 28, 2026
@vish-cs
vish-cs force-pushed the rollback branch 4 times, most recently from d39b485 to fc04214 Compare July 30, 2026 07:29
@vish-cs
vish-cs merged commit 79ae77a into datacommonsorg:master Jul 30, 2026
10 of 11 checks passed
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.

2 participants