Skip to content

Commit

Permalink
chore(release): Test and deploy to Production v7.51.2 (#10366)
Browse files Browse the repository at this point in the history
Signed-off-by: Matt Krick <[email protected]>
Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: parabol-release-bot[bot] <150284312+parabol-release-bot[bot]@users.noreply.github.com>
Co-authored-by: Nick O'Ferrall <[email protected]>
Co-authored-by: Georg Bremer <[email protected]>
Co-authored-by: Matt Krick <[email protected]>
Co-authored-by: Rafael Romero <[email protected]>
Co-authored-by: Rafa <[email protected]>
Co-authored-by: Jordan Husney <[email protected]>
Co-authored-by: Bruce Tian <[email protected]>
Co-authored-by: Terry Acker <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: snyk-bot <[email protected]>
Co-authored-by: GitHub Action <[email protected]>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: Dale Bumblis <[email protected]>
Co-authored-by: github-actions <[email protected]>
  • Loading branch information
16 people authored Oct 17, 2024
1 parent cedc8ea commit fd4c17d
Show file tree
Hide file tree
Showing 34 changed files with 411 additions and 37 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.51.1"
".": "7.51.2"
}
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ This project adheres to [Semantic Versioning](http://semver.org/).

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

## [7.51.2](https://github.com/ParabolInc/parabol/compare/v7.51.1...v7.51.2) (2024-10-17)


### Changed

* **rethinkdb:** Notification: Phase 1 ([#10350](https://github.com/ParabolInc/parabol/issues/10350)) ([3964c7c](https://github.com/ParabolInc/parabol/commit/3964c7c9d639bf28f3ae90c780c66f3c999ae0cd))

## [7.51.1](https://github.com/ParabolInc/parabol/compare/v7.51.0...v7.51.1) (2024-10-17)


Expand Down
2 changes: 1 addition & 1 deletion 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. <[email protected]> (http://github.com/ParabolInc)",
"license": "AGPL-3.0",
"version": "7.51.1",
"version": "7.51.2",
"repository": {
"type": "git",
"url": "https://github.com/ParabolInc/parabol"
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.51.1",
"version": "7.51.2",
"description": "A cron job scheduler",
"author": "Matt Krick <[email protected]>",
"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.51.1"
"parabol-server": "7.51.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. <[email protected]> (http://github.com/ParabolInc)",
"license": "AGPL-3.0",
"version": "7.51.1",
"version": "7.51.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.51.1",
"version": "7.51.2",
"description": "A service that computes embedding vectors from Parabol objects",
"author": "Jordan Husney <[email protected]>",
"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.51.1",
"version": "7.51.2",
"description": "A Stateless GraphQL Executor",
"author": "Matt Krick <[email protected]>",
"homepage": "https://github.com/ParabolInc/parabol/tree/master/packages/gqlExecutor#readme",
Expand All @@ -26,8 +26,8 @@
},
"dependencies": {
"dd-trace": "^5.0.0",
"parabol-client": "7.51.1",
"parabol-server": "7.51.1",
"parabol-client": "7.51.2",
"parabol-server": "7.51.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. <[email protected]> (http://github.com/ParabolInc)",
"license": "AGPL-3.0",
"version": "7.51.1",
"version": "7.51.2",
"description": "",
"main": "index.js",
"scripts": {
Expand Down
7 changes: 7 additions & 0 deletions packages/server/billing/helpers/removeTeamsLimitObjects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@ const removeTeamsLimitObjects = async (orgId: string, dataLoader: DataLoaderWork
// Remove team limits jobs and existing notifications
const [, updateNotificationsChanges] = await Promise.all([
pg
.with('NotificationUpdate', (qb) =>
qb
.updateTable('Notification')
.set({status: 'CLICKED'})
.where('orgId', '=', orgId)
.where('type', 'in', removeNotificationTypes)
)
.deleteFrom('ScheduledJob')
.where('orgId', '=', orgId)
.where('type', 'in', removeJobTypes)
Expand Down
3 changes: 2 additions & 1 deletion packages/server/billing/helpers/teamLimitsCheck.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ const sendWebsiteNotifications = async (
userIds: string[],
dataLoader: DataLoaderWorker
) => {
const pg = getKysely()
const {id: orgId, name: orgName, picture: orgPicture} = organization
const operationId = dataLoader.share()
const subOptions = {operationId}
Expand All @@ -60,7 +61,7 @@ const sendWebsiteNotifications = async (
})

await r.table('Notification').insert(notificationsToInsert).run()

await pg.insertInto('Notification').values(notificationsToInsert).execute()
notificationsToInsert.forEach((notification) => {
publishNotification(notification, subOptions)
})
Expand Down
4 changes: 2 additions & 2 deletions packages/server/database/types/NotificationPaymentRejected.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ interface Input {
export default class NotificationPaymentRejected extends Notification {
readonly type = 'PAYMENT_REJECTED'
orgId: string
last4: string
last4: number
brand: string

constructor(input: Input) {
const {orgId, last4, brand, userId} = input
super({userId, type: 'PAYMENT_REJECTED'})
this.orgId = orgId
this.last4 = String(last4)
this.last4 = Number(last4)
this.brand = brand
}
}
2 changes: 1 addition & 1 deletion packages/server/database/types/processTeamsLimitsJob.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const processTeamsLimitsJob = async (job: ScheduledTeamLimitsJob, dataLoader: Da
})

await r.table('Notification').insert(notificationsToInsert).run()

await getKysely().insertInto('Notification').values(notificationsToInsert).execute()
const operationId = dataLoader.share()
const subOptions = {operationId}
notificationsToInsert.forEach((notification) => {
Expand Down
3 changes: 3 additions & 0 deletions packages/server/graphql/mutations/archiveTeam.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ 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 getKysely from '../../postgres/getKysely'
import removeMeetingTemplatesForTeam from '../../postgres/queries/removeMeetingTemplatesForTeam'
import safeArchiveTeam from '../../safeMutations/safeArchiveTeam'
import {analytics} from '../../utils/analytics/analytics'
Expand All @@ -30,6 +31,7 @@ export default {
{teamId}: {teamId: string},
{authToken, dataLoader, socketId: mutatorId}: GQLContext
) {
const pg = getKysely()
const r = await getRethink()
const operationId = dataLoader.share()
const subOptions = {operationId, mutatorId}
Expand Down Expand Up @@ -70,6 +72,7 @@ export default {

if (notifications.length) {
await r.table('Notification').insert(notifications).run()
await pg.insertInto('Notification').values(notifications).execute()
}

const data = {
Expand Down
5 changes: 3 additions & 2 deletions packages/server/graphql/mutations/createTask.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ const handleAddTaskNotifications = async (
teamId: string,
subOptions: SubOptions
) => {
const pg = getKysely()
const r = await getRethink()
const {id: taskId, content, tags, userId} = task
const usersIdsToIgnore = await getUsersToIgnore(viewerId, teamId)
Expand Down Expand Up @@ -107,8 +108,8 @@ const handleAddTaskNotifications = async (
const data = {taskId, notifications: notificationsToAdd}

if (notificationsToAdd.length) {
// don't await to speed up task creation
r.table('Notification').insert(notificationsToAdd).run()
await r.table('Notification').insert(notificationsToAdd).run()
await pg.insertInto('Notification').values(notificationsToAdd).execute()
notificationsToAdd.forEach((notification) => {
publish(
SubscriptionChannel.NOTIFICATION,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ const inviteToTeamHelper = async (
})
if (notificationsToInsert.length > 0) {
await r.table('Notification').insert(notificationsToInsert).run()
await pg.insertInto('Notification').values(notificationsToInsert).execute()
}

const bestMeeting = await getBestInvitationMeeting(teamId, meetingId ?? undefined, dataLoader)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ import {phaseLabelLookup} from 'parabol-client/utils/meetings/lookups'
import TeamPromptResponseId from '../../../../../client/shared/gqlIds/TeamPromptResponseId'
import {ErrorResponse, PostMessageResponse} from '../../../../../client/utils/SlackManager'
import appOrigin from '../../../../appOrigin'
import {RethinkSchema} from '../../../../database/rethinkDriver'
import SlackAuth from '../../../../database/types/SlackAuth'
import {SlackNotificationAuth} from '../../../../dataloader/integrationAuthLoaders'
import getKysely from '../../../../postgres/getKysely'
import {getTeamPromptResponsesByMeetingId} from '../../../../postgres/queries/getTeamPromptResponsesByMeetingIds'
import {SlackNotification, Team, TeamPromptResponse} from '../../../../postgres/types'
import User from '../../../../postgres/types/IUser'
import {AnyMeeting, MeetingTypeEnum} from '../../../../postgres/types/Meeting'
import {AnyNotification} from '../../../../postgres/types/Notification'
import SlackServerManager from '../../../../utils/SlackServerManager'
import {analytics} from '../../../../utils/analytics/analytics'
import {toEpochSeconds} from '../../../../utils/epochTime'
Expand Down Expand Up @@ -245,7 +245,7 @@ const addStandupResponsesToThread = async (

const getSlackMessageForNotification = async (
dataLoader: DataLoaderWorker,
notification: RethinkSchema['Notification']['type'],
notification: AnyNotification,
meeting: AnyMeeting,
userId: string
) => {
Expand Down Expand Up @@ -277,6 +277,7 @@ const getSlackMessageForNotification = async (
buttonText: 'See the discussion'
}
} else if (notification.type === 'RESPONSE_MENTIONED') {
// Notification Phase 3 do not split the responseId
const responseId = TeamPromptResponseId.split(notification.responseId)
const response = await dataLoader.get('teamPromptResponses').loadNonNull(responseId)
const author = await dataLoader.get('users').loadNonNull(response.userId)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import {ASSIGNEE, MENTIONEE} from 'parabol-client/utils/constants'
import getTypeFromEntityMap from 'parabol-client/utils/draftjs/getTypeFromEntityMap'
import getRethink from '../../../database/rethinkDriver'
import NotificationTaskInvolves from '../../../database/types/NotificationTaskInvolves'
import getKysely from '../../../postgres/getKysely'
import {Task} from '../../../postgres/types'
import {analytics} from '../../../utils/analytics/analytics'

Expand All @@ -11,6 +12,7 @@ const publishChangeNotifications = async (
changeUser: {id: string; email: string},
usersToIgnore: string[]
) => {
const pg = getKysely()
const r = await getRethink()
const changeAuthorId = `${changeUser.id}::${task.teamId}`
const {entityMap: oldEntityMap, blocks: oldBlocks} = JSON.parse(oldTask.content)
Expand Down Expand Up @@ -84,6 +86,7 @@ const publishChangeNotifications = async (
// update changes in the db
if (notificationsToAdd.length) {
await r.table('Notification').insert(notificationsToAdd).run()
await pg.insertInto('Notification').values(notificationsToAdd).execute()
}
return {notificationsToAdd}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ const removeTeamMember = async (
const notification = new NotificationKickedOut({teamId, userId, evictorUserId})
notificationId = notification.id
await r.table('Notification').insert(notification).run()
await pg.insertInto('Notification').values(notification).execute()
}

const archivedTaskIds = await archiveTasksForDB(integratedTasksToArchive)
Expand Down
19 changes: 15 additions & 4 deletions packages/server/graphql/mutations/moveTeamToOrg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ import adjustUserCount from '../../billing/helpers/adjustUserCount'
import getRethink from '../../database/rethinkDriver'
import {RDatum} from '../../database/stricterR'
import getKysely from '../../postgres/getKysely'
import updateMeetingTemplateOrgId from '../../postgres/queries/updateMeetingTemplateOrgId'
import updateTeamByTeamId from '../../postgres/queries/updateTeamByTeamId'
import safeArchiveEmptyStarterOrganization from '../../safeMutations/safeArchiveEmptyStarterOrganization'
import {Logger} from '../../utils/Logger'
import {getUserId, isSuperUser} from '../../utils/authorization'
Expand Down Expand Up @@ -96,8 +94,21 @@ const moveToOrg = async (
.filter((notification: RDatum) => notification('orgId').default(null).ne(null))
.update({orgId})
.run(),
updateMeetingTemplateOrgId(currentOrgId, orgId),
updateTeamByTeamId(updates, teamId)
pg
.with('NotificationUpdate', (qb) =>
qb
.updateTable('Notification')
.set({orgId})
.where('teamId', '=', teamId)
.where('orgId', 'is not', null)
)
.with('MeetingTemplateUpdate', (qb) =>
qb.updateTable('MeetingTemplate').set({orgId}).where('orgId', '=', currentOrgId)
)
.updateTable('Team')
.set(updates)
.where('id', '=', teamId)
.execute()
])
dataLoader.clearAll('teams')
// if no teams remain on the org, remove it
Expand Down
3 changes: 3 additions & 0 deletions packages/server/graphql/mutations/setNotificationStatus.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {GraphQLID, GraphQLNonNull, GraphQLObjectType} from 'graphql'
import {SubscriptionChannel} from 'parabol-client/types/constEnums'
import getRethink from '../../database/rethinkDriver'
import getKysely from '../../postgres/getKysely'
import {getUserId} from '../../utils/authorization'
import publish from '../../utils/publish'
import standardError from '../../utils/standardError'
Expand All @@ -27,6 +28,7 @@ export default {
{notificationId, status}: {notificationId: string; status: NotificationStatusEnumType},
{authToken, dataLoader, socketId: mutatorId}: GQLContext
) {
const pg = getKysely()
const r = await getRethink()
const operationId = dataLoader.share()
const subOptions = {mutatorId, operationId}
Expand All @@ -41,6 +43,7 @@ export default {

// RESOLUTION
await r.table('Notification').get(notificationId).update({status}).run()
await pg.updateTable('Notification').set({status}).where('id', '=', notificationId).execute()
// mutate dataloader cache
notification.status = status

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import MockDB from '../../../../__tests__/setup/MockDB'
import {__anHourAgo, __now, __overADayAgo} from '../../../../__tests__/setup/mockTimes'
import getRethink from '../../../../database/rethinkDriver'
import {sendBatchEmail} from '../../../../email/sendEmail'
import getKysely from '../../../../postgres/getKysely'
import sendBatchNotificationEmails from '../sendBatchNotificationEmails'

// Manage side-effects
Expand All @@ -20,6 +21,7 @@ describe('sendBatchNotificationEmails', () => {
// global DB state, there's no getting around this.
const r = await getRethink()
await r.table('Notification').delete()
await sql`TRUNCATE TABLE "Notification"`.execute(getKysely())
})

it('requires the superuser role', async () => {
Expand Down
2 changes: 2 additions & 0 deletions packages/server/graphql/private/mutations/runScheduledJobs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,10 @@ const processMeetingStageTimeLimits = async (
meetingId,
userId: facilitatorUserId!
})
const pg = getKysely()
const r = await getRethink()
await r.table('Notification').insert(notification).run()
await pg.insertInto('Notification').values(notification).execute()
publish(SubscriptionChannel.NOTIFICATION, facilitatorUserId!, 'MeetingStageTimeLimitPayload', {
notification
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import Stripe from 'stripe'
import terminateSubscription from '../../../billing/helpers/terminateSubscription'
import getRethink from '../../../database/rethinkDriver'
import NotificationPaymentRejected from '../../../database/types/NotificationPaymentRejected'
import getKysely from '../../../postgres/getKysely'
import {isSuperUser} from '../../../utils/authorization'
import publish from '../../../utils/publish'
import {getStripeManager} from '../../../utils/stripe'
Expand All @@ -25,6 +26,7 @@ const stripeFailPayment: MutationResolvers['stripeFailPayment'] = async (
throw new Error('Don’t be rude.')
}

const pg = getKysely()
const r = await getRethink()
const manager = getStripeManager()

Expand Down Expand Up @@ -103,6 +105,7 @@ const stripeFailPayment: MutationResolvers['stripeFailPayment'] = async (
await r({
insert: r.table('Notification').insert(notifications)
}).run()
await pg.insertInto('Notification').values(notifications).execute()

notifications.forEach((notification) => {
const data = {orgId, notificationId: notification.id}
Expand Down
3 changes: 3 additions & 0 deletions packages/server/graphql/public/mutations/addComment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ const addComment: MutationResolvers['addComment'] = async (
{comment},
{authToken, dataLoader, socketId: mutatorId}
) => {
const pg = getKysely()
const r = await getRethink()
const viewerId = getUserId(authToken)
const operationId = dataLoader.share()
Expand Down Expand Up @@ -130,6 +131,7 @@ const addComment: MutationResolvers['addComment'] = async (
})

await r.table('Notification').insert(notification).run()
await pg.insertInto('Notification').values(notification).execute()

IntegrationNotifier.sendNotificationToUser?.(dataLoader, notification.id, notification.userId)
publishNotification(notification, subOptions)
Expand All @@ -146,6 +148,7 @@ const addComment: MutationResolvers['addComment'] = async (

if (notificationsToAdd.length) {
await r.table('Notification').insert(notificationsToAdd).run()
await pg.insertInto('Notification').values(notificationsToAdd).execute()
notificationsToAdd.forEach((notification) => {
publishNotification(notification, subOptions)
})
Expand Down
Loading

0 comments on commit fd4c17d

Please sign in to comment.