Skip to content

Commit

Permalink
Merge pull request #71 from scheduleonce/technocrats/ONCEHUB-71928
Browse files Browse the repository at this point in the history
feat: [qa] oncehub-71928 : update rudder version to latest (team to master merge)
  • Loading branch information
JustinFernandes19 authored Sep 20, 2023
2 parents 57d1643 + befd77e commit 6b4ad45
Show file tree
Hide file tree
Showing 1,101 changed files with 265,819 additions and 104,582 deletions.
14 changes: 0 additions & 14 deletions .deepsource.toml

This file was deleted.

19 changes: 10 additions & 9 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
node_modules
npm-debug.log
Dockerfile
.dockerignore
.git
.gitignore
docker-compose.yml
buildspec.yml
appspec.yml
*
!src
!Makefile
!jest*.js
!benchmark
!package*.json
!tsconfig.json
!test
!scripts/skipPrepareScript.js
!swagger
13 changes: 9 additions & 4 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,18 +1,23 @@
node_modules/
.husky/
reports/
test/
benchmark/
dist/
**/warehouse/
**/lambda/
**/openfaas/
*.md
*.test.js
test/**/*.js
*.test.ts
src/util/lodash-es-core.js
**/ivm*.js
**/custom*.js
**/warehouse/
**/lambda/
**/openfaas/
src/util/url-search-params.min.js
src/logger.js
src/util/eventValidations.js
**/trackingPlan*
src/v0/destinations/personalize/scripts/
test/integrations/destinations/testTypes.d.ts
*.config*.js
scripts/skipPrepareScript.js
41 changes: 36 additions & 5 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,21 @@
"jest": true,
"commonjs": true
},
"extends": ["airbnb-base", "prettier", "plugin:json/recommended"],
"plugins": ["unicorn"],
"extends": [
"airbnb-base",
"airbnb-typescript/base",
"plugin:sonarjs/recommended",
"prettier",
"plugin:json/recommended",
"plugin:@typescript-eslint/recommended"
],
"plugins": ["@typescript-eslint", "unicorn"],
"globals": {},
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 12,
"sourceType": "module"
"sourceType": "module",
"project": "./tsconfig.json"
},
"rules": {
"unicorn/filename-case": [
Expand All @@ -19,7 +28,7 @@
],
"unicorn/no-instanceof-array": "error",
"unicorn/no-static-only-class": "error",
"unicorn/consistent-destructuring": "error",
"unicorn/consistent-destructuring": "off",
"unicorn/better-regex": "error",
"unicorn/no-for-loop": "error",
"unicorn/prefer-array-some": "error",
Expand All @@ -32,6 +41,28 @@
"unicorn/no-useless-length-check": "error",
"unicorn/prefer-export-from": "error",
"import/no-dynamic-require": "warn",
"no-param-reassign": "warn"
"no-param-reassign": "warn",
"sonarjs/prefer-immediate-return": "off",
"sonarjs/no-nested-template-literals": "off",
"sonarjs/max-switch-cases": "off",
"sonarjs/no-small-switch": "warn",
"sonarjs/cognitive-complexity": ["error", 60],
"@typescript-eslint/no-var-requires": "off",
"global-require": "off",
"@typescript-eslint/naming-convention": "off",
"@typescript-eslint/ban-types": "off",
"class-methods-use-this": "off",
"@typescript-eslint/return-await": "off",
"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",
"no-prototype-builtins": "off",
"@typescript-eslint/dot-notation": "off"
}
}
5 changes: 0 additions & 5 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,6 @@ A clear and concise description of what the bug is.
**To Reproduce**
Steps to reproduce the behavior:

1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

Expand Down
19 changes: 0 additions & 19 deletions .github/ISSUE_TEMPLATE/feature_request.md

This file was deleted.

6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: 'github-actions'
directory: '/'
schedule:
interval: 'weekly'
72 changes: 72 additions & 0 deletions .github/workflows/build-pr-artifacts.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Build Artifacts for PRs

on:
pull_request:
types:
- opened
- reopened
- synchronize

jobs:
generate-tag-names:
runs-on: ubuntu-latest
name: Generate Tag Names
# Skip for the release pull requests as staging artifacts will be generated
if: startsWith(github.event.pull_request.head.ref, 'release/') != true && startsWith(github.event.pull_request.head.ref, 'hotfix-release/') != true && github.event.pull_request.head.ref != 'master'
outputs:
tag_name: ${{ steps.gen_tag_names.outputs.tag_name }}
tag_name_ut: ${{ steps.gen_tag_names.outputs.tag_name_ut }}
steps:
- name: Checkout
uses: actions/checkout@v3.5.3
with:
fetch-depth: 1

# Replace problematic characters in branch name (like '/') with safe characters (like '.')
- name: Generate Tag Names
id: gen_tag_names
run: |
tag_name=$(echo ${{ github.head_ref }} | tr "/" .)
echo "Tag Name: $tag_name"
echo "tag_name=$tag_name" >> $GITHUB_OUTPUT
tag_name_ut="ut-$tag_name"
echo "UT Tag Name: $tag_name_ut"
echo "tag_name_ut=$tag_name_ut" >> $GITHUB_OUTPUT
build-transformer-image:
name: Build Transformer Docker Image - PR
# Skip for the release pull requests as staging artifacts will be generated
# Skip main to develop sync pull requests
if: startsWith(github.event.pull_request.head.ref, 'release/') != true && startsWith(github.event.pull_request.head.ref, 'hotfix-release/') != true && github.event.pull_request.head.ref != 'master'
needs: [generate-tag-names]
uses: ./.github/workflows/build-push-docker-image.yml
with:
build_tag: dockeronce.azurecr.io/kubernetes/rudder-transformer:${{ needs.generate-tag-names.outputs.tag_name }}
push_tags: dockeronce.azurecr.io/kubernetes/rudder-transformer:${{ needs.generate-tag-names.outputs.tag_name }}
img_tag: ${{ needs.generate-tag-names.outputs.tag_name }}
dockerfile: Dockerfile
load_target: development
push_target: production
secrets:
DOCKERHUB_PROD_TOKEN: ${{ secrets.DOCKERHUB_PROD_TOKEN }}
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}

build-user-transformer-image:
name: Build User Transformer Docker Image - PR
# Skip for the release pull requests as staging artifacts will be generated
if: startsWith(github.event.pull_request.head.ref, 'release/') != true && startsWith(github.event.pull_request.head.ref, 'hotfix-release/') != true && github.event.pull_request.head.ref != 'master'
needs: [generate-tag-names]
uses: ./.github/workflows/build-push-docker-image.yml
with:
build_tag: dockeronce.azurecr.io/kubernetes/rudder-transformer:${{ needs.generate-tag-names.outputs.tag_name_ut }}
push_tags: dockeronce.azurecr.io/kubernetes/rudder-transformer:${{ needs.generate-tag-names.outputs.tag_name_ut }}
img_tag: ${{ needs.generate-tag-names.outputs.tag_name_ut }}
dockerfile: Dockerfile-ut-func
load_target: development
push_target: production
secrets:
DOCKERHUB_PROD_TOKEN: ${{ secrets.DOCKERHUB_PROD_TOKEN }}
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
87 changes: 87 additions & 0 deletions .github/workflows/build-push-docker-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
name: Build Transformer Docker Image

on:
workflow_call:
inputs:
build_tag:
required: true
type: string
push_tags:
required: true
type: string
img_tag:
required: true
type: string
dockerfile:
required: true
type: string
load_target:
required: true
type: string
push_target:
required: true
type: string
secrets:
DOCKERHUB_PROD_TOKEN:
required: true
DOCKERHUB_USERNAME:
required: true
DOCKERHUB_TOKEN:
required: true

env:
DOCKERHUB_PROD_TOKEN: ${{ secrets.DOCKERHUB_PROD_TOKEN }}
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}

jobs:
build-transformer-image:
name: Build Transformer Docker Image
runs-on: ubuntu-latest
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:
registry: dockeronce.azurecr.io
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_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 }}
platforms: |
linux/amd64
linux/arm64
build-args: |
version=${{ inputs.img_tag }}
GIT_COMMIT_SHA=${{ github.sha }}
cache-from: type=gha
cache-to: type=gha,mode=max
17 changes: 17 additions & 0 deletions .github/workflows/check-pr-title.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Check PR Title

on:
pull_request:
types:
- opened
- edited
- reopened
- synchronize

jobs:
check-pr-title:
name: Check PR Title
runs-on: ubuntu-latest
steps:
- name: Check PR Title
uses: rudderlabs/github-action-check-pr-title@v1.0.7
23 changes: 23 additions & 0 deletions .github/workflows/create-hotfix-branch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Create New Hotfix Branch

on:
workflow_dispatch:
inputs:
hotfix_name:
description: Hotfix branch name
required: true

jobs:
create-branch:
name: Create New Hotfix Branch
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')
steps:
- name: Create Branch
uses: peterjgrainger/action-create-branch@v2.4.0
env:
GITHUB_TOKEN: ${{ secrets.PAT }}
with:
branch: 'hotfix/${{ inputs.hotfix_name }}'
Loading

0 comments on commit 6b4ad45

Please sign in to comment.