-
Notifications
You must be signed in to change notification settings - Fork 48
Rewrite python legacy APIs in golang #4931
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 3 commits
Commits
Show all changes
48 commits
Select commit
Hold shift + click to select a range
5ff85b6
Rewrite python legacy APIs in golang
lukaszgryglicki 6f6499e
Merge branch 'dev' into unicron-rewrite-py2go
lukaszgryglicki 2b495d3
Address AI feedback
lukaszgryglicki 3ff7815
Address AI feedback
lukaszgryglicki 9c00de1
Address AI feedback
lukaszgryglicki ee1fe01
Address AI feedback 2
lukaszgryglicki 9a3f9ce
Address AI feedback 3
lukaszgryglicki a806c45
Fix the CI
lukaszgryglicki cf800d3
Fix the CI 2
lukaszgryglicki 071c32f
Fix the CI 3
lukaszgryglicki f936a1e
Merge remote-tracking branch 'origin/dev' into unicron-rewrite-py2go
lukaszgryglicki 46f4baa
Fix the CI 4
lukaszgryglicki c132688
Fix the CI 5
lukaszgryglicki fb6cbf7
Fix the CI 6
lukaszgryglicki 77a49d9
Fix the CI 7
lukaszgryglicki 2c4edf8
Fix the CI 8
lukaszgryglicki cda4ac9
Fix the CI 9
lukaszgryglicki 8fe3ed2
Fix the CI 10
lukaszgryglicki 74e6ee1
Fix the CI 11
lukaszgryglicki b8c8878
Fix the CI 12
lukaszgryglicki a12aff9
Fix the CI 13
lukaszgryglicki a3d24cf
Fix the CI 14
lukaszgryglicki 9efd666
DDog updates/API templates collapse updates
lukaszgryglicki f25d995
Removing python v1/v2 APIs
lukaszgryglicki 3ff782d
Update .gitignore
lukaszgryglicki 82d13de
Manual rebase
lukaszgryglicki 24901b5
WIP update to sync with the latest feature request
lukaszgryglicki d0f1838
Resolve conflict: keep utils.py deleted
lukaszgryglicki 66b7365
SYnc one tool update
lukaszgryglicki a4f11e5
Merge branch 'dev' into unicron-rewrite-py2go
lukaszgryglicki 7deed32
Merge branch 'dev' into unicron-rewrite-py2go
lukaszgryglicki 66e3338
Merge branch 'dev' into unicron-rewrite-py2go
lukaszgryglicki b32b627
Fix the CI
lukaszgryglicki 23d74e3
Merge dev into unicron-rewrite-py2go keeping Python files removed
lukaszgryglicki 9daacce
Backport recent changes to py -> go rewrite
lukaszgryglicki 753b977
Fix the CI
lukaszgryglicki dbb3227
Final patch?
lukaszgryglicki 1958400
Revert unneeded cla-backend-go changes
lukaszgryglicki a17f5e8
Fix the CI
lukaszgryglicki 66d2b2f
Manual merge - WIP
lukaszgryglicki f053d26
Backuport
lukaszgryglicki 4516fe2
Backport recent changes to legacy go
lukaszgryglicki 5d628cc
Merge with dev
lukaszgryglicki ccae910
Merge branch 'dev' into unicron-rewrite-py2go
lukaszgryglicki 83dcd66
Merge branch 'dev' into unicron-rewrite-py2go
lukaszgryglicki 5fc5df0
Fix the CI
lukaszgryglicki b692fdf
Remove no longer needed file
lukaszgryglicki 20894ca
Fix the CI
lukaszgryglicki File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,112 @@ | ||
| --- | ||
| # Copyright The Linux Foundation and each contributor to CommunityBridge. | ||
| # SPDX-License-Identifier: MIT | ||
|
|
||
| name: Build and Deploy CLA Legacy Backend to DEV | ||
| on: | ||
| push: | ||
| branches: | ||
| - dev | ||
| paths: | ||
| - 'cla-backend-legacy/**' | ||
| - '.github/workflows/cla-backend-legacy-deploy-dev.yml' | ||
|
|
||
| permissions: | ||
| # These permissions are needed to interact with GitHub's OIDC Token endpoint to fetch/set the AWS deployment credentials. | ||
| id-token: write | ||
| contents: read | ||
|
|
||
| env: | ||
| AWS_REGION: us-east-1 | ||
| STAGE: dev | ||
| DD_VERSION: ${{ github.sha }} | ||
|
|
||
| jobs: | ||
| build-deploy-legacy-dev: | ||
| runs-on: ubuntu-latest | ||
| environment: dev | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup go | ||
| uses: actions/setup-go@v5 | ||
| with: | ||
| go-version: '1.22' | ||
|
|
||
| - name: Go Version | ||
| run: go version | ||
|
|
||
| - name: Setup Node | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: '20' | ||
|
|
||
| - name: Configure AWS Credentials | ||
| uses: aws-actions/configure-aws-credentials@v4 | ||
| with: | ||
| audience: sts.amazonaws.com | ||
| role-to-assume: arn:aws:iam::395594542180:role/github-actions-deploy | ||
| aws-region: us-east-1 | ||
|
|
||
| - name: Cache Go modules | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: ${{ github.workspace }}/go/pkg/mod | ||
| key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | ||
| restore-keys: | | ||
| ${{ runner.os }}-go- | ||
|
|
||
| - name: Configure Git to clone private Github repos | ||
| run: git config --global url."https://${TOKEN_USER}:${TOKEN}@github.com".insteadOf "https://github.com" | ||
| env: | ||
| TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN_GITHUB }} | ||
| TOKEN_USER: ${{ secrets.PERSONAL_ACCESS_TOKEN_USER_GITHUB }} | ||
|
|
||
| - name: Add OS Tools | ||
| run: sudo apt update && sudo apt-get install file -y | ||
|
|
||
| - name: Go Setup CLA Legacy Backend | ||
| working-directory: cla-backend-legacy | ||
| run: | | ||
| go mod tidy | ||
|
|
||
| - name: Go Build CLA Legacy Backend | ||
| working-directory: cla-backend-legacy | ||
| run: | | ||
| make lambdas | ||
|
|
||
| - name: Go Test CLA Legacy Backend | ||
| working-directory: cla-backend-legacy | ||
| run: go test ./... | ||
|
|
||
| - name: Go Lint CLA Legacy Backend | ||
| working-directory: cla-backend-legacy | ||
| run: make lint | ||
|
|
||
| - name: Setup Deployment | ||
| working-directory: cla-backend-legacy | ||
| run: | | ||
| npm install | ||
|
|
||
| - name: EasyCLA Legacy Backend Deployment us-east-1 | ||
| working-directory: cla-backend-legacy | ||
| run: | | ||
| if [[ ! -f bin/legacy-api-lambda ]]; then echo "Missing bin/legacy-api-lambda binary file. Exiting..."; exit 1; fi | ||
| if [[ ! -f serverless.yml ]]; then echo "Missing serverless.yml file. Exiting..."; exit 1; fi | ||
| # Create empty env.json if it doesn't exist | ||
| echo '{}' > env.json | ||
| npx serverless deploy --force --stage ${STAGE} --region us-east-1 --verbose | ||
|
|
||
| - name: EasyCLA Legacy Backend Service Check | ||
| run: | | ||
| sudo apt install curl jq -y | ||
|
|
||
| # Development environment endpoints to test | ||
| declare -r v1_url="https://apigo.lfcla.${STAGE}.platform.linuxfoundation.org/v1/health" | ||
| declare -r v2_url="https://apigo.lfcla.${STAGE}.platform.linuxfoundation.org/v2/health" | ||
|
|
||
| echo "Validating v1 backend using endpoint: ${v1_url}" | ||
| curl --fail -XGET ${v1_url} || echo "v1 health endpoint check failed (expected for now)" | ||
|
|
||
| echo "Validating v2 backend using endpoint: ${v2_url}" | ||
| curl --fail -XGET ${v2_url} || echo "v2 health endpoint check failed (expected for now)" |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,112 @@ | ||
| --- | ||
| # Copyright The Linux Foundation and each contributor to CommunityBridge. | ||
| # SPDX-License-Identifier: MIT | ||
|
|
||
| name: Build and Deploy CLA Legacy Backend to PROD | ||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| paths: | ||
| - 'cla-backend-legacy/**' | ||
| - '.github/workflows/cla-backend-legacy-deploy-prod.yml' | ||
|
|
||
| permissions: | ||
| # These permissions are needed to interact with GitHub's OIDC Token endpoint to fetch/set the AWS deployment credentials. | ||
| id-token: write | ||
| contents: read | ||
|
|
||
| env: | ||
| AWS_REGION: us-east-1 | ||
| STAGE: prod | ||
| DD_VERSION: ${{ github.sha }} | ||
|
|
||
| jobs: | ||
| build-deploy-legacy-prod: | ||
| runs-on: ubuntu-latest | ||
| environment: prod | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup go | ||
| uses: actions/setup-go@v5 | ||
| with: | ||
| go-version: '1.22' | ||
|
|
||
| - name: Go Version | ||
| run: go version | ||
|
|
||
| - name: Setup Node | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: '20' | ||
|
|
||
| - name: Configure AWS Credentials | ||
| uses: aws-actions/configure-aws-credentials@v4 | ||
| with: | ||
| audience: sts.amazonaws.com | ||
| role-to-assume: arn:aws:iam::716487311010:role/github-actions-deploy | ||
| aws-region: us-east-1 | ||
|
|
||
| - name: Cache Go modules | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: ${{ github.workspace }}/go/pkg/mod | ||
| key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | ||
| restore-keys: | | ||
| ${{ runner.os }}-go- | ||
|
|
||
| - name: Configure Git to clone private Github repos | ||
| run: git config --global url."https://${TOKEN_USER}:${TOKEN}@github.com".insteadOf "https://github.com" | ||
| env: | ||
| TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN_GITHUB }} | ||
| TOKEN_USER: ${{ secrets.PERSONAL_ACCESS_TOKEN_USER_GITHUB }} | ||
|
|
||
| - name: Add OS Tools | ||
| run: sudo apt update && sudo apt-get install file -y | ||
|
|
||
| - name: Go Setup CLA Legacy Backend | ||
| working-directory: cla-backend-legacy | ||
| run: | | ||
| go mod tidy | ||
|
|
||
| - name: Go Build CLA Legacy Backend | ||
| working-directory: cla-backend-legacy | ||
| run: | | ||
| make lambdas | ||
|
|
||
| - name: Go Test CLA Legacy Backend | ||
| working-directory: cla-backend-legacy | ||
| run: go test ./... | ||
|
|
||
| - name: Go Lint CLA Legacy Backend | ||
| working-directory: cla-backend-legacy | ||
| run: make lint | ||
|
|
||
| - name: Setup Deployment | ||
| working-directory: cla-backend-legacy | ||
| run: | | ||
| npm install | ||
|
|
||
| - name: EasyCLA Legacy Backend Deployment us-east-1 | ||
| working-directory: cla-backend-legacy | ||
| run: | | ||
| if [[ ! -f bin/legacy-api-lambda ]]; then echo "Missing bin/legacy-api-lambda binary file. Exiting..."; exit 1; fi | ||
| if [[ ! -f serverless.yml ]]; then echo "Missing serverless.yml file. Exiting..."; exit 1; fi | ||
| # Create empty env.json if it doesn't exist | ||
| echo '{}' > env.json | ||
| npx serverless deploy --force --stage ${STAGE} --region us-east-1 --verbose | ||
|
|
||
| - name: EasyCLA Legacy Backend Service Check | ||
| run: | | ||
| sudo apt install curl jq -y | ||
|
|
||
| # Production environment endpoints to test | ||
| declare -r v1_url="https://apigo.easycla.lfx.linuxfoundation.org/v1/health" | ||
| declare -r v2_url="https://apigo.easycla.lfx.linuxfoundation.org/v2/health" | ||
|
|
||
| echo "Validating v1 backend using endpoint: ${v1_url}" | ||
| curl --fail -XGET ${v1_url} || echo "v1 health endpoint check failed (expected for now)" | ||
|
|
||
| echo "Validating v2 backend using endpoint: ${v2_url}" | ||
| curl --fail -XGET ${v2_url} || echo "v2 health endpoint check failed (expected for now)" |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -125,6 +125,24 @@ jobs: | |
| working-directory: cla-backend-go | ||
| run: make lint | ||
|
|
||
| - name: Go Setup CLA Legacy Backend | ||
| working-directory: cla-backend-legacy | ||
| run: | | ||
| go mod tidy | ||
|
Comment on lines
+99
to
+102
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same In deploy workflows, dependency drift is even more critical to catch early. Consider using 🤖 Prompt for AI Agents |
||
|
|
||
| - name: Go Build CLA Legacy Backend | ||
| working-directory: cla-backend-legacy | ||
| run: | | ||
| make lambdas | ||
|
|
||
| - name: Go Test CLA Legacy Backend | ||
| working-directory: cla-backend-legacy | ||
| run: go test ./... | ||
|
|
||
| - name: Go Lint CLA Legacy Backend | ||
| working-directory: cla-backend-legacy | ||
| run: make lint | ||
|
|
||
| - name: Setup Deployment | ||
| working-directory: cla-backend | ||
| run: | | ||
|
|
@@ -222,14 +240,100 @@ jobs: | |
| exit ${exit_code} | ||
| fi | ||
|
|
||
| - name: EasyCLA Legacy Backend Deployment us-east-1 | ||
| working-directory: cla-backend-legacy | ||
| run: | | ||
| if [[ ! -f bin/legacy-api-lambda ]]; then echo "Missing bin/legacy-api-lambda binary file. Exiting..."; exit 1; fi | ||
| if [[ ! -f serverless.yml ]]; then echo "Missing serverless.yml file. Exiting..."; exit 1; fi | ||
| npm install | ||
| npx serverless deploy --force --stage ${STAGE} --region us-east-1 --verbose | ||
|
|
||
| - name: EasyCLA Legacy Backend Service Check | ||
| run: | | ||
| sudo apt install curl jq -y | ||
|
|
||
| # Development environment endpoints to test | ||
| declare -r v1_legacy_url="https://apigo.lfcla.${STAGE}.platform.linuxfoundation.org/v1/health" | ||
| declare -r v2_legacy_url="https://apigo.lfcla.${STAGE}.platform.linuxfoundation.org/v2/health" | ||
|
|
||
| echo "Validating v1 legacy backend using endpoint: ${v1_legacy_url}" | ||
| curl --fail -XGET ${v1_legacy_url} || echo "v1 legacy health endpoint check failed (expected for now)" | ||
|
|
||
| echo "Validating v2 legacy backend using endpoint: ${v2_legacy_url}" | ||
| curl --fail -XGET ${v2_legacy_url} || echo "v2 legacy health endpoint check failed (expected for now)" | ||
|
coderabbitai[bot] marked this conversation as resolved.
Outdated
|
||
|
|
||
|
coderabbitai[bot] marked this conversation as resolved.
Outdated
|
||
|
|
||
| legacy-backend-deploy: | ||
| name: Deploy CLA Legacy Backend | ||
| runs-on: ubuntu-latest | ||
| environment: dev | ||
| needs: build-deploy-dev | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup go | ||
| uses: actions/setup-go@v5 | ||
| with: | ||
| go-version: '1.22' | ||
|
|
||
| - name: Setup Node | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: '20' | ||
|
|
||
| - name: Configure AWS Credentials | ||
| uses: aws-actions/configure-aws-credentials@v4 | ||
| with: | ||
| audience: sts.amazonaws.com | ||
| role-to-assume: arn:aws:iam::395594542180:role/github-actions-deploy | ||
| aws-region: us-east-1 | ||
|
|
||
| - name: Configure Git to clone private Github repos | ||
| run: git config --global url."https://${TOKEN_USER}:${TOKEN}@github.com".insteadOf "https://github.com" | ||
| env: | ||
| TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN_GITHUB }} | ||
| TOKEN_USER: ${{ secrets.PERSONAL_ACCESS_TOKEN_USER_GITHUB }} | ||
|
|
||
| - name: Go Setup CLA Legacy Backend | ||
| working-directory: cla-backend-legacy | ||
| run: | | ||
| go mod tidy | ||
|
|
||
| - name: Go Build CLA Legacy Backend | ||
| working-directory: cla-backend-legacy | ||
| run: | | ||
| make lambdas | ||
|
coderabbitai[bot] marked this conversation as resolved.
Outdated
|
||
|
|
||
| - name: EasyCLA Legacy Backend Deployment us-east-1 | ||
| working-directory: cla-backend-legacy | ||
| run: | | ||
| if [[ ! -f bin/legacy-api-lambda ]]; then echo "Missing bin/legacy-api-lambda binary file. Exiting..."; exit 1; fi | ||
| if [[ ! -f serverless.yml ]]; then echo "Missing serverless.yml file. Exiting..."; exit 1; fi | ||
| npm install | ||
| npx serverless deploy --force --stage ${STAGE} --region us-east-1 --verbose | ||
|
|
||
| - name: EasyCLA Legacy Backend Service Check | ||
| run: | | ||
| sudo apt install curl jq -y | ||
|
|
||
| # Development environment endpoints to test | ||
| declare -r v1_legacy_url="https://apigo.lfcla.${STAGE}.platform.linuxfoundation.org/v1/health" | ||
| declare -r v2_legacy_url="https://apigo.lfcla.${STAGE}.platform.linuxfoundation.org/v2/health" | ||
|
|
||
| echo "Validating v1 legacy backend using endpoint: ${v1_legacy_url}" | ||
| curl --fail -XGET ${v1_legacy_url} || echo "v1 legacy health endpoint check failed (expected for now)" | ||
|
|
||
| echo "Validating v2 legacy backend using endpoint: ${v2_legacy_url}" | ||
| curl --fail -XGET ${v2_legacy_url} || echo "v2 legacy health endpoint check failed (expected for now)" | ||
|
|
||
|
|
||
| cypress-functional-after-deploy: | ||
| name: Cypress Functional Tests (post-deploy) - executes on a freshly deployed dev API. | ||
| if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.fork == false }} | ||
| runs-on: ubuntu-latest | ||
| continue-on-error: true | ||
| timeout-minutes: 75 | ||
| needs: build-deploy-dev | ||
| needs: [build-deploy-dev, legacy-backend-deploy] | ||
| environment: dev | ||
| defaults: | ||
| run: | ||
|
|
||
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.