Skip to content

fix: skip completed translation downloads - #1789

Draft
bgub wants to merge 1 commit into
mainfrom
bg/skip-completed-download-workflow
Draft

fix: skip completed translation downloads#1789
bgub wants to merge 1 commit into
mainfrom
bg/skip-completed-download-workflow

Conversation

@bgub

@bgub bgub commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Summary

  • skip enqueue/download work for translations already completed on the server
  • reuse completed translation status through stage, poll, and download workflow steps
  • preserve schema re-merge behavior for existing up-to-date outputs

Verification

  • pnpm --filter gt typecheck
  • pnpm --filter gt test -- --run packages/cli/src/api/tests/downloadFileBatch.test.ts packages/cli/src/workflows/tests/download.test.ts packages/cli/src/workflows/utils/tests/filterFilesForEnqueue.test.ts
  • pnpm exec oxlint packages/cli/src/api/downloadFileBatch.ts packages/cli/src/workflows/download.ts packages/cli/src/workflows/stage.ts packages/cli/src/workflows/steps/DownloadStep.ts packages/cli/src/workflows/steps/PollJobsStep.ts packages/cli/src/workflows/utils/filterFilesForEnqueue.ts packages/cli/src/api/tests/downloadFileBatch.test.ts packages/cli/src/workflows/tests/download.test.ts
  • pnpm exec oxfmt --check packages/cli/src/api/downloadFileBatch.ts packages/cli/src/workflows/download.ts packages/cli/src/workflows/stage.ts packages/cli/src/workflows/steps/DownloadStep.ts packages/cli/src/workflows/steps/PollJobsStep.ts packages/cli/src/workflows/utils/filterFilesForEnqueue.ts packages/cli/src/api/tests/downloadFileBatch.test.ts packages/cli/src/workflows/tests/download.test.ts

Greptile Summary

This PR skips redundant work for translations already completed on the server. The main changes are:

  • Carries completed translation keys through staging, polling, and downloading.
  • Avoids status and download requests when completion is already known.
  • Re-merges cached schema outputs with current source content.
  • Adds tests for cached downloads and partial-locale workflows.

Confidence Score: 5/5

This looks safe to merge.

  • No blocking issues found in the changed code.

Important Files Changed

Filename Overview
packages/cli/src/api/downloadFileBatch.ts Moves the local cache check before the API request and preserves schema re-merge behavior.
packages/cli/src/workflows/steps/PollJobsStep.ts Reuses completed translation keys while polling active jobs separately.
packages/cli/src/workflows/steps/DownloadStep.ts Uses known readiness for downloads while retaining detailed checks for review-gated files.
packages/cli/src/workflows/utils/filterFilesForEnqueue.ts Returns per-locale completion keys with the existing enqueue partition.
packages/cli/src/workflows/stage.ts Propagates completed translation keys from staging into later workflow steps.
packages/cli/src/workflows/download.ts Passes known completion state into polling and avoids a redundant readiness query.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Upload and set up sources] --> B[Query completed translations]
  B --> C[Enqueue incomplete translations]
  B --> D[Carry completed keys forward]
  C --> E[Poll active jobs]
  D --> E
  E --> F[Build completed file tracker]
  F --> G{Detailed review status needed?}
  G -- Yes --> H[Query translation status]
  G -- No --> I[Reuse known completion]
  H --> J[Resolve output paths]
  I --> J
  J --> K{Current output recorded locally?}
  K -- Yes --> L[Skip download and re-merge schema output]
  K -- No --> M[Download and write output]
Loading

Reviews (1): Last reviewed commit: "fix: skip completed translation download..." | Re-trigger Greptile

Context used:

  • Rule used - Remove console.log statements and debug logging fr... (source)

Learned From
generaltranslation/gt-cloud#1266
generaltranslation/gt-cloud#1240

Base automatically changed from odysseus to main July 4, 2026 02:25
@bgub
bgub force-pushed the bg/skip-completed-download-workflow branch from fca60b9 to ff22961 Compare July 22, 2026 22:10
@bgub

bgub commented Jul 22, 2026

Copy link
Copy Markdown
Contributor Author

@greptileai

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