Skip to content

Commit

Permalink
Merge pull request #75 from scheduleonce/technocrats/ONCEHUB-75672
Browse files Browse the repository at this point in the history
fix: rudderlabs pull to master
  • Loading branch information
sumitsheokand authored Dec 22, 2023
2 parents 7e150fe + 0cb3387 commit 20a2489
Show file tree
Hide file tree
Showing 1,260 changed files with 422,477 additions and 260,118 deletions.
38 changes: 20 additions & 18 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
],
"unicorn/no-instanceof-array": "error",
"unicorn/no-static-only-class": "error",
"unicorn/consistent-destructuring": "off",
"unicorn/consistent-destructuring": "error",
"unicorn/better-regex": "error",
"unicorn/no-for-loop": "error",
"unicorn/prefer-array-some": "error",
Expand All @@ -40,29 +40,31 @@
"unicorn/no-useless-spread": "error",
"unicorn/no-useless-length-check": "error",
"unicorn/prefer-export-from": "error",
"import/no-dynamic-require": "warn",
"no-param-reassign": "warn",
"import/no-dynamic-require": "error",
"no-param-reassign": "error",
"sonarjs/prefer-immediate-return": "off",
"sonarjs/no-nested-template-literals": "off",
"sonarjs/max-switch-cases": "off",
"sonarjs/no-small-switch": "warn",
"sonarjs/max-switch-cases": "error",
"sonarjs/no-small-switch": "error",
"sonarjs/cognitive-complexity": ["error", 60],
"@typescript-eslint/no-var-requires": "off",
"global-require": "off",
"@typescript-eslint/naming-convention": "off",
"@typescript-eslint/ban-types": "off",
"global-require": "error",
"@typescript-eslint/naming-convention": "error",
"@typescript-eslint/ban-types": "error",
"@typescript-eslint/no-explicit-any": "off",
"class-methods-use-this": "off",
"@typescript-eslint/return-await": "off",
"@typescript-eslint/return-await": "error",
"import/prefer-default-export": "off",
"sonarjs/no-ignored-return": "off",
"no-new": "off",
"@typescript-eslint/no-shadow": "off",
"@typescript-eslint/no-loop-func": "off",
"sonarjs/no-same-line-conditional": "off",
"no-restricted-syntax": "off",
"sonarjs/no-duplicate-string": "off",
"sonarjs/no-identical-functions": "off",
"sonarjs/no-ignored-return": "error",
"no-new": "error",
"@typescript-eslint/no-shadow": "error",
"@typescript-eslint/no-loop-func": "error",
"sonarjs/no-same-line-conditional": "error",
"no-restricted-syntax": "error",
"sonarjs/no-duplicate-string": "error",
"sonarjs/no-identical-functions": "error",
"no-prototype-builtins": "off",
"@typescript-eslint/dot-notation": "off"
"@typescript-eslint/dot-notation": "error",
"@typescript-eslint/no-unused-vars": "error"
}
}
57 changes: 57 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
## What are the changes introduced in this PR?

Write a brief explainer on your code changes.

## Please explain the objectives of your changes below

Put down any required details on the broader aspect of your changes. If there are any dependent changes, **mandatorily** mention them here

### Type of change

If the pull request is a **bug-fix**, **enhancement** or a **refactor**, please fill in the details on the changes made.

- Existing capabilities/behavior

- New capabilities/behavior

If the pull request is a **new feature**,

### Any technical or performance related pointers to consider with the change?

N/A

### Any new dependencies introduced with this change?

N/A

### Any new generic utility introduced or modified. Please explain the changes.

N/A

### If the PR has changes in more than 10 files, please mention why the changes were not split into multiple PRs.

N/A

### If multiple linear tasks are associated with the PR changes, please elaborate on the reason:

N/A

<hr>

### Developer checklist

- [ ] **No breaking changes are being introduced.**

- [ ] Are all related docs linked with the PR?

- [ ] Are all changes manually tested?

- [ ] Does this change require any documentation changes?

- [ ] Are relevant unit and component test-cases added?

### 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.
104 changes: 93 additions & 11 deletions .github/workflows/build-push-docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ on:
push_target:
required: true
type: string
build_type:
type: string
secrets:
DOCKERHUB_PROD_TOKEN:
required: true
Expand All @@ -34,9 +36,9 @@ env:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}

jobs:
build-transformer-image:
name: Build Transformer Docker Image
runs-on: ubuntu-latest
build-transformer-image-arm64:
name: Build Transformer Docker Image ARM64
runs-on: [self-hosted, Linux, ARM64]
steps:
- name: Checkout
uses: actions/checkout@v3.5.3
Expand All @@ -61,12 +63,12 @@ jobs:
target: ${{ inputs.load_target }}
load: true
tags: ${{ inputs.build_tag }}
cache-from: type=gha
cache-to: type=gha,mode=max
# cache-from: type=gha
# cache-to: type=gha,mode=max

- name: Run Tests
run: |
docker run ${{ inputs.build_tag }} npm run test:js:ci
docker run ${{ inputs.build_tag }} npm run test:js:ci
docker run ${{ inputs.build_tag }} npm run test:ts:ci
- name: Build and Push Multi-platform Images
Expand All @@ -76,12 +78,92 @@ jobs:
file: ${{ inputs.dockerfile }}
target: ${{ inputs.push_target }}
push: true
tags: ${{ inputs.push_tags }}
tags: ${{ inputs.push_tags }}-arm64
platforms: |
linux/amd64
linux/arm64
build-args: |
version=${{ inputs.img_tag }}
version=${{ inputs.img_tag }}-arm64
GIT_COMMIT_SHA=${{ github.sha }}
cache-from: type=gha
cache-to: type=gha,mode=max
# cache-from: type=gha
# cache-to: type=gha,mode=max

build-transformer-image-amd64:
name: Build Transformer Docker Image AMD64
runs-on: [self-hosted, Linux, X64]
steps:
- name: Checkout
uses: actions/checkout@v3.5.3
with:
fetch-depth: 1

- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v2.9.1

- name: Login to DockerHub
uses: docker/login-action@v2.1.0
with:
username: ${{ env.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PROD_TOKEN }}

- name: Build Docker Image
uses: docker/build-push-action@v4.1.1
with:
context: .
file: ${{ inputs.dockerfile }}
target: ${{ inputs.load_target }}
load: true
tags: ${{ inputs.build_tag }}
# cache-from: type=gha
# cache-to: type=gha,mode=max

- name: Run Tests
run: |
docker run ${{ inputs.build_tag }} npm run test:js:ci
docker run ${{ inputs.build_tag }} npm run test:ts:ci
- name: Build and Push Multi-platform Images
uses: docker/build-push-action@v4.1.1
with:
context: .
file: ${{ inputs.dockerfile }}
target: ${{ inputs.push_target }}
push: true
tags: ${{ inputs.push_tags }}-amd64
platforms: |
linux/amd64
build-args: |
version=${{ inputs.img_tag }}-amd64
GIT_COMMIT_SHA=${{ github.sha }}
# cache-from: type=gha
# cache-to: type=gha,mode=max

create-manifest:
name: Create multi-arch manifest
runs-on: ubuntu-latest
needs: [build-transformer-image-amd64, build-transformer-image-arm64]

steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2.9.1

- name: Login to DockerHub
uses: docker/login-action@v2.1.0
with:
username: ${{ env.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PROD_TOKEN }}

- name: Create multi-arch manifest
run: |
docker buildx imagetools create -t ${{ inputs.push_tags }} ${{ inputs.push_tags }}-amd64 ${{ inputs.push_tags }}-arm64
- name: Create latest multi-arch manifest
# To be triggered only for release/hotfix PR merges coming from `prepare-for-prod-dt-deploy.yaml`
if: ${{ inputs.build_type == 'dt' }}
run: |
docker buildx imagetools create -t rudderstack/rudder-transformer:latest ${{ inputs.push_tags }}-amd64 ${{ inputs.push_tags }}-arm64
- name: Create latest ut multi-arch manifest
# To be triggered only for release/hotfix PR merges coming from `prepare-for-prod-ut-deploy.yaml`
if: ${{ inputs.build_type == 'ut' }}
run: |
docker buildx imagetools create -t rudderstack/rudder-transformer:ut-latest ${{ inputs.push_tags }}-amd64 ${{ inputs.push_tags }}-arm64
2 changes: 1 addition & 1 deletion .github/workflows/create-hotfix-branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest

# Only allow these users to create new hotfix branch from 'main'
if: github.ref == 'refs/heads/main' && (github.actor == 'ItsSudip' || github.actor == 'krishna2020' || github.actor == 'saikumarrs' || github.actor == 'sandeepdsvs' || github.actor == 'shrouti1507') && (github.triggering_actor == 'ItsSudip' || github.triggering_actor == 'krishna2020' || github.triggering_actor == 'saikumarrs' || github.triggering_actor == 'sandeepdsvs' || github.triggering_actor == 'shrouti1507')
if: github.ref == 'refs/heads/main' && (github.actor == 'ItsSudip' || github.actor == 'krishna2020' || github.actor == 'saikumarrs' || github.actor == 'sandeepdsvs' || github.actor == 'shrouti1507' || github.actor == 'anantjain45823' || github.actor == 'chandumlg' || github.actor == 'mihir-4116' || github.actor == 'ujjwal-ab') && (github.triggering_actor == 'ItsSudip' || github.triggering_actor == 'krishna2020' || github.triggering_actor == 'saikumarrs' || github.triggering_actor == 'sandeepdsvs' || github.triggering_actor == 'shrouti1507' || github.triggering_actor == 'anantjain45823' || github.triggering_actor == 'chandumlg' || github.triggering_actor == 'mihir-4116' || github.triggering_actor == 'ujjwal-ab')
steps:
- name: Create Branch
uses: peterjgrainger/action-create-branch@v2.4.0
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/draft-new-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: ubuntu-latest

# Only allow release stakeholders to initiate releases
if: (github.ref == 'refs/heads/develop' || startsWith(github.ref, 'refs/heads/hotfix/')) && (github.actor == 'ItsSudip' || github.actor == 'krishna2020' || github.actor == 'saikumarrs' || github.actor == 'sandeepdsvs' || github.actor == 'shrouti1507') && (github.triggering_actor == 'ItsSudip' || github.triggering_actor == 'krishna2020' || github.triggering_actor == 'saikumarrs' || github.triggering_actor == 'sandeepdsvs' || github.triggering_actor == 'shrouti1507')
if: (github.ref == 'refs/heads/develop' || startsWith(github.ref, 'refs/heads/hotfix/')) && (github.actor == 'ItsSudip' || github.actor == 'krishna2020' || github.actor == 'saikumarrs' || github.actor == 'sandeepdsvs' || github.actor == 'koladilip' || github.actor == 'shrouti1507' || github.actor == 'anantjain45823' || github.actor == 'chandumlg' || github.actor == 'mihir-4116' || github.actor == 'yashasvibajpai' || github.actor == 'sanpj2292' || github.actor == 'ujjwal-ab') && (github.triggering_actor == 'ItsSudip' || github.triggering_actor == 'krishna2020' || github.triggering_actor == 'koladilip' || github.triggering_actor == 'saikumarrs' || github.triggering_actor == 'sandeepdsvs' || github.triggering_actor == 'shrouti1507' || github.triggering_actor == 'anantjain45823' || github.triggering_actor == 'chandumlg' || github.triggering_actor == 'mihir-4116' || github.triggering_actor == 'yashasvibajpai' || github.triggering_actor == 'sanpj2292' || github.triggering_actor == 'ujjwal-ab')
steps:
- name: Checkout
uses: actions/checkout@v3.5.3
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/housekeeping.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
schedule:
# Run everyday at 1 AM
- cron: '0 1 * * *'
workflow_dispatch:

jobs:
prs:
Expand Down Expand Up @@ -41,5 +42,5 @@ jobs:
date: '3 months ago'
dry_run: false
delete_tags: false
extra_protected_branch_regex: ^(main|release/.*|develop|hotfix/.*|hotfix-release/.*)$
extra_protected_branch_regex: ^(main|develop)$
exclude_open_pr_branches: true
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Prepare for Production Environment Deployment
name: Prepare for DT Production Environment Deployment

on:
push:
Expand Down Expand Up @@ -52,6 +52,7 @@ jobs:
dockerfile: Dockerfile
load_target: development
push_target: production
build_type: dt
secrets:
DOCKERHUB_PROD_TOKEN: ${{ secrets.DOCKERHUB_PROD_TOKEN }}
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
Expand Down Expand Up @@ -127,7 +128,7 @@ jobs:
git commit -m "chore: upgrade shared transformers to $TAG_NAME"
git push -u origin shared-transformer-$TAG_NAME
hub pull-request -m "chore: upgrade shared transformers to $TAG_NAME"
gh pr create --fill
- name: Update Helm Chart and Raise Pull Request For Hosted Transformer
env:
Expand All @@ -144,4 +145,4 @@ jobs:
git commit -m "chore: upgrade hosted transformer to $TAG_NAME"
git push -u origin hosted-transformer-$TAG_NAME
hub pull-request -m "chore: upgrade hosted transformer to $TAG_NAME"
gh pr create --fill
4 changes: 2 additions & 2 deletions .github/workflows/prepare-for-prod-rollback.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:

# Only allow to be deployed from tags and main branch
# Only allow specific actors to trigger
if: (startsWith(github.ref, 'refs/tags/') || startsWith(github.ref, 'refs/heads/main')) && (github.actor == 'ItsSudip' || github.actor == 'krishna2020' || github.actor == 'saikumarrs') && (github.triggering_actor == 'ItsSudip' || github.triggering_actor == 'krishna2020' || github.triggering_actor == 'saikumarrs')
if: (startsWith(github.ref, 'refs/tags/') || startsWith(github.ref, 'refs/heads/main')) && (github.actor == 'ItsSudip' || github.actor == 'krishna2020' || github.actor == 'saikumarrs' || github.actor == 'chandumlg') && (github.triggering_actor == 'ItsSudip' || github.triggering_actor == 'krishna2020' || github.triggering_actor == 'saikumarrs' || github.triggering_actor == 'chandumlg')

steps:
- name: Get Target Version
Expand Down Expand Up @@ -56,4 +56,4 @@ jobs:
git commit -m "chore: rollback shared transformers to ${{ steps.target-version.outputs.tag_name }}"
git push -u origin shared-transformer-rollback-${{ steps.target-version.outputs.tag_name }}
hub pull-request -m "chore: rollback shared transformers to ${{ steps.target-version.outputs.tag_name }}"
gh pr create --fill
7 changes: 4 additions & 3 deletions .github/workflows/prepare-for-prod-ut-deploy.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Prepare for Production Environment Deployment
name: Prepare for UT Production Environment Deployment

on:
push:
Expand Down Expand Up @@ -55,6 +55,7 @@ jobs:
dockerfile: Dockerfile-ut-func
load_target: development
push_target: production
build_type: ut
secrets:
DOCKERHUB_PROD_TOKEN: ${{ secrets.DOCKERHUB_PROD_TOKEN }}
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
Expand Down Expand Up @@ -112,7 +113,7 @@ jobs:
git commit -m "chore: upgrade shared user-transformers to $UT_TAG_NAME"
git push -u origin shared-user-transformer-$UT_TAG_NAME
hub pull-request -m "chore: upgrade shared user-transformers to $UT_TAG_NAME"
gh pr create --fill
- name: Update Helm Chart and Raise Pull Request For Hosted Transformer
env:
Expand All @@ -129,4 +130,4 @@ jobs:
git commit -m "chore: upgrade hosted user-transformer to $UT_TAG_NAME"
git push -u origin hosted-user-transformer-$UT_TAG_NAME
hub pull-request -m "chore: upgrade hosted user-transformer to $UT_TAG_NAME"
gh pr create --fill
3 changes: 2 additions & 1 deletion .github/workflows/prepare-for-staging-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ jobs:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_PROD_TOKEN }}


create-pull-request:
name: Update Helm Charts For Staging and Create Pull Request
runs-on: ubuntu-latest
Expand Down Expand Up @@ -123,5 +124,5 @@ jobs:
git commit -m "chore: upgrade staging env transformers to \"$TAG_NAME\""
git push -u origin $BRANCH_NAME
hub pull-request -m "chore: upgrade staging env transformers to \"$TAG_NAME\""
gh pr create --fill
fi
Loading

0 comments on commit 20a2489

Please sign in to comment.