Repository navigation
chore: pyt contract tests for candidate releases - #7252
Merged
Merged
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #7252 +/- ##
==========================================
- Coverage 80.27% 79.72% -0.55%
==========================================
Files 600 601 +1
Lines 67034 67177 +143
==========================================
- Hits 53811 53560 -251
- Misses 10070 10449 +379
- Partials 3153 3168 +15 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
fracasula
marked this pull request as ready for review
August 12, 2026 09:17
1 task done
itsmihir
approved these changes
Aug 14, 2026
This was referenced Aug 17, 2026
Closed
Merged
mihir20
pushed a commit
that referenced
this pull request
Aug 17, 2026
🤖 I have created a release *beep* *boop* --- ## [1.83.0-rc.1](v1.82.0...v1.83.0-rc.1) (2026-08-17) ### Features * add OriginalID and OriginalDestinationID to support replay event transformations ([#7274](#7274)) ([28d38e9](28d38e9)) * bingads integration tests ([#7253](#7253)) ([fdb8c0a](fdb8c0a)) * **processor:** fork event processing for rsources pipelines ([#7235](#7235)) ([707ea06](707ea06)) ### Bug Fixes * pyt contract tests data race ([#7247](#7247)) ([9e62d0c](9e62d0c)) ### Miscellaneous * bump sqlconnect-go to v1.30.2 ([#7251](#7251)) ([f5d6175](f5d6175)) * **jobsdb:** multi-consumer compaction improvements ([#7248](#7248)) ([b4af86c](b4af86c)) * pyt contract tests for candidate releases ([#7252](#7252)) ([149e91a](149e91a)) * pyt contract tests for transformations auth ([#7239](#7239)) ([ac4a859](ac4a859)) * **router:** support per-partition noOfWorkers override ([#7270](#7270)) ([9d6f7cf](9d6f7cf)) * sync release v1.82.0 to main branch ([#7243](#7243)) ([a6e29f2](a6e29f2)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: rudderstack-github-actions[bot] <236995729+rudderstack-github-actions[bot]@users.noreply.github.com>
mihir20
pushed a commit
that referenced
this pull request
Aug 18, 2026
🤖 I have created a release *beep* *boop* --- ## [1.83.0](v1.82.0...v1.83.0) (2026-08-17) ### Features * add OriginalID and OriginalDestinationID to support replay event transformations ([#7274](#7274)) ([28d38e9](28d38e9)) * bingads integration tests ([#7253](#7253)) ([fdb8c0a](fdb8c0a)) * **processor:** fork event processing for rsources pipelines ([#7235](#7235)) ([707ea06](707ea06)) ### Bug Fixes * pyt contract tests data race ([#7247](#7247)) ([9e62d0c](9e62d0c)) ### Miscellaneous * bump sqlconnect-go to v1.30.2 ([#7251](#7251)) ([f5d6175](f5d6175)) * **jobsdb:** multi-consumer compaction improvements ([#7248](#7248)) ([b4af86c](b4af86c)) * pyt contract tests for candidate releases ([#7252](#7252)) ([149e91a](149e91a)) * pyt contract tests for transformations auth ([#7239](#7239)) ([ac4a859](ac4a859)) * **router:** support per-partition noOfWorkers override ([#7270](#7270)) ([9d6f7cf](9d6f7cf)) * sync release v1.82.0 to main branch ([#7243](#7243)) ([a6e29f2](a6e29f2)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: rudderstack-github-actions[bot] <236995729+rudderstack-github-actions[bot]@users.noreply.github.com>
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.
Description
Repurposes the
integration_test/pytransformer_contractsuite from "old architecture vs new architecture" to "baseline rudder-pytransformer vs candidate rudder-pytransformer", and fixes the retry classification that the new routing exposed.The suite previously compared rudder-transformer + a per-subtest
openfaas-flask-basecontainer against rudder-pytransformer. That comparison is obsolete now that PyT is the only implementation, so both sides are now PyT images at two different tags and the openfaas/rudder-transformer scaffolding is deleted. Because both sides fetch transformation code per request, one container per version serves everyversionIDinstead of one container per subtest — roughly 90 fewer container starts per run.Which two images are compared is the caller's decision:
PYT_CANDIDATE_TAGandPYT_BASELINE_TAGare both required and neither has a default, soTestMainfails the package before any container starts if either is missing. CI resolves the two most recent released tags from ECR and exports them, so a new release is picked up automatically; locally you build your image (make build-ecr-latesttags itmain) and point the candidate at it. This also replaces the floatingmain/latesttags the suite used to pull, so runs are reproducible. If both tags resolve to the same value the suite refuses to run rather than compare an image against itself.Running it against your own PyT build
In the rudder-pytransformer repo, build the image —
make build-ecr-latest, which tags itmain— then from rudder-server point the candidate at that build and the baseline at the release you want to compare against:The rudder-pytransformer Makefile recipe sets both for you and takes the baseline tag as a required argument. You need to be able to pull from ECR for the baseline image (see the Notion docs); the candidate comes from your local build. Two things to know:
mainis whatever you last pulled or built, and the suite will happily compare that instead — with no warning. Rebuild before you trust a green run.Behaviour change (not test-only)
The suite now routes through the per-workspace PyT path, which activates cold-start classification and made an existing bug reachable:
isColdStartErrorno longer treats a 503 as a PyT cold start when the response carriesX-Rudder-Should-Retry: true. A labelled 503 means PyT is up and reporting a transient downstream failure (e.g. a geolocation timeout), not that the pod is missing; anything else, including a bare 502 from kube-proxy with no endpoints, still means "not ready yet". Without this,Transformer.Client.UserTransformer.retryRudderErrors.maxRetryis unenforceable, because the endless cold-start loop resumes retrying what the transport was just told to stop.X-Rudder-Should-RetryandX-Rudder-Error-Reasonare lifted into exported constants ininternal/transformer-client, documented as a wire format shared with rudder-pytransformer: renaming the constants is free, changing their values is a breaking change on both sides. The signal itself is defined once, astransformerclient.IsRetryableResponse, and both consumers — the retryable transport and the cold-start classifier — call it, so they cannot disagree about which responses carry the contract. The status set is 503-only, matching what PyT emits: it normalises downstream failures (a downstream 502 included) into its own 503 plus these headers.maxRetry=-1,maxElapsedTime=0);maxRetryexists so the contract tests terminate. A bounded budget in production is a misconfiguration, and crashing is the safe response: the jobs stay in jobsdb and are retried after the restart, whereas failing the events would abort them into proc-errors and lose customer data.internal/transformer-clientno longer closes the response body inside its retry strategy.retryablehttpalready drains and closes between attempts; our close also fired on the attempt that exhausts the budget, and that response is the one handed back to the caller — soforwardTest(the control-plane "test a transformation" path) gothttp: read on closed response bodyinstead of PyT's real status and body. Removing it also restores the 2KB drain that keep-alive reuse depends on.forwardTestnow reports the status code andX-Rudder-Error-Reasonwhen a body read fails, so a lost body still says whether PyT answered and why.Tests
TestIsColdStartError— new table test pinning which 5xx responses mean "pod isn't up yet", including the case-insensitive header match and the bare-5xx cold-start cases.TestRetryableResponseExhaustedPanics— drives a permanently-failing 503 +X-Rudder-Should-RetrythroughTransform()and asserts the process dies rather than dropping the events. The panic happens in awg.Gogoroutine so it cannot be recovered in-process; the test re-execs itself in a child and asserts the child died on the transformer error. Verified to fail if the events are made to fail instead.TestClient_ResponseBodyReadableAfterRetriesExhausted— pins thatDoreturns a readable body once retries are exhausted. Its second case documents a limitation we cannot fix here: when the context ends the retries mid-backoff,retryablehttpreturns the last completed attempt's response, already closed, paired with a nil error.Linear Ticket
< Fixes PIPE-3256 >
Security