Skip to content

Commit

Permalink
chore(release): Test v7.19.5 (#9478)
Browse files Browse the repository at this point in the history
* chore(env vars): Stripe vars moved to the Integrations section (#9427)

* chore: fix misleading `isLead` field name on `Team` (#9413)

* chore: fix misleading `isLead` field name on `Team`

The field indicates whether the viewer is the lead, but when used in a
query for a different user, the result could be read wrong.

* Fix Team.isLead dependencies

* feat: remove team template limit (#9424)

* update error message and increase template limit

* remove max team template limits

* remove canClone prop from CloneTemplate

* remove unused threshold

* remove unused threshold

* feat: Add Google calendar meeting series for recurrence (#9380)

* feat: Add recurrence to GCal events

* Fun with timezones

* fix: Increase the number of projects fetched per request from Atlassian (#9435)

We ran into timeouts in `getAllProjects`, presumably because we're doing
too many roundtrips. As a quick fix, increse the number of projects
fetched per request from 50 to 500.

* chore(deps): bump ip from 1.1.8 to 1.1.9 (#9442)

Bumps [ip](https://github.com/indutny/node-ip) from 1.1.8 to 1.1.9.
- [Commits](indutny/node-ip@v1.1.8...v1.1.9)

---
updated-dependencies:
- dependency-name: ip
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(release): release v7.17.0 (#9428)

Co-authored-by: parabol-release-bot[bot] <150284312+parabol-release-bot[bot]@users.noreply.github.com>

* feat(standalone-deployment): Standalone host deployment improved and documented (#9445)

* Docker compose stack improved

* Remove unused containers from docker-compse and add useful comment on .env.example about PGSSLMODE

* Docker compose profiles added. Documentation extended on how to use the profiles to manage the stack.

* README fixed as docker compose up and down commands were not working

* Typo fixed and docker-compose command replaced by docker compose

* feat: support env-defined saml issuer for PPMIs (#9455)

* feat: support env-defined saml issuer for PPMIs

Signed-off-by: Matt Krick <matt.krick@gmail.com>

* feat: support single SAML for entire tenant

Signed-off-by: Matt Krick <matt.krick@gmail.com>

---------

Signed-off-by: Matt Krick <matt.krick@gmail.com>

* chore: Associate logs with traces (#9444)

* chore: Associate logs with traces

Add trace information to log output for server side log statements. This
does not include logging from code exclusively used for debugging,
deploying or development.

* Actually add the logger

* Fix DD_LOGS_INJECTION check

* chore(release): release v7.18.0 (#9450)

Co-authored-by: parabol-release-bot[bot] <150284312+parabol-release-bot[bot]@users.noreply.github.com>

* chore: no force-push to prod (#9401)

Signed-off-by: Matt Krick <matt.krick@gmail.com>

* chore(release): release v7.18.1 (#9459)

Co-authored-by: parabol-release-bot[bot] <150284312+parabol-release-bot[bot]@users.noreply.github.com>

* feat: embedder service (#9417)

* feat: add embedder service

---------

Signed-off-by: Matt Krick <matt.krick@gmail.com>
Co-authored-by: Matt Krick <matt.krick@gmail.com>

* merge production to avoid force push (#9461)

Signed-off-by: Matt Krick <matt.krick@gmail.com>

* chore(release): release v7.19.0 (#9460)

Co-authored-by: parabol-release-bot[bot] <150284312+parabol-release-bot[bot]@users.noreply.github.com>

* fix: checkout prod before merging it (#9463)

Signed-off-by: Matt Krick <matt.krick@gmail.com>

* chore(release): release v7.19.1 (#9464)

Co-authored-by: parabol-release-bot[bot] <150284312+parabol-release-bot[bot]@users.noreply.github.com>

* fix: mrege origin/production strategy (#9465)

Signed-off-by: Matt Krick <matt.krick@gmail.com>

* chore(release): release v7.19.2 (#9466)

Co-authored-by: parabol-release-bot[bot] <150284312+parabol-release-bot[bot]@users.noreply.github.com>

* fix: force push 5 (#9467)

Signed-off-by: Matt Krick <matt.krick@gmail.com>

* chore(release): release v7.19.3 (#9468)

Co-authored-by: parabol-release-bot[bot] <150284312+parabol-release-bot[bot]@users.noreply.github.com>

* fix: limit invites from spammers (#9416)

* fix: limit invites from spammers

* update where we check pending emails

* check total plus pending invites

* use invitees instead of pending

* fix: Fetch Jira projects in parallel (#9456)

Previously we tried to fetch more projects per page, but Jira only ever
returns 50 max. Instead once we know how many projects there are after
fetching the first page, we fetch all remaining pages in parallel.

* fix: replace lone surrogates in draft-js content (#9415)

* fix: replace lone surrogates in draft-js content

Signed-off-by: Matt Krick <matt.krick@gmail.com>

* fix typo

Signed-off-by: Matt Krick <matt.krick@gmail.com>

* fix: eslint errors

Signed-off-by: Matt Krick <matt.krick@gmail.com>

---------

Signed-off-by: Matt Krick <matt.krick@gmail.com>

* chore(deps): bump es5-ext from 0.10.62 to 0.10.64 (#9457)

Bumps [es5-ext](https://github.com/medikoo/es5-ext) from 0.10.62 to 0.10.64.
- [Release notes](https://github.com/medikoo/es5-ext/releases)
- [Changelog](https://github.com/medikoo/es5-ext/blob/main/CHANGELOG.md)
- [Commits](medikoo/es5-ext@v0.10.62...v0.10.64)

---
updated-dependencies:
- dependency-name: es5-ext
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* fix: packages/server/package.json to reduce vulnerabilities (#9434)

The following vulnerabilities are fixed with an upgrade:
- https://snyk.io/vuln/SNYK-JS-UNDICI-6252336

Co-authored-by: snyk-bot <snyk-bot@snyk.io>

* fix: packages/server/package.json to reduce vulnerabilities (#9392)

The following vulnerabilities are fixed with an upgrade:
- https://snyk.io/vuln/SNYK-JS-NODEMAILER-6219989

Co-authored-by: snyk-bot <snyk-bot@snyk.io>

* fix: packages/server/package.json to reduce vulnerabilities (#9298)

The following vulnerabilities are fixed with an upgrade:
- https://snyk.io/vuln/SNYK-JS-FOLLOWREDIRECTS-6141137

Co-authored-by: snyk-bot <snyk-bot@snyk.io>

* chore(deps): bump follow-redirects from 1.14.8 to 1.15.4 (#9312)

Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.14.8 to 1.15.4.
- [Release notes](https://github.com/follow-redirects/follow-redirects/releases)
- [Commits](follow-redirects/follow-redirects@v1.14.8...v1.15.4)

---
updated-dependencies:
- dependency-name: follow-redirects
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Matt Krick <matt.krick@gmail.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Matt Krick <matt.krick@gmail.com>

* chore: add upload to GCS step in ironbank (#9471)

* add upload to GCS step in ironbank

* update workflow name

* chore(release): release v7.19.4 (#9470)

Co-authored-by: parabol-release-bot[bot] <150284312+parabol-release-bot[bot]@users.noreply.github.com>

* fix: Fix seasonal templates for leap years (#9476)

* fix: Fix seasonal templates for leap years

It would produce invalid dates on February 29th.

* Master was not clean

* chore(release): release v7.19.5 (#9477)

Co-authored-by: parabol-release-bot[bot] <150284312+parabol-release-bot[bot]@users.noreply.github.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Matt Krick <matt.krick@gmail.com>
Co-authored-by: Rafa <101704572+rafaelromcar-parabol@users.noreply.github.com>
Co-authored-by: Georg Bremer <github@dschoordsch.de>
Co-authored-by: Nick O'Ferrall <nickoferrall@gmail.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: parabol-release-bot[bot] <150284312+parabol-release-bot[bot]@users.noreply.github.com>
Co-authored-by: Matt Krick <matt.krick@gmail.com>
Co-authored-by: Jordan Husney <jordan.husney@gmail.com>
Co-authored-by: adaniels-parabol <71724289+adaniels-parabol@users.noreply.github.com>
Co-authored-by: snyk-bot <snyk-bot@snyk.io>
Co-authored-by: Dale Bumblis <135627447+dbumblis-parabol@users.noreply.github.com>
Co-authored-by: github-actions <github-actions@github.com>
  • Loading branch information
12 people authored Feb 29, 2024
1 parent 5485425 commit ac2807a
Show file tree
Hide file tree
Showing 17 changed files with 330 additions and 150 deletions.
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ module.exports = {
'@typescript-eslint/no-use-before-define': 'off',
'@typescript-eslint/explicit-member-accessibility': 'off',
'@typescript-eslint/interface-name-prefix': 'off',
'@typescript-eslint/no-duplicate-enum-values': 'off',
'@typescript-eslint/no-unused-vars': 'off',
'@typescript-eslint/no-var-requires': 'off',
'@typescript-eslint/no-parameter-properties': 'off',
Expand Down
10 changes: 9 additions & 1 deletion .github/workflows/ironbank.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Ironbank S3 Upload
name: Ironbank Image Upload

on:
workflow_dispatch:
Expand Down Expand Up @@ -64,3 +64,11 @@ jobs:
- name: Upload to S3
run: |
aws s3 cp ${{ github.event.inputs.version_number }}.zip s3://ironbank-proving-ground-action-files.parabol.co/${{ github.event.inputs.version_number }}.zip
- name: Upload to GCS
uses: actions-hub/gcloud@master
env:
CLOUDSDK_AUTH_ACCESS_TOKEN: "${{ steps.auth.outputs.access_token }}"
with:
args: storage cp ${{ github.event.inputs.version_number }}.zip gs://ironbank-proving-ground/${{ github.event.inputs.version_number }}.zip
cli: gcloud
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "7.19.3"
".": "7.19.5"
}
26 changes: 26 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,32 @@ This project adheres to [Semantic Versioning](http://semver.org/).

This CHANGELOG follows conventions [outlined here](http://keepachangelog.com/).

## [7.19.5](https://github.com/ParabolInc/parabol/compare/v7.19.4...v7.19.5) (2024-02-29)


### Fixed

* Fix seasonal templates for leap years ([#9476](https://github.com/ParabolInc/parabol/issues/9476)) ([419d104](https://github.com/ParabolInc/parabol/commit/419d104757d905c468d6a72ce607430d01f3b97f))

## [7.19.4](https://github.com/ParabolInc/parabol/compare/v7.19.3...v7.19.4) (2024-02-28)


### Fixed

* Fetch Jira projects in parallel ([#9456](https://github.com/ParabolInc/parabol/issues/9456)) ([9cec00a](https://github.com/ParabolInc/parabol/commit/9cec00a5fd0b46c73ebdde27e6d966b485216132))
* limit invites from spammers ([#9416](https://github.com/ParabolInc/parabol/issues/9416)) ([5b9526c](https://github.com/ParabolInc/parabol/commit/5b9526c092f7f8675ad2a442da4440e2507cbdcc))
* packages/server/package.json to reduce vulnerabilities ([#9298](https://github.com/ParabolInc/parabol/issues/9298)) ([fd75d3f](https://github.com/ParabolInc/parabol/commit/fd75d3f2a907888bb461d55ac945d9449071a414))
* packages/server/package.json to reduce vulnerabilities ([#9392](https://github.com/ParabolInc/parabol/issues/9392)) ([fd833f5](https://github.com/ParabolInc/parabol/commit/fd833f541ef7f915b40331c9d12e94243c8fa24f))
* packages/server/package.json to reduce vulnerabilities ([#9434](https://github.com/ParabolInc/parabol/issues/9434)) ([1e0075e](https://github.com/ParabolInc/parabol/commit/1e0075e843ce3cf52966a0b77293d72f1d9c60b9))
* replace lone surrogates in draft-js content ([#9415](https://github.com/ParabolInc/parabol/issues/9415)) ([00092ec](https://github.com/ParabolInc/parabol/commit/00092ec55659d1441e9566d501940dcc6fcf07f4))


### Changed

* add upload to GCS step in ironbank ([#9471](https://github.com/ParabolInc/parabol/issues/9471)) ([7bfec91](https://github.com/ParabolInc/parabol/commit/7bfec9188a42b38eb69930fdd86e6fb39249ed7e))
* **deps:** bump es5-ext from 0.10.62 to 0.10.64 ([#9457](https://github.com/ParabolInc/parabol/issues/9457)) ([92f0be9](https://github.com/ParabolInc/parabol/commit/92f0be917d4bd182bc6ea249f5dc40c05b98320a))
* **deps:** bump follow-redirects from 1.14.8 to 1.15.4 ([#9312](https://github.com/ParabolInc/parabol/issues/9312)) ([9441b27](https://github.com/ParabolInc/parabol/commit/9441b2727deefb7e27e4015f37d64ff933415c8d))

## [7.19.3](https://github.com/ParabolInc/parabol/compare/v7.19.2...v7.19.3) (2024-02-28)


Expand Down
9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "An open-source app for building smarter, more agile teams.",
"author": "Parabol Inc. <love@parabol.co> (http://github.com/ParabolInc)",
"license": "AGPL-3.0",
"version": "7.19.3",
"version": "7.19.5",
"repository": {
"type": "git",
"url": "https://github.com/ParabolInc/parabol"
Expand Down Expand Up @@ -52,7 +52,7 @@
"test:server": "yarn workspace parabol-server test"
},
"resolutions": {
"typescript": "4.9.5",
"typescript": "^5.3.3",
"hoist-non-react-statics": "^3.3.0",
"@types/react": "16.9.11",
"@types/react-dom": "16.9.4",
Expand Down Expand Up @@ -92,8 +92,8 @@
"@types/dotenv": "^6.1.1",
"@types/jscodeshift": "^0.11.3",
"@types/lodash.toarray": "^4.4.7",
"@typescript-eslint/eslint-plugin": "5.17.0",
"@typescript-eslint/parser": "5.17.0",
"@typescript-eslint/eslint-plugin": "^6.21.0",
"@typescript-eslint/parser": "^6.21.0",
"autoprefixer": "^10.4.13",
"babel-loader": "^9.1.2",
"concurrently": "^8.0.1",
Expand Down Expand Up @@ -123,6 +123,7 @@
"tailwindcss": "^3.2.7",
"terser-webpack-plugin": "^5.3.9",
"ts-loader": "9.2.6",
"typescript": "^5.3.3",
"vscode-apollo-relay": "^1.5.0",
"webpack": "^5.89.0",
"webpack-cli": "4.9.1",
Expand Down
6 changes: 3 additions & 3 deletions packages/chronos/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "chronos",
"version": "7.19.3",
"version": "7.19.5",
"description": "A cron job scheduler",
"author": "Matt Krick <matt.krick@gmail.com>",
"homepage": "https://github.com/ParabolInc/parabol/tree/master/packages/chronos#readme",
Expand All @@ -21,10 +21,10 @@
},
"devDependencies": {
"@types/cron": "^2.0.1",
"@types/node": "^16.11.62"
"@types/node": "^20.11.17"
},
"dependencies": {
"cron": "^2.3.1",
"parabol-server": "7.19.3"
"parabol-server": "7.19.5"
}
}
4 changes: 2 additions & 2 deletions packages/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "An open-source app for building smarter, more agile teams.",
"author": "Parabol Inc. <love@parabol.co> (http://github.com/ParabolInc)",
"license": "AGPL-3.0",
"version": "7.19.3",
"version": "7.19.5",
"repository": {
"type": "git",
"url": "https://github.com/ParabolInc/parabol"
Expand Down Expand Up @@ -60,7 +60,7 @@
"prettier": "^2.8.8",
"react-refresh": "^0.9.0",
"strict-event-emitter-types": "^2.0.0",
"typescript": "4.9.5",
"typescript": "^5.3.3",
"webpack-dev-server": "^4.15.1"
},
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/client/utils/AtlassianManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export type JiraPermissionScope =

export class RateLimitError {
retryAt: Date
name: 'RateLimitError' = 'RateLimitError'
name = 'RateLimitError' as const
message: string

constructor(message: string, retryAt: Date) {
Expand Down
3 changes: 2 additions & 1 deletion packages/client/utils/draftjs/extractTextFromDraftString.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import {RawDraftContentState} from 'draft-js'

const extractTextFromDraftString = (content: string) => {
const parsedContent = JSON.parse(content) as RawDraftContentState
const textBlocks = parsedContent.blocks.map(({text}) => text)
// toWellFormed replaces lone surrogates with replacement char (e.g. emoji that only has its first code point)
const textBlocks = parsedContent.blocks.map(({text}) => (text as any).toWellFormed())
return textBlocks.join('\n')
}

Expand Down
10 changes: 5 additions & 5 deletions packages/gql-executor/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gql-executor",
"version": "7.19.3",
"version": "7.19.5",
"description": "A Stateless GraphQL Executor",
"author": "Matt Krick <matt.krick@gmail.com>",
"homepage": "https://github.com/ParabolInc/parabol/tree/master/packages/gqlExecutor#readme",
Expand All @@ -18,17 +18,17 @@
"devDependencies": {
"@babel/cli": "7.18.6",
"@babel/core": "7.18.6",
"@types/node": "^16.11.62",
"@types/node": "^20.11.17",
"babel-plugin-inline-import": "^3.0.0",
"chokidar": "^3.3.1",
"sucrase": "^3.32.0",
"ts-node-dev": "^1.0.0-pre.44",
"typescript": "4.9.5"
"typescript": "^5.3.3"
},
"dependencies": {
"dd-trace": "^4.2.0",
"parabol-client": "7.19.3",
"parabol-server": "7.19.3",
"parabol-client": "7.19.5",
"parabol-server": "7.19.5",
"undici": "^5.26.2"
}
}
7 changes: 2 additions & 5 deletions packages/integration-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "integration-tests",
"author": "Parabol Inc. <love@parabol.co> (http://github.com/ParabolInc)",
"license": "AGPL-3.0",
"version": "7.19.3",
"version": "7.19.5",
"description": "",
"main": "index.js",
"scripts": {
Expand All @@ -11,13 +11,10 @@
},
"devDependencies": {
"@playwright/test": "^1.34.3",
"@types/node": "^16.11.62",
"@typescript-eslint/eslint-plugin": "^5.17.0",
"@typescript-eslint/parser": "^5.17.0",
"eslint": "^8.8.0",
"eslint-config-prettier": "^8.5.0",
"lint-staged": "^12.3.3",
"ts-app-env": "^1.4.2",
"typescript": "^4.5.5"
"typescript": "^5.3.3"
}
}
4 changes: 2 additions & 2 deletions packages/server/dataloader/customLoaderMakers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -481,8 +481,8 @@ export const meetingTemplatesByOrgId = (parent: RootDataLoader) => {
.where(({or, eb}) =>
or([
eb('hideStartingAt', 'is', null),
sql<SqlBool>`make_date(2020 , extract(month from current_date)::integer, extract(day from current_date)::integer) between "hideEndingAt" and "hideStartingAt"`,
sql<SqlBool>`make_date(2019 , extract(month from current_date)::integer, extract(day from current_date)::integer) between "hideEndingAt" and "hideStartingAt"`
sql<SqlBool>`DATE '2020-01-01' + EXTRACT(DOY FROM CURRENT_DATE)::INTEGER - 1 between "hideEndingAt" and "hideStartingAt"`,
sql<SqlBool>`DATE '2019-01-01' + EXTRACT(DOY FROM CURRENT_DATE)::INTEGER - 1 between "hideEndingAt" and "hideStartingAt"`
])
)
.orderBy('createdAt', 'desc')
Expand Down
15 changes: 15 additions & 0 deletions packages/server/graphql/mutations/helpers/inviteToTeamHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,21 @@ const inviteToTeamHelper = async (
const operationId = dataLoader.share()
const subOptions = {mutatorId, operationId}

const [total, pending] = await Promise.all([
r.table('TeamInvitation').getAll(teamId, {index: 'teamId'}).count().run(),
r
.table('TeamInvitation')
.getAll(teamId, {index: 'teamId'})
.filter({acceptedAt: null})
.count()
.run()
])
const accepted = total - pending
// if no one has accepted one of their 100+ invites, don't trust them
if (accepted === 0 && total + invitees.length >= 100) {
return standardError(new Error('Exceeded unaccepted invitation limit'), {userId: viewerId})
}

const untrustedDomains = ['tempmail.cn', 'qq.com']
const filteredInvitees = invitees.filter(
(invitee) => !untrustedDomains.includes(getDomainFromEmail(invitee).toLowerCase())
Expand Down
12 changes: 6 additions & 6 deletions packages/server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "An open-source app for building smarter, more agile teams.",
"author": "Parabol Inc. <love@parabol.co> (http://github.com/ParabolInc)",
"license": "AGPL-3.0",
"version": "7.19.3",
"version": "7.19.5",
"repository": {
"type": "git",
"url": "https://github.com/ParabolInc/parabol"
Expand Down Expand Up @@ -39,7 +39,7 @@
"@types/jsonwebtoken": "^8.3.0",
"@types/mime-types": "^2.1.0",
"@types/ms": "^0.7.30",
"@types/node": "^16.11.62",
"@types/node": "^20.11.17",
"@types/nodemailer": "^6.4.14",
"@types/relay-runtime": "^14.1.9",
"@types/sharp": "^0.32.0",
Expand Down Expand Up @@ -68,7 +68,7 @@
"sucrase": "^3.32.0",
"ts-jest": "^29.1.0",
"ts-node": "^8.6.2",
"typescript": "4.9.5",
"typescript": "^5.3.3",
"url-loader": "4.1.1",
"vscode-apollo-relay": "^1.5.0",
"webpack-bundle-analyzer": "4.3.0",
Expand All @@ -87,7 +87,7 @@
"@sentry/integrations": "^7.74.1",
"@sentry/node": "^7.74.1",
"adaptivecards": "^2.10.0",
"analytics-node": "^5.0.0",
"analytics-node": "^6.0.0",
"api": "^5.0.7",
"base64url": "^3.0.1",
"bcryptjs": "^2.4.3",
Expand Down Expand Up @@ -124,7 +124,7 @@
"oauth-1.0a": "^2.2.6",
"openai": "^4.24.1",
"oy-vey": "^0.11.0",
"parabol-client": "7.19.3",
"parabol-client": "7.19.5",
"pg": "^8.5.1",
"react": "^17.0.2",
"react-dom": "^17.0.2",
Expand All @@ -137,6 +137,6 @@
"stripe": "^9.13.0",
"tslib": "^2.4.0",
"uWebSockets.js": "uNetworking/uWebSockets.js#v20.34.0",
"undici": "^5.26.2"
"undici": "^5.28.3"
}
}
15 changes: 3 additions & 12 deletions packages/server/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,8 @@
"parabol-client/*": ["client/*"],
"~/*": ["client/*"]
},
"lib": [
"esnext",
"dom"
],
"types": [
"node",
"jest",
"jest-extended"
]
"lib": ["esnext", "dom"],
"types": ["node", "jest", "jest-extended"]
},

"exclude": [
Expand All @@ -31,9 +24,7 @@
"server.ts",
"../client/modules/email/components/SummaryEmail/MeetingSummaryEmail/MeetingSummaryEmail.tsx"
],
"include": [
"graphql/**/*.ts",
]
"include": ["graphql/**/*.ts"]

// if "include" or "files" is added, even if they are empty arrays, then strictNullChecks breaks
// repro: https://www.typescriptlang.org/play?strictFunctionTypes=false&strictPropertyInitialization=false&strictBindCallApply=false&noImplicitThis=false&noImplicitReturns=false&alwaysStrict=false&declaration=false&experimentalDecorators=false&emitDecoratorMetadata=false&target=6&ts=3.5.1#code/C4TwDgpgBA8gRgKygXigbwFBSgWwIYhwQDKwATgIJlkD8AXFAM7kCWAdgOYDaAuhgL4ZQkKFTIpYiLgHJ8hEuTHS+AYwD2bZlDwS2AVwA2B7Y21sQJ0dQx4AdADM1ZAKJ4VACwAUngF4BKFAA+KH8MIA
Expand Down
54 changes: 43 additions & 11 deletions packages/server/utils/AtlassianServerManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,38 @@ class AtlassianServerManager extends AtlassianManager {
async getAllProjects(cloudIds: string[]) {
const projects = [] as (JiraProject & {cloudId: string})[]
let error: Error | undefined
const getProjectPage = async (cloudId: string, url: string): Promise<void> => {
const getProjectsPage = async (
cloudId: string,
startAt: number,
maxResults: number
): Promise<void> => {
const url = `https://api.atlassian.com/ex/jira/${cloudId}/rest/api/3/project/search?orderBy=name&startAt=${startAt}`
const res = await this.get<JiraProjectResponse>(url)
if (res instanceof Error || res instanceof RateLimitError) {
error = res
} else {
const pagedProjects = res.values.map((project) => ({
...project,
cloudId
}))
projects.push(...pagedProjects)

if (pagedProjects.length < maxResults && res.nextPage) {
Logger.log(
'Underfetched in getAllProjects, requested',
maxResults,
'got',
pagedProjects.length
)
const nextStart = res.startAt + pagedProjects.length
const nextMaxResults = maxResults - pagedProjects.length
return getProjectsPage(cloudId, nextStart, nextMaxResults)
}
}
}

const getProjects = async (cloudId: string) => {
const url = `https://api.atlassian.com/ex/jira/${cloudId}/rest/api/3/project/search?orderBy=name`
const res = await this.get<JiraProjectResponse>(url)
if (res instanceof Error || res instanceof RateLimitError) {
error = res
Expand All @@ -369,19 +400,20 @@ class AtlassianServerManager extends AtlassianManager {
}))
projects.push(...pagedProjects)
if (res.nextPage) {
Logger.log('AtlassianServerManager.getAllProjects fetching more results', res.total)
return getProjectPage(cloudId, res.nextPage)
const {total} = res
const nextStart = res.startAt + pagedProjects.length
const fetches = [] as Array<Promise<void>>
// 50 is the default maxResults for Jira, Jira does not respond with more than that
const maxResults = 50
for (let i = nextStart; i < total; i += maxResults) {
fetches.push(getProjectsPage(cloudId, i, maxResults))
}
await Promise.all(fetches)
}
}
}
await Promise.all(
cloudIds.map((cloudId) =>
getProjectPage(
cloudId,
`https://api.atlassian.com/ex/jira/${cloudId}/rest/api/3/project/search?orderBy=name&maxResults=500`
)
)
)

await Promise.all(cloudIds.map((cloudId) => getProjects(cloudId)))

if (error) {
Logger.log('getAllProjects ERROR:', error)
Expand Down
Loading

0 comments on commit ac2807a

Please sign in to comment.