Skip to content

Commit ee2b80d

Browse files
authored
Merge branch 'main' into dependabot/uv/services/apps/git_integration/aiohttp-3.13.3
2 parents 35a535e + 6f9260a commit ee2b80d

916 files changed

Lines changed: 28554 additions & 36799 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.

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,8 @@ services/libs/tinybird/.diff_tmp
198198

199199
# claude code rules
200200
CLAUDE.md
201+
.claude
201202

202203
# git integration test repositories & output
203204
services/apps/git_integration/src/test/repos/
204-
services/apps/git_integration/src/test/outputs/custom/
205+
services/apps/git_integration/src/test/outputs/custom/

backend/.env.dist.composed

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ CROWD_S3_HOST="s3"
1111
# Db settings
1212
CROWD_DB_READ_HOST="db"
1313
CROWD_DB_WRITE_HOST="db"
14+
INSIGHTS_DB_WRITE_HOST="db"
1415

1516
# Product DB settings
1617
PRODUCT_DB_HOST=product

backend/.env.dist.local

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,14 @@ CROWD_DB_USERNAME=postgres
3838
CROWD_DB_PASSWORD=example
3939
CROWD_DB_DATABASE=crowd-web
4040

41+
INSIGHTS_DB_WRITE_HOST=localhost
42+
INSIGHTS_DB_USERNAME=postgres
43+
INSIGHTS_DB_PASSWORD=example
44+
INSIGHTS_DB_DATABASE=insights
45+
INSIGHTS_DB_PORT=5432
46+
INSIGHTS_DB_POOL_MAX=10
47+
INSIGHTS_DB_SSLMODE=disable
48+
4149
# Product DB settings
4250
PRODUCT_DB_HOST=localhost
4351
PRODUCT_DB_PORT=5433
@@ -127,9 +135,6 @@ CROWD_ORGANIZATION_ENRICHMENT_API_KEY=
127135
CROWD_EAGLE_EYE_URL=
128136
CROWD_EAGLE_EYE_API_KEY=
129137

130-
# Slack alerting settings
131-
CROWD_SLACK_ALERTING_URL=
132-
133138
# Weekly emails settings
134139
CROWD_WEEKLY_EMAILS_ENABLED="true"
135140

@@ -158,3 +163,7 @@ CROWD_GITHUB_IS_SNOWFLAKE_ENABLED=false
158163

159164
# Tinybird
160165
CROWD_TINYBIRD_BASE_URL=http://localhost:7181/
166+
167+
# Auth0
168+
CROWD_AUTH0_ISSUER_BASE_URL=
169+
CROWD_AUTH0_AUDIENCE=

backend/.eslintrc.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ module.exports = {
1212
'prefer-destructuring': ['error', { object: false, array: false }],
1313
'no-param-reassign': 0,
1414
'no-underscore-dangle': 0,
15+
'no-unused-vars': [
16+
'error',
17+
{ argsIgnorePattern: '^_', varsIgnorePattern: '^_', destructuredArrayIgnorePattern: '^_' },
18+
],
1519
'@typescript-eslint/naming-convention': [
1620
'error',
1721
{
@@ -46,6 +50,14 @@ module.exports = {
4650
'prefer-destructuring': ['error', { object: false, array: false }],
4751
'no-param-reassign': 0,
4852
'no-underscore-dangle': 0,
53+
'@typescript-eslint/no-unused-vars': [
54+
'error',
55+
{
56+
argsIgnorePattern: '^_',
57+
varsIgnorePattern: '^_',
58+
destructuredArrayIgnorePattern: '^_',
59+
},
60+
],
4961
'@typescript-eslint/naming-convention': [
5062
'error',
5163
{

backend/config/custom-environment-variables.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -143,9 +143,6 @@
143143
"installationId": "GITHUB_TOKEN_INSTALLATION_ID",
144144
"privateKey": "GITHUB_TOKEN_PRIVATE_KEY"
145145
},
146-
"slackAlerting": {
147-
"url": "CROWD_SLACK_ALERTING_URL"
148-
},
149146
"weeklyEmails": {
150147
"enabled": "CROWD_WEEKLY_EMAILS_ENABLED"
151148
},
@@ -156,7 +153,9 @@
156153
},
157154
"auth0": {
158155
"clientId": "CROWD_AUTH0_CLIENT_ID",
159-
"jwks": "CROWD_AUTH0_JWKS"
156+
"jwks": "CROWD_AUTH0_JWKS",
157+
"issuerBaseURL": "CROWD_AUTH0_ISSUER_BASE_URL",
158+
"audience": "CROWD_AUTH0_AUDIENCE"
160159
},
161160
"sso": {
162161
"crowdTenantId": "CROWD_SSO_CROWD_TENANT_ID",

backend/config/default.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,6 @@
3737
"organizationEnrichment": {},
3838
"eagleEye": {},
3939
"githubToken": {},
40-
"slackAlerting": {
41-
"url": ""
42-
},
4340
"auth0": {},
4441
"sso": {},
4542
"crowdAnalytics": {
@@ -52,5 +49,6 @@
5249
"gitlab": {},
5350
"jiraIssueReporter": {},
5451
"snowflake": {},
55-
"nango": {}
52+
"nango": {},
53+
"linuxFoundation": {}
5654
}

backend/config/production.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,8 @@
88
},
99
"slack": {
1010
"maxRetrospectInSeconds": 86400
11+
},
12+
"linuxFoundation": {
13+
"collectionId": "1606ad11-c96d-4177-8147-8f990b76b35d"
1114
}
1215
}

backend/config/staging.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
1-
{}
1+
{
2+
"linuxFoundation": {
3+
"collectionId": "5ffc867e-067a-4018-82ca-dbbade2c95f3"
4+
}
5+
}

backend/package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@
101101
"emoji-dictionary": "^1.0.11",
102102
"erlpack": "^0.1.4",
103103
"express": "4.17.1",
104+
"express-oauth2-jwt-bearer": "^1.7.4",
104105
"express-rate-limit": "6.5.1",
105106
"fast-levenshtein": "^3.0.0",
106107
"formidable-serverless": "1.1.1",
@@ -137,7 +138,8 @@
137138
"uuid": "^9.0.0",
138139
"validator": "^13.7.0",
139140
"verify-github-webhook": "^1.0.1",
140-
"zlib-sync": "^0.1.8"
141+
"zlib-sync": "^0.1.8",
142+
"zod": "^4.3.6"
141143
},
142144
"private": true,
143145
"devDependencies": {
@@ -149,6 +151,7 @@
149151
"@types/bunyan-format": "^0.2.5",
150152
"@types/config": "^3.3.0",
151153
"@types/cron": "^2.0.0",
154+
"@types/express": "^4.17.17",
152155
"@types/html-to-text": "^8.1.1",
153156
"@types/node": "~18.0.4",
154157
"@types/sanitize-html": "^2.6.2",

backend/src/api/apiRateLimiter.ts

Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,15 @@
11
import rateLimit from 'express-rate-limit'
22

3-
export function createRateLimiter({
4-
max,
5-
windowMs,
6-
message,
7-
}: {
8-
max: number
9-
windowMs: number
10-
message: string
11-
}) {
3+
import { RateLimitError } from '@crowd/common'
4+
5+
export function createRateLimiter({ max, windowMs }: { max: number; windowMs: number }) {
126
return rateLimit({
137
max,
148
windowMs,
15-
message,
16-
skip: (req) => {
17-
if (req.method === 'OPTIONS') {
18-
return true
19-
}
20-
21-
if (req.originalUrl.endsWith('/import')) {
22-
return true
23-
}
24-
25-
return false
9+
handler: (_req, res) => {
10+
const err = new RateLimitError()
11+
res.status(err.status).json(err.toJSON())
2612
},
13+
skip: (req) => req.method === 'OPTIONS' || req.originalUrl.endsWith('/import'),
2714
})
2815
}

0 commit comments

Comments
 (0)