Skip to content

Commit

Permalink
chore(release): Test v7.39.2 (#10030)
Browse files Browse the repository at this point in the history
Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Matt Krick <matt.krick@gmail.com>
Co-authored-by: Georg Bremer <github@dschoordsch.de>
Co-authored-by: parabol-release-bot[bot] <150284312+parabol-release-bot[bot]@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Rafa <101704572+rafaelromcar-parabol@users.noreply.github.com>
Co-authored-by: Matt Krick <matt.krick@gmail.com>
Co-authored-by: snyk-bot <snyk-bot@snyk.io>
Co-authored-by: GitHub Action <action@github.com>
Co-authored-by: Nick O'Ferrall <nickoferrall@gmail.com>
Co-authored-by: Bruce Tian <tianrunhe@gmail.com>
Co-authored-by: Dale Bumblis <135627447+dbumblis-parabol@users.noreply.github.com>
Co-authored-by: Mohd Muneeb <mr.mohdmuneeb123@gmail.com>
Co-authored-by: Muneeb-Ventures <mohd.muneeb@m0.ventures>
Co-authored-by: Jordan Husney <jordan.husney@gmail.com>
Co-authored-by: Bartosz Jarocki <jarocki.bartek@gmail.com>
Co-authored-by: Terry Acker <ackernaut@gmail.com>
Co-authored-by: Rafael Romero <rafael@parabol.co>
Co-authored-by: github-actions <github-actions@github.com>
  • Loading branch information
18 people authored Jul 24, 2024
1 parent c1cc19b commit 638a5a8
Show file tree
Hide file tree
Showing 56 changed files with 556 additions and 955 deletions.
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.39.1"
".": "7.39.2"
}
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,18 @@ This project adheres to [Semantic Versioning](http://semver.org/).

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

## [7.39.2](https://github.com/ParabolInc/parabol/compare/v7.39.1...v7.39.2) (2024-07-24)


### Fixed

* bump pm2 version ([#10027](https://github.com/ParabolInc/parabol/issues/10027)) ([0bb8ead](https://github.com/ParabolInc/parabol/commit/0bb8ead2adc52f64ad30ef57891791e1b3dd4ac1))


### Changed

* **rethinkdb:** TeamMember: Phase 3 ([#10003](https://github.com/ParabolInc/parabol/issues/10003)) ([73a5881](https://github.com/ParabolInc/parabol/commit/73a5881709f9345767c2a233cbe28716b6c3b8e1))

## [7.39.1](https://github.com/ParabolInc/parabol/compare/v7.39.0...v7.39.1) (2024-07-23)


Expand Down
4 changes: 2 additions & 2 deletions codegen.json
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@
"NotifyTaskInvolves": "../../database/types/NotificationTaskInvolves#default",
"NotifyTeamArchived": "../../database/types/NotificationTeamArchived#default",
"Organization": "./types/Organization#OrganizationSource",
"OrganizationUser": "../../postgres/types/index#OrganizationUser",
"OrganizationUser": "../../postgres/types/index#OrganizationUser as OrganizationUserDB",
"PokerMeeting": "../../database/types/MeetingPoker#default as MeetingPoker",
"PokerMeetingMember": "../../database/types/MeetingPokerMeetingMember#default as PokerMeetingMemberDB",
"PokerTemplate": "../../database/types/PokerTemplate#default as PokerTemplateDB",
Expand Down Expand Up @@ -145,7 +145,7 @@
"TeamHealthPhase": "./types/TeamHealthPhase#TeamHealthPhaseSource",
"TeamHealthStage": "./types/TeamHealthStage#TeamHealthStageSource",
"TeamInvitation": "../../database/types/TeamInvitation#default",
"TeamMember": "../../database/types/TeamMember#default as TeamMemberDB",
"TeamMember": "../../postgres/types/index#TeamMember as TeamMember",
"TeamMemberIntegrationAuthWebhook": "../../postgres/queries/getTeamMemberIntegrationAuth#TeamMemberIntegrationAuth",
"TeamMemberIntegrationAuthOAuth1": "../../postgres/queries/getTeamMemberIntegrationAuth#TeamMemberIntegrationAuth",
"TeamMemberIntegrationAuthOAuth2": "../../postgres/queries/getTeamMemberIntegrationAuth#TeamMemberIntegrationAuth",
Expand Down
4 changes: 2 additions & 2 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.39.1",
"version": "7.39.2",
"repository": {
"type": "git",
"url": "https://github.com/ParabolInc/parabol"
Expand Down Expand Up @@ -111,7 +111,7 @@
"minimist": "^1.2.5",
"node-loader": "^2.0.0",
"pg-promise": "^11.2.0",
"pm2": "^5.3.1",
"pm2": "^5.4.2",
"postcss": "^8.4.21",
"postcss-loader": "^7.0.2",
"prettier": "^3.2.5",
Expand Down
4 changes: 2 additions & 2 deletions packages/chronos/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "chronos",
"version": "7.39.1",
"version": "7.39.2",
"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 @@ -25,6 +25,6 @@
},
"dependencies": {
"cron": "^2.3.1",
"parabol-server": "7.39.1"
"parabol-server": "7.39.2"
}
}
2 changes: 1 addition & 1 deletion 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.39.1",
"version": "7.39.2",
"repository": {
"type": "git",
"url": "https://github.com/ParabolInc/parabol"
Expand Down
2 changes: 1 addition & 1 deletion packages/embedder/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "parabol-embedder",
"version": "7.39.1",
"version": "7.39.2",
"description": "A service that computes embedding vectors from Parabol objects",
"author": "Jordan Husney <jordan.husney@gmail.com>",
"homepage": "https://github.com/ParabolInc/parabol/tree/master/packages/embedder#readme",
Expand Down
6 changes: 3 additions & 3 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.39.1",
"version": "7.39.2",
"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 @@ -27,8 +27,8 @@
},
"dependencies": {
"dd-trace": "^4.2.0",
"parabol-client": "7.39.1",
"parabol-server": "7.39.1",
"parabol-client": "7.39.2",
"parabol-server": "7.39.2",
"undici": "^5.26.2"
}
}
2 changes: 1 addition & 1 deletion 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.39.1",
"version": "7.39.2",
"description": "",
"main": "index.js",
"scripts": {
Expand Down
5 changes: 0 additions & 5 deletions packages/server/database/rethinkDriver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import {MasterPool, r} from 'rethinkdb-ts'
import SlackAuth from '../database/types/SlackAuth'
import SlackNotification from '../database/types/SlackNotification'
import TeamInvitation from '../database/types/TeamInvitation'
import TeamMember from '../database/types/TeamMember'
import {AnyMeeting, AnyMeetingSettings, AnyMeetingTeamMember} from '../postgres/types/Meeting'
import {ScheduledJobUnion} from '../types/custom'
import getRethinkConfig from './getRethinkConfig'
Expand Down Expand Up @@ -156,10 +155,6 @@ export type RethinkSchema = {
type: TeamInvitation
index: 'email' | 'teamId' | 'token'
}
TeamMember: {
type: TeamMember
index: 'teamId' | 'userId'
}
TemplateDimension: {
type: TemplateDimension
index: 'teamId' | 'templateId' | 'scaleId'
Expand Down
55 changes: 0 additions & 55 deletions packages/server/database/types/TeamMember.ts

This file was deleted.

17 changes: 17 additions & 0 deletions packages/server/dataloader/foreignKeyLoaderMakers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,23 @@ export const teamsByOrgIds = foreignKeyLoaderMaker('teams', 'orgId', (orgIds) =>
selectTeams().where('orgId', 'in', orgIds).where('isArchived', '=', false).execute()
)

export const teamMembersByTeamId = foreignKeyLoaderMaker('teamMembers', 'teamId', (teamIds) =>
getKysely()
.selectFrom('TeamMember')
.selectAll()
.where('teamId', 'in', teamIds)
.where('isNotRemoved', '=', true)
.execute()
)

export const teamMembersByUserId = foreignKeyLoaderMaker('teamMembers', 'userId', (userIds) =>
getKysely()
.selectFrom('TeamMember')
.selectAll()
.where('userId', 'in', userIds)
.where('isNotRemoved', '=', true)
.execute()
)
export const discussionsByMeetingId = foreignKeyLoaderMaker(
'discussions',
'meetingId',
Expand Down
4 changes: 4 additions & 0 deletions packages/server/dataloader/primaryKeyLoaderMakers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,3 +146,7 @@ export const saml = primaryKeyLoaderMaker((ids: readonly string[]) => {
export const organizationUsers = primaryKeyLoaderMaker((ids: readonly string[]) => {
return getKysely().selectFrom('OrganizationUser').selectAll().where('id', 'in', ids).execute()
})

export const teamMembers = primaryKeyLoaderMaker((ids: readonly string[]) => {
return getKysely().selectFrom('TeamMember').selectAll().where('id', 'in', ids).execute()
})
28 changes: 0 additions & 28 deletions packages/server/dataloader/rethinkForeignKeyLoaderMakers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -221,31 +221,3 @@ export const teamInvitationsByTeamId = new RethinkForeignKeyLoaderMaker(
.run()
}
)

export const teamMembersByTeamId = new RethinkForeignKeyLoaderMaker(
'teamMembers',
'teamId',
async (teamIds) => {
// tasksByUserId is expensive since we have to look up each team to check the team archive status
const r = await getRethink()
return r
.table('TeamMember')
.getAll(r.args(teamIds), {index: 'teamId'})
.filter({isNotRemoved: true})
.run()
}
)

export const teamMembersByUserId = new RethinkForeignKeyLoaderMaker(
'teamMembers',
'userId',
async (userIds) => {
// tasksByUserId is expensive since we have to look up each team to check the team archive status
const r = await getRethink()
return r
.table('TeamMember')
.getAll(r.args(userIds), {index: 'userId'})
.filter({isNotRemoved: true})
.run()
}
)
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,5 @@ export const slackAuths = new RethinkPrimaryKeyLoaderMaker('SlackAuth')
export const slackNotifications = new RethinkPrimaryKeyLoaderMaker('SlackNotification')
export const suggestedActions = new RethinkPrimaryKeyLoaderMaker('SuggestedAction')
export const tasks = new RethinkPrimaryKeyLoaderMaker('Task')
export const teamMembers = new RethinkPrimaryKeyLoaderMaker('TeamMember')
export const teamInvitations = new RethinkPrimaryKeyLoaderMaker('TeamInvitation')
export const templateDimensions = new RethinkPrimaryKeyLoaderMaker('TemplateDimension')
10 changes: 6 additions & 4 deletions packages/server/graphql/mutations/archiveTeam.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import {GraphQLID, GraphQLNonNull, GraphQLObjectType} from 'graphql'
import {SubscriptionChannel} from 'parabol-client/types/constEnums'
import TeamMemberId from '../../../client/shared/gqlIds/TeamMemberId'
import {maybeRemoveRestrictions} from '../../billing/helpers/teamLimitsCheck'
import getRethink from '../../database/rethinkDriver'
import NotificationTeamArchived from '../../database/types/NotificationTeamArchived'
import removeMeetingTemplatesForTeam from '../../postgres/queries/removeMeetingTemplatesForTeam'
import safeArchiveTeam from '../../safeMutations/safeArchiveTeam'
import {analytics} from '../../utils/analytics/analytics'
import {getUserId, isSuperUser, isTeamLead, isUserOrgAdmin} from '../../utils/authorization'
import {getUserId, isSuperUser, isUserOrgAdmin} from '../../utils/authorization'
import publish from '../../utils/publish'
import standardError from '../../utils/standardError'
import {GQLContext} from '../graphql'
Expand Down Expand Up @@ -35,13 +36,14 @@ export default {

// AUTH
const viewerId = getUserId(authToken)
const [teamLead, viewer, teamToArchive] = await Promise.all([
isTeamLead(viewerId, teamId, dataLoader),
const [teamMember, viewer, teamToArchive] = await Promise.all([
dataLoader.get('teamMembers').load(TeamMemberId.join(teamId, viewerId)),
dataLoader.get('users').loadNonNull(viewerId),
dataLoader.get('teams').loadNonNull(teamId)
])
const isTeamLead = teamMember?.isLead
const isOrgAdmin = await isUserOrgAdmin(viewerId, teamToArchive.orgId, dataLoader)
if (!teamLead && !isSuperUser(authToken) && !isOrgAdmin) {
if (!isTeamLead && !isSuperUser(authToken) && !isOrgAdmin) {
return standardError(new Error('Not team lead or org admin'), {userId: viewerId})
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import TimelineEventCreatedTeam from '../../../database/types/TimelineEventCreat
import {DataLoaderInstance} from '../../../dataloader/RootDataLoader'
import getKysely from '../../../postgres/getKysely'
import IUser from '../../../postgres/types/IUser'
import insertNewTeamMember from '../../../safeMutations/insertNewTeamMember'

interface ValidNewTeam {
id: string
Expand Down Expand Up @@ -68,9 +67,7 @@ export default async function createTeamAndLeader(
.values(timelineEvent)
.execute(),
// add meeting settings
r.table('MeetingSettings').insert(meetingSettings).run(),
// denormalize common fields to team member
insertNewTeamMember(user, teamId, dataLoader)
r.table('MeetingSettings').insert(meetingSettings).run()
])
dataLoader.clearAll(['teams', 'users', 'teamMembers', 'timelineEvents', 'meetingSettings'])
}
12 changes: 1 addition & 11 deletions packages/server/graphql/mutations/helpers/removeTeamMember.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,18 +47,12 @@ const removeTeamMember = async (
r.table('Task').getAll(teamId, {index: 'teamId'}).delete()
])
} else if (isLead) {
// assign new leader, remove old leader flag
await pg
.updateTable('TeamMember')
.set(({not}) => ({isLead: not('isLead')}))
.where('id', 'in', [teamMemberId, teamLeader.id])
.execute()
// assign new leader, remove old leader flag
await r({
newTeamLead: r.table('TeamMember').get(teamLeader.id).update({
isLead: true
}),
oldTeamLead: r.table('TeamMember').get(teamMemberId).update({isLead: false})
}).run()
}

await pg
Expand All @@ -68,10 +62,6 @@ const removeTeamMember = async (
.execute()
// assign active tasks to the team lead
const {integratedTasksToArchive, reassignedTasks} = await r({
teamMember: r.table('TeamMember').get(teamMemberId).update({
isNotRemoved: false,
updatedAt: now
}),
integratedTasksToArchive: r
.table('Task')
.getAll(userId, {index: 'userId'})
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Meeting from '../../../database/types/Meeting'
import MeetingMember from '../../../database/types/MeetingMember'
import TeamMember from '../../../database/types/TeamMember'
import {TeamMember} from '../../../postgres/types'
import {analytics} from '../../../utils/analytics/analytics'
import {DataLoaderWorker} from '../../graphql'

Expand Down
4 changes: 2 additions & 2 deletions packages/server/graphql/mutations/joinMeeting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ import Meeting from '../../database/types/Meeting'
import MeetingRetrospective from '../../database/types/MeetingRetrospective'
import PokerMeetingMember from '../../database/types/PokerMeetingMember'
import RetroMeetingMember from '../../database/types/RetroMeetingMember'
import TeamMember from '../../database/types/TeamMember'
import TeamPromptMeetingMember from '../../database/types/TeamPromptMeetingMember'
import TeamPromptResponseStage from '../../database/types/TeamPromptResponseStage'
import UpdatesStage from '../../database/types/UpdatesStage'
import insertDiscussions from '../../postgres/queries/insertDiscussions'
import {TeamMember} from '../../postgres/types'
import {analytics} from '../../utils/analytics/analytics'
import {getUserId, isTeamMember} from '../../utils/authorization'
import getPhase from '../../utils/getPhase'
Expand Down Expand Up @@ -82,7 +82,7 @@ const joinMeeting = {
return {error: {message: 'Not on the team'}}
}
const teamMemberId = toTeamMemberId(teamId, viewerId)
const teamMember = await dataLoader.get('teamMembers').load(teamMemberId)
const teamMember = await dataLoader.get('teamMembers').loadNonNull(teamMemberId)
const meetingMember = createMeetingMember(meeting, teamMember)
const {errors} = await r.table('MeetingMember').insert(meetingMember).run()
// if this is called concurrently, only 1 will be error free
Expand Down
Loading

0 comments on commit 638a5a8

Please sign in to comment.