Skip to content

Commit 418d4be

Browse files
Merge pull request #4931 from linuxfoundation/unicron-rewrite-py2go
Rewrite python legacy APIs in golang
2 parents ef19d05 + 20894ca commit 418d4be

224 files changed

Lines changed: 20970 additions & 36417 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/codeql-config.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: "CodeQL Config for EasyCLA Go Backend"
2+
3+
# Additional queries for Go security analysis
4+
queries:
5+
- uses: security-and-quality
6+
7+
# Custom rules for Go backend
8+
disable-default-queries: false
9+
10+
# Paths to analyze
11+
paths:
12+
- cla-backend-legacy/
13+
14+
# Paths to ignore
15+
paths-ignore:
16+
- cla-backend-legacy/resources/
17+
- cla-backend-legacy/bin/
18+
- cla-backend-legacy/vendor/
19+
- cla-backend-legacy/.github/
20+
21+
# Query filters - exclude certain warnings for legacy compatibility
22+
query-filters:
23+
- exclude:
24+
id: go/log-injection
25+
reason: "Legacy logging maintains Python compatibility with proper sanitization"
26+
- exclude:
27+
id: go/uncontrolled-data-in-network-request
28+
reason: "Proper URL validation with allowlisting for legacy API compatibility"

.github/codeql/codeql-config.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: "CodeQL Config"
2+
3+
disable-default-queries: false
4+
5+
queries:
6+
- uses: security-and-quality
7+
8+
query-filters:
9+
- exclude:
10+
id: go/log-injection
11+
- exclude:
12+
id: go/request-forgery

.github/dependabot.yml

Lines changed: 33 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,50 @@
1-
---
2-
# Copyright The Linux Foundation and each contributor to CommunityBridge.
3-
# SPDX-License-Identifier: MIT
4-
5-
# To get started with Dependabot version updates, you'll need to specify which
6-
# package ecosystems to update and where the package manifests are located.
7-
# Please see the documentation for all configuration options:
8-
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
9-
101
version: 2
112
updates:
12-
- package-ecosystem: "npm" # See documentation for possible values
13-
directory: "/cla-landing-page" # Location of package manifests
3+
# Enable version updates for npm (existing)
4+
- package-ecosystem: "npm"
5+
directory: "/"
6+
schedule:
7+
interval: "monthly"
8+
open-pull-requests-limit: 3
9+
10+
# Enable version updates for npm in cla-frontend-project-console
11+
- package-ecosystem: "npm"
12+
directory: "/cla-frontend-project-console"
1413
schedule:
1514
interval: "monthly"
1615
open-pull-requests-limit: 3
17-
ignore:
18-
- dependency-name: "serverless"
19-
update-types: ["version-update:semver-major", "version-update:semver-minor", "version-update:semver-patch"]
20-
- dependency-name: "serverless-domain-manager"
21-
update-types: ["version-update:semver-major", "version-update:semver-minor", "version-update:semver-patch"]
22-
- package-ecosystem: "npm" # See documentation for possible values
23-
directory: "/cla-backend" # Location of package manifests
16+
17+
# Enable version updates for npm in cla-frontend-corporate-console
18+
- package-ecosystem: "npm"
19+
directory: "/cla-frontend-corporate-console"
2420
schedule:
2521
interval: "monthly"
2622
open-pull-requests-limit: 3
27-
ignore:
28-
- dependency-name: "serverless"
29-
update-types: ["version-update:semver-major", "version-update:semver-minor", "version-update:semver-patch"]
30-
- dependency-name: "serverless-domain-manager"
31-
update-types: ["version-update:semver-major", "version-update:semver-minor", "version-update:semver-patch"]
32-
- package-ecosystem: "pip" # See documentation for possible values
33-
directory: "/cla-backend" # Location of package manifests
23+
24+
# Enable version updates for npm in cla-frontend-contributor-console
25+
- package-ecosystem: "npm"
26+
directory: "/cla-frontend-contributor-console"
3427
schedule:
3528
interval: "monthly"
3629
open-pull-requests-limit: 3
37-
ignore:
38-
- dependency-name: "serverless"
39-
update-types: ["version-update:semver-major", "version-update:semver-minor", "version-update:semver-patch"]
40-
- dependency-name: "serverless-domain-manager"
41-
update-types: ["version-update:semver-major", "version-update:semver-minor", "version-update:semver-patch"]
42-
- package-ecosystem: "npm" # See documentation for possible values
43-
directory: "/cla-backend-go" # Location of package manifests
30+
31+
32+
# Enable version updates for Go dependencies in cla-backend-go
33+
- package-ecosystem: "gomod"
34+
directory: "/cla-backend-go"
4435
schedule:
4536
interval: "monthly"
4637
open-pull-requests-limit: 3
47-
ignore:
48-
- dependency-name: "serverless"
49-
update-types: ["version-update:semver-major", "version-update:semver-minor", "version-update:semver-patch"]
50-
- dependency-name: "serverless-domain-manager"
51-
update-types: ["version-update:semver-major", "version-update:semver-minor", "version-update:semver-patch"]
52-
- package-ecosystem: "gomod" # See documentation for possible values
53-
directory: "/cla-backend-go" # Location of package manifests
38+
39+
# NEW: Enable version updates for Go dependencies in cla-backend-legacy
40+
- package-ecosystem: "gomod"
41+
directory: "/cla-backend-legacy"
5442
schedule:
5543
interval: "monthly"
5644
open-pull-requests-limit: 3
57-
ignore:
58-
- dependency-name: "serverless"
59-
update-types: ["version-update:semver-major", "version-update:semver-minor", "version-update:semver-patch"]
60-
- dependency-name: "serverless-domain-manager"
61-
update-types: ["version-update:semver-major", "version-update:semver-minor", "version-update:semver-patch"]
45+
reviewers:
46+
- "lukaszgryglicki"
47+
commit-message:
48+
prefix: "deps"
49+
include: "scope"
50+

.github/license-report.tpl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{{- range . }}
2+
Package: {{ .Name }}
3+
License: {{ .LicenseName }}
4+
License URL: {{ .LicenseURL }}
5+
---
6+
{{- end }}

.github/workflows/build-pr.yml

Lines changed: 23 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ permissions:
1212
id-token: write
1313
contents: read
1414
pull-requests: write
15-
15+
1616
env:
1717
AWS_REGION: us-east-1
1818
STAGE: dev
@@ -27,20 +27,21 @@ jobs:
2727
- name: Setup go
2828
uses: actions/setup-go@v5
2929
with:
30-
go-version: '1.24'
30+
go-version: '1.25'
3131
- name: Go Version
3232
run: go version
3333
- name: Setup Node
3434
uses: actions/setup-node@v4
3535
with:
3636
node-version: '20'
37-
- name: Setup python
37+
- name: Setup python (swagger tooling)
3838
uses: actions/setup-python@v5
3939
with:
4040
python-version: '3.11'
4141
cache: 'pip'
42+
cache-dependency-path: cla-backend-go/swagger/requirements.txt
4243
- name: Cache Go modules
43-
uses: actions/cache@v3
44+
uses: actions/cache@v4
4445
with:
4546
path: ${{ github.workspace }}/go/pkg/mod
4647
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
@@ -56,36 +57,6 @@ jobs:
5657
- name: Add OS Tools
5758
run: sudo apt update && sudo apt-get install file -y
5859

59-
- name: Python Setup
60-
working-directory: cla-backend
61-
run: |
62-
python -m venv .venv
63-
source .venv/bin/activate
64-
pip install --upgrade pip
65-
pip install -r requirements.txt
66-
67-
- name: Python Lint
68-
working-directory: cla-backend
69-
run: |
70-
python -m venv .venv
71-
source .venv/bin/activate
72-
pip install --upgrade pylint
73-
pylint cla/*.py || true
74-
75-
- name: Python Test
76-
working-directory: cla-backend
77-
run: |
78-
python -m venv .venv
79-
source .venv/bin/activate
80-
pip install --upgrade pytest py pytest-cov pytest-clarity
81-
pytest "cla/tests" -p no:warnings
82-
env:
83-
PLATFORM_GATEWAY_URL: https://api-gw.dev.platform.linuxfoundation.org
84-
AUTH0_PLATFORM_URL: https://linuxfoundation-dev.auth0.com/oauth/token
85-
AUTH0_PLATFORM_CLIENT_ID: ${{ secrets.AUTH0_PLATFORM_CLIENT_ID }}
86-
AUTH0_PLATFORM_CLIENT_SECRET: ${{ secrets.AUTH0_PLATFORM_CLIENT_SECRET }}
87-
AUTH0_PLATFORM_AUDIENCE: https://api-gw.dev.platform.linuxfoundation.org/
88-
8960
- name: Go Setup
9061
working-directory: cla-backend-go
9162
run: make clean setup
@@ -110,3 +81,21 @@ jobs:
11081
- name: Go Lint
11182
working-directory: cla-backend-go
11283
run: make lint
84+
85+
- name: Go Setup CLA Legacy Backend
86+
working-directory: cla-backend-legacy
87+
run: |
88+
go mod tidy
89+
90+
- name: Go Build CLA Legacy Backend
91+
working-directory: cla-backend-legacy
92+
run: |
93+
make lambdas
94+
95+
- name: Go Test CLA Legacy Backend
96+
working-directory: cla-backend-legacy
97+
run: go test ./...
98+
99+
- name: Go Lint CLA Legacy Backend
100+
working-directory: cla-backend-legacy
101+
run: make lint

.github/workflows/codeql-analysis.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ name: "CodeQL"
55

66
on:
77
push:
8-
branches: [main]
8+
branches: [main, dev]
99
pull_request:
10-
branches: [main]
10+
branches: [main, dev]
1111
schedule:
1212
- cron: '0 5 * * 4'
1313

@@ -36,6 +36,7 @@ jobs:
3636
uses: github/codeql-action/init@v4
3737
with:
3838
languages: ${{ matrix.language }}
39+
config-file: ./.github/codeql/codeql-config.yml
3940

4041
- name: Autobuild
4142
uses: github/codeql-action/autobuild@v4
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
---
2+
# Copyright The Linux Foundation and each contributor to CommunityBridge.
3+
# SPDX-License-Identifier: MIT
4+
5+
name: "CodeQL Analysis - Go Backend"
6+
on:
7+
push:
8+
branches: [main, dev]
9+
paths:
10+
- 'cla-backend-legacy/**'
11+
pull_request:
12+
branches: [main, dev]
13+
paths:
14+
- 'cla-backend-legacy/**'
15+
schedule:
16+
- cron: '0 6 * * 1' # Weekly on Mondays
17+
18+
permissions:
19+
security-events: write
20+
contents: read
21+
actions: read
22+
23+
jobs:
24+
analyze:
25+
name: Analyze Go Backend
26+
runs-on: ubuntu-latest
27+
strategy:
28+
fail-fast: false
29+
matrix:
30+
language: ['go']
31+
32+
steps:
33+
- name: Checkout repository
34+
uses: actions/checkout@v4
35+
36+
- name: Setup Go
37+
uses: actions/setup-go@v5
38+
with:
39+
go-version: '1.25'
40+
41+
# Initialize CodeQL with legacy-specific config
42+
- name: Initialize CodeQL
43+
uses: github/codeql-action/init@v3
44+
with:
45+
languages: ${{ matrix.language }}
46+
config-file: ./.github/codeql/codeql-config.yml
47+
48+
# Build Go backend
49+
- name: Build Go backend
50+
working-directory: ./cla-backend-legacy
51+
run: |
52+
go mod download
53+
go build ./...
54+
55+
- name: Perform CodeQL Analysis
56+
uses: github/codeql-action/analyze@v3
57+
with:
58+
category: "/language:${{matrix.language}}"
59+
fail-on-error: false # Don't fail CI on legacy security warnings

0 commit comments

Comments
 (0)