Skip to content

Add idempotency_token to job_runs resource#5882

Draft
radakam wants to merge 2 commits into
mainfrom
job-runs-idempotency-wait-for-completion
Draft

Add idempotency_token to job_runs resource#5882
radakam wants to merge 2 commits into
mainfrom
job-runs-idempotency-wait-for-completion

Conversation

@radakam

@radakam radakam commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

No description provided.

Job runs now send an automatic idempotency_token on run-now so a retried
deployment reuses the existing run instead of triggering a duplicate. The
token is the hex SHA-256 of the RunNow request (job_id cleared of the token
itself), computed in DoCreate on a copy so it is never persisted to state.

A user-set idempotency_token is rejected at validation time, and the local
testserver now deduplicates run-now by token so the behavior is covered by
tests.
@radakam radakam temporarily deployed to test-trigger-is July 9, 2026 14:20 — with GitHub Actions Inactive
@radakam radakam temporarily deployed to test-trigger-is July 9, 2026 14:20 — with GitHub Actions Inactive
@eng-dev-ecosystem-bot

eng-dev-ecosystem-bot commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator

Integration test report

Commit: acf313b

Run: 29083334329

Env 💚​RECOVERED 🙈​SKIP ✅​pass 🙈​skip Time
💚​ aws linux 4 4 230 1078 6:11
💚​ aws windows 4 4 232 1076 7:21
💚​ aws-ucws linux 4 4 314 996 5:21
💚​ aws-ucws windows 4 4 316 994 7:31
💚​ azure linux 4 4 230 1077 5:46
💚​ azure windows 4 4 232 1075 7:12
💚​ azure-ucws linux 4 4 316 993 6:29
💚​ azure-ucws windows 4 4 318 991 7:27
💚​ gcp linux 4 4 229 1079 5:11
💚​ gcp windows 4 4 231 1077 7:18
8 interesting tests: 4 RECOVERED, 4 SKIP
Test Name aws linux aws windows aws-ucws linux aws-ucws windows azure linux azure windows azure-ucws linux azure-ucws windows gcp linux gcp windows
💚​ TestAccept 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
🙈​ TestAccept/bundle/invariant/no_drift 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/vector_search_endpoints/drift/recreated_same_name 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/vector_search_indexes/recreate/embedding_dimension 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/ssh/connection 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
💚​ TestFetchRepositoryInfoAPI_FromRepo 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
💚​ TestFetchRepositoryInfoAPI_FromRepo/root 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
💚​ TestFetchRepositoryInfoAPI_FromRepo/subdir 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
Top 12 slowest tests (at least 2 minutes):
duration env testname
6:32 aws-ucws windows TestAccept
6:26 azure-ucws windows TestAccept
6:24 gcp windows TestAccept
6:17 aws windows TestAccept
6:03 azure windows TestAccept
2:59 gcp linux TestAccept
2:54 azure linux TestAccept
2:52 aws linux TestSecretsPutSecretStringValue
2:51 azure-ucws linux TestAccept
2:49 aws linux TestAccept
2:48 aws-ucws linux TestAccept
2:11 azure-ucws linux TestSecretsPutSecretStringValue

Covers the idempotency token end-to-end: deploy triggers a run, the run is
dropped from local state (keeping the job so job_id and the derived token stay
stable), and a redeploy re-issues run-now. The backend dedupes on the token and
returns the existing run, so no duplicate is created.

Drop the DoCreate-level TestJobRunIdempotentCreate since the acceptance test now
covers that path end-to-end; the token helper's unit tests remain.
@radakam radakam temporarily deployed to test-trigger-is July 10, 2026 09:31 — with GitHub Actions Inactive
@radakam radakam temporarily deployed to test-trigger-is July 10, 2026 09:31 — with GitHub Actions Inactive
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