Skip to content

chore: sync release v1.75.2 to main branch - #6977

Merged
achettyiitr merged 6 commits into
masterfrom
sync-release-b211809dd1ce16a333ad9e2ecefcec4deb25c49a
May 19, 2026
Merged

achettyiitr merged 6 commits into
masterfrom
sync-release-b211809dd1ce16a333ad9e2ecefcec4deb25c49a

Conversation

@rudderstack-github-actions

Copy link
Copy Markdown
Contributor

Description

Syncing patch release v1.75.2 to main branch

↓↓ Please review and edit commit overrides before merging ↓↓

BEGIN_COMMIT_OVERRIDE
fix(batchrouter): preserve prior LastJobStatus error on drain (#6958)
fix: clickhouse quarter partition type (#6965)
fix: snowpipe streaming bulk status offset (#6966)
END_COMMIT_OVERRIDE

achettyiitr and others added 5 commits May 15, 2026 11:28
# Description

When a job is drained in the batch router's `scheduleJobs` (job expired,
source not found, destination disabled, etc.), the `ErrorResponse`
written to `job_status` was synthesized from an empty `{}` with just
`{"reason": "<drain reason>"}`, e.g.

```json
{ "reason": "job expired" }
```

Any upstream error from the previous delivery attempt that lived on
`job.LastJobStatus.ErrorResponse` — fields like `error`, `response`,
`firstAttemptedAt` — was clobbered, so by the time a job reached status
`Aborted` with code `410` we'd lost all the context about *why* it had
been failing.

### Change

In `router/batchrouter/worker.go`, base the drained status's
`ErrorResponse` on `job.LastJobStatus.ErrorResponse` instead of
`[]byte("{}")`. `routerutils.EnhanceJSON` then merges the new `reason`
field into the existing object rather than replacing it.

```diff
-                ErrorResponse: routerutils.EnhanceJSON([]byte(`{}`), "reason", finalReason),
+                errResponse := routerutils.EnhanceJSON(job.LastJobStatus.ErrorResponse, "reason", finalReason)
+                ErrorResponse: errResponse,
```

After the fix, a drained job's `ErrorResponse` carries the prior
upstream context alongside the drain reason:

```json
{
  "error": "500 internal server error",
  "response": "upstream timed out",
  "firstAttemptedAt": "2024-01-01T00:00:00.000Z",
  "reason": "job expired"
}
```

`ErrorCode` stays `410` and `JobState` stays `Aborted` — no change to
drain semantics, only what we surface to debuggers and downstream
reporting.

### Tests

New file `router/batchrouter/worker_test.go` with
`TestScheduleJobsDrainBranch` covering three cases against a real
`scheduleJobs` call (mocked `jobsDB`, fake drainer):

1. **`preserves prior LastJobStatus error fields and stamps the drain
reason`** — the bug-fix path. A job with a prior
`{"error":"…","response":"…","firstAttemptedAt":"…"}` is drained;
asserts all three fields survive and `reason` is stamped on top.
2. **`synthesizes reason when LastJobStatus has no prior error
response`** — first-attempt jobs (empty `LastJobStatus.ErrorResponse`)
still end up with `{"reason":"job expired"}`. No regression on the
existing behavior.
3. **`uses source_not_found reason when the job's source is missing from
the destination`** — the second branch of the same drain condition
(`!sourceFound`) also benefits from the fix; the prior error is
preserved alongside `reason: "source_not_found"`.

## Linear Ticket

- Resolves INT-6358, INT-6356, INT-6349.

## Security

- [x] The code changed/added as part of this pull request won't create
any security issues with how the software is being used.

---------

Co-authored-by: Akash <[email protected]>
🤖 I have created a release *beep* *boop*
---


##
[1.75.1](v1.75.0...v1.75.1)
(2026-05-15)


### Bug Fixes

* **batchrouter:** preserve prior LastJobStatus error on drain
([#6958](#6958))
([eaabb87](eaabb87))

---
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>
# Description

Add support for quarterly partitioning in ClickHouse destinations using
\`toStartOfQuarter(received_at)\` as the partition expression.

## Changes

- \`clickhouse.go\`: Added \`case \"quarter\"\` to \`partitionExpr()\`
returning \`toStartOfQuarter(received_at)\`
- \`partition_test.go\`: Added unit test case for \`\"quarter\"\`
partition type
- \`clickhouse_test.go\`: Added integration test case verifying
\`toStartOfQuarter(received_at)\` partition key in \`system.tables\`

## Linear Ticket

- Resolves INT-6377

## Security

- [ ] The code changed/added as part of this pull request won't create
any security issues with how the software is being used.

Co-authored-by: Akash Chetty <[email protected]>
🔒 Scanned for secrets using gitleaks 8.29.1

# Description

- Fixes offset-based duplicate detection for Snowpipe Streaming when
`SnowpipeStreaming.bulkStatusEnabled `is on. Duplicate checks now use
the bulk status API (with a single pre-fetch per upload) instead of
per-channel GetStatus calls.

## Linear Ticket

- Resolves INT-6378

## Security

- [ ] The code changed/added as part of this pull request won't create
any security issues with how the software is being used.

---------

Co-authored-by: Akash Chetty <[email protected]>
🤖 I have created a release *beep* *boop*
---


##
[1.75.2](v1.75.1...v1.75.2)
(2026-05-19)


### Bug Fixes

* clickhouse quarter partition type
([#6965](#6965))
([e4ebe9c](e4ebe9c))
* snowpipe streaming bulk status offset
([#6966](#6966))
([1f2a141](1f2a141))

---
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>
@achettyiitr
achettyiitr requested a review from mihir20 May 19, 2026 09:21
@achettyiitr
achettyiitr merged commit af31e62 into master May 19, 2026
70 checks passed
@achettyiitr
achettyiitr deleted the sync-release-b211809dd1ce16a333ad9e2ecefcec4deb25c49a branch May 19, 2026 09:51
@codecov

codecov Bot commented May 19, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 74.28571% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 80.06%. Comparing base (516ba5b) to head (d11be4a).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
...tionmanager/snowpipestreaming/snowpipestreaming.go 72.72% 5 Missing and 4 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6977      +/-   ##
==========================================
+ Coverage   79.72%   80.06%   +0.33%     
==========================================
  Files         565      565              
  Lines       63714    63745      +31     
==========================================
+ Hits        50796    51036     +240     
+ Misses       9910     9675     -235     
- Partials     3008     3034      +26     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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