Repository navigation
chore: ing-svc workflow takes latest go tests - #4530
Conversation
Summary by CodeRabbit
WalkthroughA new step was added to the ingestion-service-test GitHub Actions workflow to update the Go module in the Changes
Sequence Diagram(s)sequenceDiagram
participant GitHub Actions
participant Ingestion Service Repo
participant Local Transformer Module
participant Remote Transformer Repo
GitHub Actions->>Ingestion Service Repo: Checkout repository
GitHub Actions->>Ingestion Service Repo: Set up Go environment
GitHub Actions->>Ingestion Service Repo: Add 'replace' directive in go.mod to use ../go (local)
GitHub Actions->>Ingestion Service Repo: Run 'go mod tidy'
Ingestion Service Repo->>Local Transformer Module: Resolve dependency from local path
GitHub Actions->>Ingestion Service Repo: Output go.mod for verification
Note over GitHub Actions: New job for dependency update
GitHub Actions->>Remote Transformer Repo: Get latest commit SHA
GitHub Actions->>Ingestion Service Repo: Clone repository
GitHub Actions->>Ingestion Service Repo: Checkout new branch
GitHub Actions->>Ingestion Service Repo: Update transformer dependency to latest SHA
GitHub Actions->>Ingestion Service Repo: Run 'go mod tidy'
GitHub Actions->>Ingestion Service Repo: Commit and push changes if any
GitHub Actions->>Ingestion Service Repo: Create pull request targeting main branch
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Suggestions for improvement:
Note ⚡️ Unit Test Generation is now available in beta!Learn more here, or try it out under "Finishing Touches" below. ✨ Finishing Touches🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
.github/workflows/ingestion-service-test.yml (1)
37-44: Relativereplacepath may break if job changes working-directory expectations
go mod edit -replace github.com/rudderlabs/rudder-transformer/go=../gorelies on:
- The transformer repo being checked-out at
$GITHUB_WORKSPACE(root)- The ingestion-svc clone living at
$GITHUB_WORKSPACE/rudder-ingestion-svc- The step running from inside
rudder-ingestion-svcIf any of those assumptions change (e.g. another step alters
working-directory, oractions/checkoutuses a custompath:), the relative path resolves incorrectly and tests will silently pull the remote module.Consider using an absolute path derived from the workspace to make the link robust:
- go mod edit -replace github.com/rudderlabs/rudder-transformer/go=../go +go mod edit -replace \ + github.com/rudderlabs/rudder-transformer/go=$GITHUB_WORKSPACE/go
$GITHUB_WORKSPACEis set by the runner and is stable across steps.Alternatively, switch to a Go 1.22 workspace (
go work init) to avoid per-reporeplacedirectives entirely.
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
.github/workflows/ingestion-service-test.yml(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (9)
- GitHub Check: Build Transformer Docker Image - PR / Build Transformer Docker Image AMD64
- GitHub Check: Build Transformer Docker Image - PR / Build Transformer Docker Image ARM64
- GitHub Check: Build User Transformer Docker Image - PR / Build Transformer Docker Image ARM64
- GitHub Check: Build User Transformer Docker Image - PR / Build Transformer Docker Image AMD64
- GitHub Check: Code Coverage
- GitHub Check: UT Tests
- GitHub Check: test_and_publish
- GitHub Check: Analyze (javascript-typescript)
- GitHub Check: Analyze (go)
|
Allure Test reports for this run are available at:
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #4530 +/- ##
===========================================
+ Coverage 91.44% 91.57% +0.12%
===========================================
Files 639 639
Lines 33774 33774
Branches 7978 7986 +8
===========================================
+ Hits 30885 30928 +43
+ Misses 2655 2588 -67
- Partials 234 258 +24 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Actionable comments posted: 3
🧹 Nitpick comments (2)
.github/workflows/prepare-for-prod-dt-deploy.yml (2)
196-199: Add--depth 1to the ingestion-svc clone to cut runner time and bandwidth
A full history fetch is unnecessary for dependency bumping. A shallow clone keeps the step < 1 s and avoids surprising rate-limit hits.-git clone https://${{secrets.PAT}}@github.com/rudderlabs/rudder-ingestion-svc.git +git clone --depth 1 https://${{secrets.PAT}}@github.com/rudderlabs/rudder-ingestion-svc.git
230-236:go getis deprecated from Go 1.20+ – switch togo work syncorgo mod edit
Future Go releases will dropgo getfor editinggo.mod. Replace with:go mod edit -require=github.com/rudderlabs/rudder-transformer/go@${LATEST_SHA} go mod tidyThis keeps the workflow future-proof.
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📥 Commits
Reviewing files that changed from the base of the PR and between 7570329 and 070ca1972457e223a9eda8f7b2a8dd6d45b12f32.
📒 Files selected for processing (1)
.github/workflows/prepare-for-prod-dt-deploy.yml(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (9)
- GitHub Check: Build Transformer Docker Image - PR / Build Transformer Docker Image AMD64
- GitHub Check: Build Transformer Docker Image - PR / Build Transformer Docker Image ARM64
- GitHub Check: Build User Transformer Docker Image - PR / Build Transformer Docker Image ARM64
- GitHub Check: Build User Transformer Docker Image - PR / Build Transformer Docker Image AMD64
- GitHub Check: Code Coverage
- GitHub Check: test_and_publish
- GitHub Check: UT Tests
- GitHub Check: Analyze (javascript-typescript)
- GitHub Check: Analyze (go)
|
Allure Test reports for this run are available at:
|
070ca19 to
02287c7
Compare
02287c7 to
d4a8e7d
Compare
|
Allure Test reports for this run are available at:
|
There was a problem hiding this comment.
Actionable comments posted: 0
♻️ Duplicate comments (2)
.github/workflows/prepare-for-prod-dt-deploy.yml (2)
217-235: Addset -euo pipefailfor fail-fast behaviourThe shell continues after silent errors (network hiccups on
go get, failedgit push, etc.).
Guarding the script with strict mode surfaces failures early and avoids half-done updates.- run: | + run: | + set -euo pipefail cd rudder-ingestion-svc
221-229: Static branch name → race condition across parallel runsMultiple workflow instances will all attempt to reuse
chore.update-transformer-go-tests, leading to deletion/push races. Incorporate a unique token (e.g. short SHA orgithub.run_id) in the branch name.- branch_name="chore.update-transformer-go-tests" + branch_name="chore.update-transformer-go-tests-${{ github.run_id }}"Remember to propagate the variable to the PR step.
🧹 Nitpick comments (2)
.github/workflows/prepare-for-prod-dt-deploy.yml (2)
174-177: Add an explicitif:to avoid double-running onpull_requesteventsUnlike the other jobs in this workflow,
update-ingestion-servicehas no event guard.
As written, it will also run onpull_request→closed(merge) events because those are in the globalon:block, resulting in the same update logic executing twice (push + PR-close). This is unnecessary load and increases the chance of race conditions.update-ingestion-service: if: github.event_name == 'push' # <- guard
258-267: Prefersecrets.GITHUB_TOKENover a long-lived PATThe job still injects the personal access token (
PAT) intoghcommands. GitHub’s automaticGITHUB_TOKENis scoped to the repo, rotates automatically, and is masked in logs. Switching reduces secret-management overhead and risk of accidental leak.- env: - GITHUB_TOKEN: ${{ secrets.PAT }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}Afterward, remove other explicit PAT usages (
git clone,git push) by runninggh auth setup-gitor configuring the remote withhttps://x-access-token:${GITHUB_TOKEN}@github.com/....
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📥 Commits
Reviewing files that changed from the base of the PR and between 02287c7cfb648c5f9abb96ba90753fd011dc4159 and d4a8e7d.
📒 Files selected for processing (2)
.github/workflows/ingestion-service-test.yml(1 hunks).github/workflows/prepare-for-prod-dt-deploy.yml(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- .github/workflows/ingestion-service-test.yml
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (8)
- GitHub Check: Code Coverage
- GitHub Check: Build Transformer Docker Image - PR / Build Transformer Docker Image AMD64
- GitHub Check: Build User Transformer Docker Image - PR / Build Transformer Docker Image AMD64
- GitHub Check: Build User Transformer Docker Image - PR / Build Transformer Docker Image ARM64
- GitHub Check: test_and_publish
- GitHub Check: UT Tests
- GitHub Check: Analyze (go)
- GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (1)
.github/workflows/prepare-for-prod-dt-deploy.yml (1)
255-267: Step separation looks goodCreating the PR in a dedicated step conditioned on
has_changesmakes logs clearer and avoids unnecessaryghinvocations. Nice improvement over the earlier combined step.
There was a problem hiding this comment.
Actionable comments posted: 3
🧹 Nitpick comments (2)
.github/workflows/update-ingestion-service.yml (2)
45-49: Enable the Go cache to speed up repeated runs
actions/setup-gosupports a built-in cache for modules and build outputs. Enabling it can shave minutes off the job without extra maintenance.- name: Setup Go uses: actions/setup-go@v5 with: go-version: ${{ steps.get_go_version.outputs.go_version }} + cache: true
98-98: Remove trailing whitespace to satisfy yamllintThere is an extra space on this blank line that breaks strict linters.
- +
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
.github/workflows/prepare-for-prod-dt-deploy.yml(1 hunks).github/workflows/update-ingestion-service.yml(1 hunks)
✅ Files skipped from review due to trivial changes (1)
- .github/workflows/prepare-for-prod-dt-deploy.yml
🧰 Additional context used
🪛 GitHub Check: CodeQL
.github/workflows/update-ingestion-service.yml
[warning] 12-104: Workflow does not contain permissions
Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {{contents: read}}
🪛 YAMLlint (1.37.1)
.github/workflows/update-ingestion-service.yml
[error] 98-98: trailing spaces
(trailing-spaces)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (9)
- GitHub Check: Build User Transformer Docker Image - PR / Build Transformer Docker Image ARM64
- GitHub Check: Build User Transformer Docker Image - PR / Build Transformer Docker Image AMD64
- GitHub Check: Build Transformer Docker Image - PR / Build Transformer Docker Image AMD64
- GitHub Check: Build Transformer Docker Image - PR / Build Transformer Docker Image ARM64
- GitHub Check: Code Coverage
- GitHub Check: UT Tests
- GitHub Check: test_and_publish
- GitHub Check: Analyze (javascript-typescript)
- GitHub Check: Analyze (go)
🔇 Additional comments (1)
.github/workflows/update-ingestion-service.yml (1)
92-104: Ensure GitHub CLI Auth and Non-Interactive PR CreationTo confirm that
ghpicks upGITHUB_TOKENand never prompts interactively, please:
- Add an explicit auth check in the workflow:
- name: Verify GH auth run: gh auth status env: GITHUB_TOKEN: ${{ secrets.PAT }}- Supply all required
gh pr createflags and explicitly target the repo:gh pr create \ --repo ${{ github.repository }} \ --title "chore: update transformer-go to latest version" \ --body "This PR updates the rudder-transformer/go dependency to the latest version from the main branch." \ --head ${{ steps.update.outputs.branch_name }} \ --base main- Execute the workflow against a fork or test branch to verify it completes without hanging or awaiting input.
|
Allure Test reports for this run are available at:
|
|
Allure Test reports for this run are available at:
|
There was a problem hiding this comment.
Actionable comments posted: 0
♻️ Duplicate comments (2)
.github/workflows/update-ingestion-service.yml (2)
55-91: Harden the update script: strict shell options & safe push
Same concern flagged previously – still unresolved.Add
set -euo pipefailat the top of the run block to fail fast, and push with--force-with-leaseto avoid clobbering remote updates unexpectedly.- run: | - cd rudder-ingestion-svc + run: | + set -euo pipefail + cd rudder-ingestion-svc @@ - git push -u origin $branch_name + git push --force-with-lease -u origin $branch_name
37-40: Avoid leaking the PAT – switch toactions/checkoutfor the ingestion-svc cloneEmbedding the secret directly in the clone URL risks accidental exposure (e.g. via
git remote -v, audit logs, or error messages). Useactions/checkoutwith thetokeninput to keep the PAT masked and gain shallow-clone optimisation.- - name: Clone Ingestion Service Repo - run: | - git clone https://${{secrets.PAT}}@github.com/rudderlabs/rudder-ingestion-svc.git + - name: Clone Ingestion Service Repo + uses: actions/[email protected] + with: + repository: rudderlabs/rudder-ingestion-svc + token: ${{ secrets.PAT }} + path: rudder-ingestion-svc + fetch-depth: 1
🧹 Nitpick comments (1)
.github/workflows/update-ingestion-service.yml (1)
101-102: Trailing whitespace – clean up for YAML lintLine 102 contains superfluous spaces, tripping YAML-lint (trailing-spaces rule). Delete them to keep CI green.
- cd rudder-ingestion-svc␠␠ + cd rudder-ingestion-svc
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
.github/workflows/update-ingestion-service.yml(1 hunks)
🧰 Additional context used
🪛 YAMLlint (1.37.1)
.github/workflows/update-ingestion-service.yml
[error] 102-102: trailing spaces
(trailing-spaces)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (9)
- GitHub Check: Build User Transformer Docker Image - PR / Build Transformer Docker Image AMD64
- GitHub Check: Build User Transformer Docker Image - PR / Build Transformer Docker Image ARM64
- GitHub Check: Build Transformer Docker Image - PR / Build Transformer Docker Image AMD64
- GitHub Check: Build Transformer Docker Image - PR / Build Transformer Docker Image ARM64
- GitHub Check: Code Coverage
- GitHub Check: test_and_publish
- GitHub Check: UT Tests
- GitHub Check: Analyze (javascript-typescript)
- GitHub Check: Analyze (go)
|
Allure Test reports for this run are available at:
|
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (4)
.github/workflows/update-ingestion-service.yml (4)
58-99: Add concurrency control & cache for quicker, safer runs
- Multiple pushes to
maincan trigger overlapping runs. Two jobs racing to force-push the same branch or open the same PR will create flakes.
Add a concurrency block at the job level:concurrency: group: update-ingestion-service-${{ github.ref }} cancel-in-progress: true
- Installing modules from scratch every run adds minutes and bandwidth. A one-liner cache step speeds things up dramatically:
- name: Cache Go modules uses: actions/cache@v4 with: path: | ~/.cache/go-build ${{ steps.get_go_version.outputs.go_version }} key: ${{ runner.os }}-go-${{ steps.get_go_version.outputs.go_version }}-${{ hashFiles('**/go.sum') }} restore-keys: | ${{ runner.os }}-go-${{ steps.get_go_version.outputs.go_version }}-
70-75: Remote branch deletion is fragile & unnecessary
git push origin --delete $branch_namefails if an open PR pins the branch (GitHub blocks deletion), yet that failure is swallowed. A subsequentgit checkout -b/ force-push already guarantees the remote branch matches local state, so the deletion dance can be dropped:-# Delete the branch if it exists (both locally and remotely) -git branch -D $branch_name 2>/dev/null || true -git push origin --delete $branch_name 2>/dev/null || true - -# Create a new branch -git checkout -b $branch_name +# Re-create/update branch locally +git checkout -B $branch_name
101-113: YAML-lint: trailing spaces trigger pipeline linter errorLine 107 ends with superfluous whitespace. Remove it to keep
yamllint/ CodeQL quiet.- cd rudder-ingestion-svc␠ + cd rudder-ingestion-svc
10-13: Tighten token scope further (optional)Because the workflow uses a personal access token (
secrets.PAT) for all write operations, theGITHUB_TOKENonly needspull-requests: read. Droppingwriteeliminates an unused capability and aligns with least-privilege.permissions: contents: read - pull-requests: write + pull-requests: read
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
.github/workflows/update-ingestion-service.yml(1 hunks)
🧰 Additional context used
🪛 YAMLlint (1.37.1)
.github/workflows/update-ingestion-service.yml
[error] 107-107: trailing spaces
(trailing-spaces)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (9)
- GitHub Check: Build User Transformer Docker Image - PR / Build Transformer Docker Image AMD64
- GitHub Check: Build User Transformer Docker Image - PR / Build Transformer Docker Image ARM64
- GitHub Check: Build Transformer Docker Image - PR / Build Transformer Docker Image ARM64
- GitHub Check: Build Transformer Docker Image - PR / Build Transformer Docker Image AMD64
- GitHub Check: Code Coverage
- GitHub Check: UT Tests
- GitHub Check: test_and_publish
- GitHub Check: Analyze (javascript-typescript)
- GitHub Check: Analyze (go)
|



What are the changes introduced in this PR?
This PR improves the integration between rudder-transformer and rudder-ingestion-svc by enhancing existing workflows and adding automated dependency management.
Changes:
.github/workflows/ingestion-service-test.yml:
• Added local module replacement - Uses go mod edit -replace to point to local transformer code during testing
.github/workflows/prepare-for-prod-dt-deploy.yml:
• Added new workflow job update-ingestion-service that automatically updates ingestion service dependencies
• Dynamic Go version detection - Reads Go version from ingestion service's go.mod instead of hardcoding
• Automated dependency updates - Uses go get to update rudder-transformer/go to latest commit SHA on every push to main
• Auto PR creation - Creates standardized PRs in rudder-ingestion-svc repo with consistent titles and descriptions
What is the related Linear task?
Resolves INT-3911
Please explain the objectives of your changes below
Currently, manual intervention is required on any change to source-transformer in multiple repositories to manage integration tests between ingestion service and rudder transformer.
Any changes to existing capabilities/behaviour, mention the reason & what are the changes ?
No
Any new dependencies introduced with this change?
No
Any new generic utility introduced or modified. Please explain the changes.
No
Any technical or performance related pointers to consider with the change?
No
@coderabbitai review
Developer checklist
My code follows the style guidelines of this project
No breaking changes are being introduced.
All related docs linked with the PR?
All changes manually tested?
Any documentation changes needed with this change?
Is the PR limited to 10 file changes?
Is the PR limited to one linear task?
Are relevant unit and component test-cases added in new readability format?
Reviewer checklist
Is the type of change in the PR title appropriate as per the changes?
Verified that there are no credentials or confidential data exposed with the changes.