refactor(job): migrate progress path to job-scoped endpoint - #829
Merged
Conversation
Point RapidataJob's status/progress path at the new GET /job/{jobId}/progress
instead of unpacking the pipeline to find the workflow and calling
GET /workflow/{workflowId}/progress. This drops the pipeline-unpacking
anti-pattern from the job class; get_results() (download-results) is unchanged.
Regenerate the OpenAPI client against current prod. The backend change that
added the job-scoped endpoint also deprecated GET /pipeline/{pipelineId} and
GET /workflow/{workflowId}/progress, which the generator strips; the still-live
order / QR-preview flow calls both directly, so a narrow keep-list in
generate-schema.sh keeps them generated until that flow migrates too.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: jorge <24812622+jorgeparavicini@users.noreply.github.com>
jorgeparavicini
marked this pull request as ready for review
August 19, 2026 11:57
LinoGiger
approved these changes
Aug 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
Migrates
RapidataJob's status / progress-bar path off the pipeline + workflow HTTP endpoints onto the newGET /job/{jobId}/progressadded (and merged) inrapidata-backend. Previously the job class unpacked the pipeline (GET /pipeline/{pipelineId}) to find the workflow id, then calledGET /workflow/{workflowId}/progress— the same anti-pattern the frontend already moved away from.SDK-only — the backend endpoint is already live.
Changes
rapidata_job.py— replace_get_workflow_progress()(pipeline-unpacking + workflow-progress) with_get_job_progress(), a single call tojob_api.job_job_id_progress_get(self.id).get_progress()anddisplay_progress_bar()now readcompletionPercentagefrom the job-scoped output. The new output exposes the samecompletionPercentagefield, so no progress-bar behaviour changes. 404 (job has no labelling task yet) is still swallowed → treated as 0%.api.rabbitdata.ch). This is a fullapi_clientrefresh, same as the repo's periodic "update OpenAPI client" commits.get_results()— untouched; still usesdownload-results. Confirmed working after regeneration.Out of scope, left exactly as-is
rapidata_order.py) andconfig/_qr_preview.py, which still legitimately use/pipeline/{id}and/workflow/{id}/progressfor the deprecated-but-live order path.workflow/_*.py.The backend PR that added the job-scoped endpoint also marked
GET /pipeline/{pipelineId}andGET /workflow/{workflowId}/progressasdeprecated.generate-schema.shstrips deprecated operations from the generated client — so a faithful regeneration removes exactly the two methods the out-of-scope order / QR flow still calls, leaving that flow uncompilable (pyright errors).To honour "leave the order/qr flow untouched" while keeping a compiling client, I added a narrow keep-list to the deprecation filter in
generate-schema.shthat exempts just those two paths. Everything else deprecated is still stripped (e.g.workflow_workflow_id_get,.../responses,.../compare-ab-summary— none consumed by the SDK — are correctly gone).On the spec/removal question: there is no endpoint filter — the SDK generates the entire joined backend spec, minus deprecated operations/fields. So nothing was (or could be) selectively removed; regeneration would just re-add it. The only lever is the deprecation filter, hence the keep-list. When the order/qr flow migrates onto job/order-scoped endpoints, drop the keep-list and these two endpoints fall out on their own.
Verification
uv run pyright src/rapidata/rapidata_client→ 0 errorsuv run pytest→ 136 passed, 4 failed. The 4 failures are pre-existing onmain(audience cost-warning / explicit-content-check tests — confirmed failing on a clean checkout before this change), unrelated to this migration.uv run blackon the changed file → clean.🔗 Session: https://poseidon.rapidata.internal/chat/node-f6b42c70