Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Make meeting series naming consistent #9928

Merged
merged 6 commits into from
Jul 11, 2024

Conversation

Dschoordsch
Copy link
Contributor

@Dschoordsch Dschoordsch commented Jul 3, 2024

Fixes #9928

Make the meeting name a separate parameter so it can be used for the meeting, meeting series and gcal event. This makes everything more consistent.

Demo

https://www.loom.com/share/63b49765c63b4575a59838ab4fc8a402?sid=5fd46150-274e-4b70-baad-08d12521516a

Testing scenarios

[Please list all the testing scenarios a reviewer has to check before approving the PR]

  • Scenario A

    • Step 1
    • Step 2...
  • Scenario B

    • Step 1
    • Step 2....

Final checklist

  • I checked the code review guidelines
  • I have added Metrics Representative as reviewer(s) if my PR invovles metrics/data/analytics related changes
  • I have performed a self-review of my code, the same way I'd do it for any other team member
  • I have tested all cases I listed in the testing scenarios and I haven't found any issues or regressions
  • Whenever I took a non-obvious choice I added a comment explaining why I did it this way
  • I added the label Skip Maintainer Review Indicating the PR only requires reviewer review and can be merged right after it's approved if the PR introduces only minor changes, does not contain any architectural changes or does not introduce any new patterns and I think one review is sufficient'
  • PR title is human readable and could be used in changelog

Summary by CodeRabbit

  • New Features

    • Introduced name and rrule parameters for scheduling and starting activities.
    • Added a function to calculate the count of meetings based on team ID and meeting type.
  • Refactor

    • Replaced RecurrenceSettingsInput with name and rrule parameters across various components and mutations.
    • Simplified the structure of recurrence settings in updates and mutations.
    • Adjusted imports and function signatures accordingly.
  • Bug Fixes

Make the meeting name a separate parameter so it can be used for the
meeting, meeting series and gcal event. This makes everything more
consistent.
@Dschoordsch Dschoordsch marked this pull request as draft July 3, 2024 16:56
@github-actions github-actions bot added the size/m label Jul 3, 2024
@Dschoordsch Dschoordsch marked this pull request as ready for review July 4, 2024 18:48
Copy link
Contributor

coderabbitai bot commented Jul 4, 2024

Walkthrough

The changes across multiple files focus on simplifying the handling of recurrence settings by removing the RecurrenceSettingsInput type and directly using name and rrule parameters. This modification affects various components, mutations, and tests by updating the function signatures and parameters to reflect this new approach.

Changes

Files Change Summary
…/ActivityLibrary/ActivityDetailsSidebar.tsx, …/ActivityLibrary/ScheduleMeetingButton.tsx Updated the handleStartActivity function to accept name and rrule instead of RecurrenceSettingsInput.
…/Recurrence/EndRecurringMeetingModal.tsx, …/Recurrence/UpdateRecurrenceSettingsModal.tsx Modified the structure of UpdateRecurrenceSettingsMutation to directly pass name and rrule instead of recurrenceSettings object.
…/ScheduleDialog.tsx Changed the onStartActivity function signature to use name, rrule, and gcalInput directly.
…/mutations/StartRetrospectiveMutation.ts, …/mutations/StartTeamPromptMutation.ts Updated mutation parameters to replace recurrenceSettings with name and rrule.
…/mutations/UpdateRecurrenceSettingsMutation.ts Changed the mutation function's signature to use name and rrule instead of recurrenceSettings.
…/__tests__/startRetrospective.test.ts Updated mutation parameters in tests and added a test for naming a single retro. Changed the default name for retrospectives.
…/graphql/public/types/CreateGcalEventInput.ts Removed the title field from the CreateGcalEventInput GraphQL input object type.
…/dataloader/customLoaderMakers.ts Added a new exported function meetingCount to calculate the count of meetings based on team ID and meeting type.
…/graphql/mutations/helpers/safeCreateRetrospective.ts, …/graphql/public/mutations/startRetrospective.ts Required the name parameter and adjusted the logic for generating meeting names. Updated resolver to accept name, rrule, and gcalInput parameters, fetching additional data concurrently and modifying parameters for meeting creation and Google Calendar event handling.

Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 0fb3d7e and 00cd524.

Files selected for processing (6)
  • packages/client/components/ActivityLibrary/ScheduleMeetingButton.tsx (3 hunks)
  • packages/client/components/Recurrence/RecurrenceSettings.tsx (1 hunks)
  • packages/client/components/ScheduleDialog.tsx (4 hunks)
  • packages/server/dataloader/customLoaderMakers.ts (1 hunks)
  • packages/server/graphql/mutations/helpers/safeCreateRetrospective.ts (3 hunks)
  • packages/server/graphql/public/mutations/startRetrospective.ts (6 hunks)
Files skipped from review as they are similar to previous changes (2)
  • packages/client/components/ActivityLibrary/ScheduleMeetingButton.tsx
  • packages/server/graphql/public/mutations/startRetrospective.ts
Additional context used
Learnings (1)
packages/server/graphql/mutations/helpers/safeCreateRetrospective.ts (1)
Learnt from: Dschoordsch
PR: ParabolInc/parabol#9928
File: packages/server/graphql/mutations/helpers/safeCreateRetrospective.ts:19-19
Timestamp: 2024-07-08T08:50:33.211Z
Learning: When verifying the presence of parameters in function calls, ensure to use a sufficiently large context size to capture the complete function call.
Additional comments not posted (4)
packages/client/components/ScheduleDialog.tsx (2)

34-34: Update the onStartActivity function signature.

The function signature now includes name and rrule. Ensure that these parameters are correctly handled in the function implementation.


101-117: Verify the construction and validation of name.

The handleSubmit function constructs the name variable and validates it before passing it to onStartActivity. Ensure that name is correctly validated and propagated.

packages/client/components/Recurrence/RecurrenceSettings.tsx (1)

258-258: Verify the display of the next meeting name.

The title parameter is used to show the next meeting name in the description. Ensure that the title is correctly handled and displayed.

packages/server/dataloader/customLoaderMakers.ts (1)

862-884: Ensure proper implementation and usage of meetingCount.

The meetingCount function calculates the count of meetings based on team ID and meeting type. Ensure that the function is correctly implemented and used. Consider adding error handling and logging if necessary.


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@@ -889,3 +889,27 @@ export const fileStoreAsset = (parent: RootDataLoader) => {
}
)
}

export const meetingCount = (parent: RootDataLoader) => {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's used in multiple nested calls now and instead of passing the count around, I opted to just add it to the dataloader.

@@ -32,7 +32,7 @@ export default class MeetingAction extends Meeting {
phases,
facilitatorUserId,
meetingType: 'action',
name: name ?? `Check-in #${meetingCount + 1}`
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think naming an instance is not part of the data type, but belongs into the mutation, so I moved it out consistently.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 6

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 4663e9e and f291efa.

Files selected for processing (26)
  • packages/client/components/ActivityLibrary/ActivityDetailsSidebar.tsx (3 hunks)
  • packages/client/components/ActivityLibrary/ScheduleMeetingButton.tsx (3 hunks)
  • packages/client/components/Recurrence/EndRecurringMeetingModal.tsx (1 hunks)
  • packages/client/components/Recurrence/UpdateRecurrenceSettingsModal.tsx (2 hunks)
  • packages/client/components/ScheduleDialog.tsx (5 hunks)
  • packages/client/mutations/StartRetrospectiveMutation.ts (1 hunks)
  • packages/client/mutations/StartTeamPromptMutation.ts (1 hunks)
  • packages/client/mutations/UpdateRecurrenceSettingsMutation.ts (1 hunks)
  • packages/server/tests/startRetrospective.test.ts (4 hunks)
  • packages/server/database/types/MeetingAction.ts (2 hunks)
  • packages/server/database/types/MeetingPoker.ts (2 hunks)
  • packages/server/dataloader/customLoaderMakers.ts (1 hunks)
  • packages/server/graphql/mutations/helpers/createGcalEvent.ts (5 hunks)
  • packages/server/graphql/mutations/helpers/safeCreateRetrospective.ts (2 hunks)
  • packages/server/graphql/mutations/startSprintPoker.ts (4 hunks)
  • packages/server/graphql/public/mutations/startCheckIn.ts (3 hunks)
  • packages/server/graphql/public/mutations/startRetrospective.ts (6 hunks)
  • packages/server/graphql/public/mutations/startTeamPrompt.ts (3 hunks)
  • packages/server/graphql/public/mutations/updateRecurrenceSettings.ts (2 hunks)
  • packages/server/graphql/public/typeDefs/CreateGcalEventInput.graphql (1 hunks)
  • packages/server/graphql/public/typeDefs/_legacy.graphql (1 hunks)
  • packages/server/graphql/public/typeDefs/startCheckIn.graphql (1 hunks)
  • packages/server/graphql/public/typeDefs/startRetrospective.graphql (2 hunks)
  • packages/server/graphql/public/typeDefs/startTeamPrompt.graphql (2 hunks)
  • packages/server/graphql/public/typeDefs/updateRecurrenceSettings.graphql (1 hunks)
  • packages/server/graphql/public/types/CreateGcalEventInput.ts (2 hunks)
Files skipped from review due to trivial changes (2)
  • packages/client/mutations/StartRetrospectiveMutation.ts
  • packages/server/graphql/public/typeDefs/CreateGcalEventInput.graphql
Additional context used
Biome
packages/server/graphql/public/types/CreateGcalEventInput.ts

[error] 39-39: Shouldn't redeclare 'GcalVideoTypeEnum'. Consider to delete it or rename it.

'GcalVideoTypeEnum' is defined here:

(lint/suspicious/noRedeclare)

Additional comments not posted (58)
packages/server/graphql/public/typeDefs/startCheckIn.graphql (1)

23-25: Ensure the new parameter name is handled correctly.

The name parameter has been added to the startCheckIn mutation. Ensure that the corresponding resolver and related code handle this parameter correctly.

Verification successful

The new parameter name is handled correctly.

The name parameter in the startCheckIn mutation is properly destructured from the input, assigned a default value if not provided, and used in the meeting object.

  • packages/server/graphql/public/mutations/startCheckIn.ts
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the resolver and related code handle the new `name` parameter correctly.

# Test: Search for the resolver implementation. Expect: The resolver should handle the `name` parameter.
rg --type js --type ts $'startCheckIn'

Length of output: 536


Script:

#!/bin/bash
# Description: Verify the handling of the `name` parameter in the startCheckIn resolver.

# Search for the usage of the `name` parameter in the startCheckIn resolver file.
rg 'name' packages/server/graphql/public/mutations/startCheckIn.ts

Length of output: 170

packages/server/graphql/public/typeDefs/startRetrospective.graphql (2)

11-13: Ensure the new parameter name is handled correctly.

The name parameter has been added to the startRetrospective mutation. Ensure that the corresponding resolver and related code handle this parameter correctly.

Verification successful

The name parameter is handled correctly.

The resolver implementation, test cases, and client-side mutation all correctly handle the name parameter.

  • packages/server/graphql/public/mutations/startRetrospective.ts: Resolver implementation includes the name parameter.
  • packages/server/__tests__/startRetrospective.test.ts: Test cases verify the correct naming of the meeting.
  • packages/server/__tests__/disableAnonymity.test.ts: The mutation call is valid without the name parameter as it is optional.
  • packages/client/mutations/StartRetrospectiveMutation.ts: Client-side mutation includes and correctly passes the name parameter.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the resolver and related code handle the new `name` parameter correctly.

# Test: Search for the resolver implementation. Expect: The resolver should handle the `name` parameter.
rg --type js --type ts $'startRetrospective'

Length of output: 1317


Script:

#!/bin/bash
# Extract the resolver implementation for startRetrospective
echo "Resolver implementation in startRetrospective.ts:"
rg --type js --type ts --context 10 'startRetrospective' packages/server/graphql/public/mutations/startRetrospective.ts

# Extract test cases involving startRetrospective in startRetrospective.test.ts
echo -e "\nTest cases in startRetrospective.test.ts:"
rg --type js --type ts --context 10 'startRetrospective' packages/server/__tests__/startRetrospective.test.ts

# Extract test cases involving startRetrospective in disableAnonymity.test.ts
echo -e "\nTest cases in disableAnonymity.test.ts:"
rg --type js --type ts --context 10 'startRetrospective' packages/server/__tests__/disableAnonymity.test.ts

# Extract client-side mutation handling in StartRetrospectiveMutation.ts
echo -e "\nClient-side mutation handling in StartRetrospectiveMutation.ts:"
rg --type js --type ts --context 10 'startRetrospective' packages/client/mutations/StartRetrospectiveMutation.ts

Length of output: 6508


15-17: Ensure the new parameter rrule is handled correctly.

The rrule parameter has been added to the startRetrospective mutation. Ensure that the corresponding resolver and related code handle this parameter correctly.

Verification successful

The rrule parameter is handled correctly.

The startRetrospective resolver function in packages/server/graphql/public/mutations/startRetrospective.ts includes the rrule parameter. It is utilized in several places within the function, such as in the createMeetingSeriesTitle and startNewMeetingSeries calls, and is also passed to the createGcalEvent function. Additionally, there are relevant test cases that include the rrule parameter, ensuring its functionality is verified.

  • startRetrospective function handling rrule:

    • createMeetingSeriesTitle
    • startNewMeetingSeries
    • createGcalEvent
  • Test files:

    • packages/server/__tests__/startRetrospective.test.ts
    • packages/server/__tests__/processRecurrence.test.ts
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the resolver and related code handle the new `rrule` parameter correctly.

# Test: Search for the resolver implementation. Expect: The resolver should handle the `rrule` parameter.
rg --type js --type ts $'startRetrospective'

Length of output: 1317


Script:

#!/bin/bash
# Extract the function body of `startRetrospective` from the resolver file
ast-grep --lang typescript --pattern $'const startRetrospective: MutationResolvers[\'startRetrospective\'] = async ($_$$$) => {
  $$$
}' --json

# Check for the usage of the `rrule` parameter within the `startRetrospective` function
rg --type js --type ts 'rrule' packages/server/graphql/public/mutations/startRetrospective.ts

# Verify the presence of tests that include the `rrule` parameter
rg --type js --type ts 'rrule' packages/server/__tests__/

Length of output: 1823


Script:

#!/bin/bash
# Correct the `ast-grep` pattern to accurately extract the `startRetrospective` function body
ast-grep --lang typescript --pattern $'const startRetrospective: MutationResolvers[\'startRetrospective\'] = async ($$$) => {
  $$$
}' packages/server/graphql/public/mutations/startRetrospective.ts --json

Length of output: 8761

packages/server/graphql/public/typeDefs/startTeamPrompt.graphql (2)

15-17: Ensure the new parameter rrule is handled correctly.

The rrule parameter has been added to the startTeamPrompt mutation. Ensure that the corresponding resolver and related code handle this parameter correctly.

Verification successful

Verified: The rrule parameter is handled correctly in the startTeamPrompt resolver.

The rrule parameter is extracted and used appropriately within the resolver function, ensuring it is processed as expected.

  • startTeamPrompt resolver in packages/server/graphql/public/mutations/startTeamPrompt.ts
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the resolver and related code handle the new `rrule` parameter correctly.

# Test: Search for the resolver implementation. Expect: The resolver should handle the `rrule` parameter.
rg --type js --type ts $'startTeamPrompt'

Length of output: 600


Script:

#!/bin/bash
# Description: Verify the `rrule` parameter is handled in the `startTeamPrompt` resolver.

# Extract the function body of the `startTeamPrompt` resolver to inspect the handling of `rrule`
ast-grep --lang typescript --pattern $'const startTeamPrompt: MutationResolvers[\'startTeamPrompt\'] = async ($_args) => {
  $$$
}' --json

Length of output: 146


Script:

#!/bin/bash
# Description: Extract the content of the `startTeamPrompt` resolver to verify the handling of the `rrule` parameter.

# Display the content of the `startTeamPrompt` resolver file
cat packages/server/graphql/public/mutations/startTeamPrompt.ts

Length of output: 3364


11-13: Ensure the new parameter name is handled correctly.

The name parameter has been added to the startTeamPrompt mutation. Ensure that the corresponding resolver and related code handle this parameter correctly.

Verification successful

The name parameter is handled correctly in the startTeamPrompt resolver.

The resolver implementation includes the name parameter in its function signature and appropriately uses it within the function body.

  • packages/server/graphql/public/mutations/startTeamPrompt.ts
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the resolver and related code handle the new `name` parameter correctly.

# Test: Search for the resolver implementation. Expect: The resolver should handle the `name` parameter.
rg --type js --type ts $'startTeamPrompt'

Length of output: 600


Script:

#!/bin/bash
# Description: Verify the handling of the `name` parameter in the `startTeamPrompt` resolver implementation.

# Extract the resolver implementation for `startTeamPrompt`
ast-grep --lang typescript --pattern $'const startTeamPrompt: MutationResolvers[\'startTeamPrompt\'] = async ($_)' --json

Length of output: 129


Script:

#!/bin/bash
# Description: Extract the `startTeamPrompt` resolver implementation to verify the handling of the `name` parameter.

# Extract lines around the definition of the `startTeamPrompt` resolver
rg --context 10 'const startTeamPrompt: MutationResolvers' packages/server/graphql/public/mutations/startTeamPrompt.ts

Length of output: 1028


Script:

#!/bin/bash
# Description: Extract more lines from the `startTeamPrompt` resolver implementation to verify the handling of the `name` parameter.

# Extract additional lines from the `startTeamPrompt` resolver implementation
rg --context 50 'const startTeamPrompt: MutationResolvers' packages/server/graphql/public/mutations/startTeamPrompt.ts

Length of output: 2956

packages/server/database/types/MeetingAction.ts (2)

35-35: Ensure the name field is correctly passed to the superclass.

The name field has been added to the constructor of the MeetingAction class and is passed to the superclass. Ensure that the superclass handles the name field correctly.

Verification successful

The superclass Meeting handles the name field correctly.

  • The Meeting class has a constructor that assigns the name field using the statement this.name = name ?? ....
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the superclass handles the `name` field correctly.

# Test: Search for the superclass implementation. Expect: The superclass should handle the `name` field.
rg --type ts $'class Meeting'

Length of output: 1378


Script:

#!/bin/bash
# Description: Extract the constructor of the `Meeting` class to verify if it handles the `name` field correctly.

# Extract the constructor of the `Meeting` class from the specified file.
ast-grep --lang typescript --pattern $'class Meeting {
  constructor($_) {
    $$$
  }
}' packages/server/database/types/Meeting.ts

Length of output: 132


Script:

#!/bin/bash
# Description: Verify if the `Meeting` class handles the `name` field correctly.

# Search for the constructor and the `name` field in the `Meeting.ts` file.
rg 'constructor' packages/server/database/types/Meeting.ts
rg 'name' packages/server/database/types/Meeting.ts

Length of output: 280


12-12: Ensure the name field is correctly handled.

The name field has been made required in the Input interface. Ensure that all instances where Input is used handle the name field correctly.

Verification successful

The name field is correctly handled.

The name field in the Input interface for MeetingAction is properly managed across various parts of the codebase. The field is consistently passed, assigned, and utilized, ensuring its correct handling.

  • packages/server/graphql/public/mutations/startCheckIn.ts
  • packages/server/graphql/mutations/helpers/notifications/MSTeamsNotifier.ts
  • packages/server/database/types/MeetingAction.ts
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all instances where `Input` is used handle the `name` field correctly.

# Test: Search for instances of `Input`. Expect: All instances should handle the `name` field.
rg --type ts $'Input'

Length of output: 116872


Script:

#!/bin/bash
# Description: Verify the handling of the `name` field in the `Input` interface specific to `MeetingAction`.

# Step 1: Find the definition of the `Input` interface in `MeetingAction.ts`.
rg --type ts 'interface Input' -g '**/MeetingAction.ts'

# Step 2: Search for usage of the `Input` interface from `MeetingAction.ts`.
rg --type ts 'MeetingAction.Input'

Length of output: 158


Script:

#!/bin/bash
# Description: Verify the handling of the `name` field in the `Input` interface specific to `MeetingAction`.

# Step 1: Search for the usage of the `Input` interface within the `MeetingAction.ts` file.
rg --type ts 'Input' packages/server/database/types/MeetingAction.ts

# Step 2: Find files that import `MeetingAction` to check for usage of the `Input` interface.
rg --type ts 'MeetingAction' -l

Length of output: 866


Script:

#!/bin/bash
# Description: Verify the handling of the `name` field in the `Input` interface specific to `MeetingAction`.

# Step 1: Search for the usage of `MeetingAction` in the identified files.
rg --type ts 'MeetingAction' packages/server/postgres/types/Meeting.d.ts packages/client/components/NewMeetingActionsCurrentMeetings.tsx packages/client/components/NewMeetingActions.tsx packages/client/components/ActivityLibrary/ActivityDetailsSidebar.tsx packages/server/graphql/public/types/StartCheckInSuccess.ts packages/server/graphql/meetingTypePredicates.ts packages/server/graphql/mutations/helpers/notifications/getSummaryText.ts packages/server/graphql/mutations/helpers/notifications/MSTeamsNotifier.ts packages/server/graphql/mutations/helpers/addAgendaItemToActiveActionMeeting.ts packages/server/graphql/public/mutations/startCheckIn.ts packages/server/graphql/mutations/endCheckIn.ts packages/server/database/types/MeetingAction.ts

# Step 2: Verify how the `name` field is handled in the usage of `MeetingAction`.
rg --type ts 'name' packages/server/postgres/types/Meeting.d.ts packages/client/components/NewMeetingActionsCurrentMeetings.tsx packages/client/components/NewMeetingActions.tsx packages/client/components/ActivityLibrary/ActivityDetailsSidebar.tsx packages/server/graphql/public/types/StartCheckInSuccess.ts packages/server/graphql/meetingTypePredicates.ts packages/server/graphql/mutations/helpers/notifications/getSummaryText.ts packages/server/graphql/mutations/helpers/notifications/MSTeamsNotifier.ts packages/server/graphql/mutations/helpers/addAgendaItemToActiveActionMeeting.ts packages/server/graphql/public/mutations/startCheckIn.ts packages/server/graphql/mutations/endCheckIn.ts packages/server/database/types/MeetingAction.ts

Length of output: 11481

packages/server/graphql/public/typeDefs/updateRecurrenceSettings.graphql (2)

15-18: LGTM! The addition of name parameter is correct.

The description and type for the name parameter are appropriate.


20-22: LGTM! The addition of rrule parameter is correct.

The description and type for the rrule parameter are appropriate.

packages/server/database/types/MeetingPoker.ts (2)

11-11: LGTM! The name field is now required.

This change ensures that the meeting name is always provided, aligning with the PR objectives.


38-38: LGTM! The name parameter is correctly included in the constructor.

This change ensures that the meeting name is always provided and assigned to the superclass.

packages/client/mutations/UpdateRecurrenceSettingsMutation.ts (1)

24-25: LGTM! The name and rrule parameters are correctly included in the mutation.

The parameters are correctly defined and included in the GraphQL query, aligning with the PR objectives.

packages/server/graphql/mutations/helpers/safeCreateRetrospective.ts (2)

50-50: LGTM!

The changes look good to me.


27-27: Verify data loader key meetingCount.

Ensure that the key meetingCount is correctly defined in the data loader.

Verification successful

Data loader key meetingCount is correctly defined.

The meetingCount key is defined in the data loader within the packages/server/dataloader/customLoaderMakers.ts file. The implementation uses DataLoader to fetch the count of meetings by teamId and meetingType, ensuring that the key is correctly set up for the intended functionality.

  • File: packages/server/dataloader/customLoaderMakers.ts
  • Definition:
    export const meetingCount = (parent: RootDataLoader) => {
      return new DataLoader<{teamId: string; meetingType: MeetingTypeEnum}, number, string>(
        async (keys) => {
          const r = await getRethink()
          const res = await Promise.all(
            keys.map(async ({teamId, meetingType}) => {
              return r
                .table('NewMeeting')
                .getAll(teamId, {index: 'teamId'})
                .filter({meetingType: meetingType as any})
                .count()
                .default(0)
                .run()
            })
          )
          return res
        },
        {
          ...parent.dataLoaderOptions,
          cacheKeyFn: (key) => `${key.teamId}:${key.meetingType}`
        }
      )
    }
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the presence of `meetingCount` key in the data loader.

# Test: Search for the definition of `meetingCount` in the codebase. Expect: Key is correctly defined.
rg --type js --type ts $'meetingCount'

Length of output: 6162


Script:

#!/bin/bash
# Display the content of the customLoaderMakers.ts file to verify the definition of `meetingCount`.

# Find and display the content of `customLoaderMakers.ts`
fd customLoaderMakers.ts --exec cat

Length of output: 29524

packages/client/mutations/StartTeamPromptMutation.ts (2)

26-26: LGTM!

The changes look good to me.


22-23: Ensure name and rrule are correctly passed.

The mutation now requires name and rrule parameters. Verify that all calls to StartTeamPromptMutation provide these parameters.

Verification successful

All calls to StartTeamPromptMutation correctly provide the name and rrule parameters.

  • In the file packages/client/components/ActivityLibrary/ActivityDetailsSidebar.tsx, the StartTeamPromptMutation invocation includes name and rrule.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all calls to `StartTeamPromptMutation` provide the `name` and `rrule` parameters.

# Test: Search for the function usage. Expect: All calls include the `name` and `rrule` parameters.
rg --type js --type ts $'StartTeamPromptMutation'

Length of output: 1942


Script:

#!/bin/bash
# Description: Verify that all calls to `StartTeamPromptMutation` provide the `name` and `rrule` parameters.

# Extract lines where StartTeamPromptMutation is invoked and check for parameters
rg --type js --type ts 'StartTeamPromptMutation\(' -A 3

Length of output: 737


Script:

#!/bin/bash
# Description: Verify that all calls to `StartTeamPromptMutation` provide the `name` and `rrule` parameters.

# Extract more lines around the StartTeamPromptMutation invocation in ActivityDetailsSidebar.tsx
rg --type ts 'StartTeamPromptMutation\(' -A 10 -B 2 packages/client/components/ActivityLibrary/ActivityDetailsSidebar.tsx

Length of output: 440

packages/server/__tests__/startRetrospective.test.ts (3)

37-37: LGTM!

The changes look good to me.


52-53: Ensure test coverage for name and rrule.

The mutation now requires name and rrule parameters. Verify that the test cases cover these parameters adequately.


70-71: LGTM!

The changes look good to me.

packages/client/components/ActivityLibrary/ScheduleMeetingButton.tsx (2)

63-64: LGTM!

The changes look good to me.


4-4: Import RRule from rrule.

Ensure that the RRule import from the rrule library is correctly used.

Verification successful

Import RRule from rrule.

The import and usage of RRule from the rrule library in the ScheduleMeetingButton.tsx file are correct.

  • The import statement is correctly placed.
  • The RRule type is used appropriately in the handleStartActivity and onStartActivity functions.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the usage of `RRule` from the `rrule` library.

# Test: Search for the usage of `RRule`. Expect: Correct usage of `RRule`.
rg --type js --type ts $'RRule'

Length of output: 15097


Script:

#!/bin/bash
# Extract the contents of the ScheduleMeetingButton.tsx file to verify the usage of RRule
cat packages/client/components/ActivityLibrary/ScheduleMeetingButton.tsx

Length of output: 2671

packages/server/graphql/public/mutations/startTeamPrompt.ts (4)

21-21: Ensure name and rrule are validated.

While the changes are correct, consider validating name and rrule to ensure they meet expected formats.


49-50: Consider handling missing name and rrule.

The current logic defaults name to 'Standup' if rrule is present but name is not. Ensure this behavior is intended and documented.


64-65: Ensure startNewMeetingSeries handles name and rrule correctly.

Verify that startNewMeetingSeries correctly processes the name and rrule parameters.


72-79: Verify createGcalEvent handles new parameters.

Ensure that createGcalEvent correctly processes the name and gcalInput parameters.

packages/server/graphql/public/mutations/startCheckIn.ts (3)

20-20: Ensure name is validated.

While the changes are correct, consider validating name to ensure it meets expected formats.


62-62: Ensure default name logic is intended.

The current logic defaults name to Check-in #${meetingCount + 1} if name is not provided. Ensure this behavior is intended and documented.


96-103: Verify createGcalEvent handles new parameters.

Ensure that createGcalEvent correctly processes the name and gcalInput parameters.

packages/client/components/Recurrence/EndRecurringMeetingModal.tsx (1)

89-89: Ensure name and rrule are validated.

While the changes are correct, consider validating name and rrule to ensure they meet expected formats.

packages/server/graphql/public/mutations/startRetrospective.ts (4)

23-23: Ensure name and rrule are validated.

While the changes are correct, consider validating name and rrule to ensure they meet expected formats.


57-61: Consider handling missing name and rrule.

The current logic sets a default name if name is not provided and handles rrule accordingly. Ensure this behavior is intended and documented.


100-100: Ensure startNewMeetingSeries handles name and rrule correctly.

Verify that startNewMeetingSeries correctly processes the name and rrule parameters.


126-131: Verify createGcalEvent handles new parameters.

Ensure that createGcalEvent correctly processes the name, gcalInput, and rrule parameters.

packages/server/graphql/mutations/helpers/createGcalEvent.ts (7)

27-27: Review: Added name field to Input type.

The name field is now required for creating Google Calendar events. Ensure this field is always provided when calling this function.


39-39: Review: Destructuring name from input.

The function now correctly destructures name from the input object.


44-44: Review: Using name in event input.

The event summary is now set to the name field, ensuring the event has a meaningful title.


119-119: Review: Added name field to UpdateGcalSeriesInput type.

The name field is now optional for updating Google Calendar series events. Ensure this field is correctly managed when updating events.


126-126: Review: Destructuring name from input in updateGcalSeries.

The function now correctly destructures name from the input object for updating Google Calendar series events.


Line range hint 163-163:
Review: Updating Google Calendar series with new name and rrule.

The update function now correctly uses the new name and rrule values for updating the event series.


Line range hint 166-167:
Review: Passing name and rrule to updateGcalSeries.

The function now correctly passes the name and rrule to the updateGcalSeries function.

packages/server/graphql/public/mutations/updateRecurrenceSettings.ts (7)

127-127: Review: Updated updateRecurrenceSettings mutation signature.

The mutation now accepts name and rrule parameters directly, ensuring consistency with the new approach.


155-155: Review: Handling case when rrule is not provided.

The function now stops the meeting series if rrule is not provided.


159-159: Review: Updating meeting series with new rrule.

The function now updates the meeting series with the new rrule when provided.


163-167: Review: Updating Google Calendar series with new name and rrule.

The mutation now correctly updates the Google Calendar series with the new name and rrule.


174-175: Review: Updating meeting series title with new name.

The mutation now updates the meeting series title with the new name when provided.


180-180: Review: Returning error when rrule is not provided for non-recurring meetings.

The mutation now correctly returns an error if rrule is not provided for non-recurring meetings.


187-187: Review: Starting new meeting series with name and rrule.

The mutation now starts a new meeting series with the provided name and rrule.

packages/client/components/Recurrence/UpdateRecurrenceSettingsModal.tsx (2)

178-179: Review: Passing name and rrule to UpdateRecurrenceSettingsMutation.

The component now correctly passes the name and rrule to the UpdateRecurrenceSettingsMutation.


191-191: Review: Stopping recurrence by passing null for rrule.

The component now correctly stops the recurrence by passing null for rrule.

packages/server/graphql/mutations/startSprintPoker.ts (5)

1-1: Review: Added name argument to startSprintPoker mutation.

The mutation now accepts a name argument for naming the sprint poker meeting.


77-80: Review: Added name argument to mutation arguments.

The mutation arguments now include name, allowing the client to specify the meeting name.


88-92: Review: Destructuring name from mutation arguments.

The mutation now correctly destructures name from the arguments.


139-139: Review: Using name for meeting name.

The meeting name is now set to the provided name or a default value if not provided.


187-194: Review: Passing name to createGcalEvent.

The mutation now correctly passes name to the createGcalEvent function, ensuring the Google Calendar event is named appropriately.

packages/client/components/ScheduleDialog.tsx (2)

34-34: Ensure correct usage of updated onStartActivity prop.

The onStartActivity prop now accepts name and rrule parameters. Verify that all calls to this prop in the codebase are updated accordingly.

Verification successful

Verified onStartActivity prop usage.

The onStartActivity prop has been updated to accept name and rrule parameters, and all relevant calls in the codebase have been updated accordingly.

  • packages/client/components/ScheduleDialog.tsx
  • packages/client/components/ActivityLibrary/ScheduleMeetingButton.tsx
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all calls to `onStartActivity` prop are updated to use `name` and `rrule`.

# Test: Search for the prop usage. Expect: Only occurances of the new signature.
rg --type tsx $'onStartActivity'

Length of output: 59


Script:

#!/bin/bash
# Description: Verify all calls to `onStartActivity` prop are updated to use `name` and `rrule`.

# Test: Search for the prop usage. Expect: Only occurrences of the new signature.
rg 'onStartActivity' --glob '**/*.tsx'

Length of output: 570


201-205: Ensure correct usage of updated RecurrenceSettings component.

The RecurrenceSettings component now uses title and rrule parameters. Verify that all instances of this component in the codebase are updated accordingly.

packages/client/components/ActivityLibrary/ActivityDetailsSidebar.tsx (1)

125-126: LGTM! But ensure the function calls are updated.

The code changes are approved.

However, ensure that all function calls to StartTeamPromptMutation and StartRetrospectiveMutation match the new signature.

Also applies to: 149-150

Verification successful

Function calls match the new signature.

The function calls to StartTeamPromptMutation and StartRetrospectiveMutation in ActivityDetailsSidebar.tsx have been verified and they match the new signature.

  • packages/client/components/ActivityLibrary/ActivityDetailsSidebar.tsx
    • StartTeamPromptMutation(atmosphere, { teamId: selectedTeam.id, name, rrule: rrule?.toString(), })
    • StartRetrospectiveMutation(atmosphere, { teamId: selectedTeam.id, name, rrule: rrule?.toString(), })
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `StartTeamPromptMutation` and `StartRetrospectiveMutation` match the new signature.

# Test: Search for the function usage. Expect: Only occurances of the new signature.
rg --type ts $'StartTeamPromptMutation'
rg --type ts $'StartRetrospectiveMutation'

Length of output: 4377


Script:

#!/bin/bash
# Extract function definitions and usages for StartTeamPromptMutation and StartRetrospectiveMutation in relevant files

# Extract function definitions and usages for StartTeamPromptMutation
echo "StartTeamPromptMutation Definitions and Usages:"
rg 'StartTeamPromptMutation' packages/client/components/ActivityLibrary/ActivityDetailsSidebar.tsx
rg 'StartTeamPromptMutation' packages/client/mutations/StartTeamPromptMutation.ts

# Extract function definitions and usages for StartRetrospectiveMutation
echo "StartRetrospectiveMutation Definitions and Usages:"
rg 'StartRetrospectiveMutation' packages/client/components/ActivityLibrary/ActivityDetailsSidebar.tsx
rg 'StartRetrospectiveMutation' packages/client/mutations/StartRetrospectiveMutation.ts

Length of output: 1882


Script:

#!/bin/bash
# Extract function call details for StartTeamPromptMutation and StartRetrospectiveMutation in ActivityDetailsSidebar.tsx

# Extract function call details for StartTeamPromptMutation
echo "StartTeamPromptMutation Call Details:"
rg -A 5 'StartTeamPromptMutation\(' packages/client/components/ActivityLibrary/ActivityDetailsSidebar.tsx

# Extract function call details for StartRetrospectiveMutation
echo "StartRetrospectiveMutation Call Details:"
rg -A 5 'StartRetrospectiveMutation\(' packages/client/components/ActivityLibrary/ActivityDetailsSidebar.tsx

Length of output: 741

packages/server/graphql/public/typeDefs/_legacy.graphql (1)

5854-5856: Ensure the new name field is correctly integrated.

The new name field in the StartSprintPoker mutation should be consistent with the rest of the schema and correctly integrated into the resolver logic.

Verification successful

The new name field is correctly integrated.

The name field has been added to the StartSprintPoker mutation's arguments and is used appropriately within the resolver logic and payload structures.

  • The field is added to the arguments in startSprintPoker.ts.
  • The field is used in the createGcalEvent function call.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify that the new `name` field is integrated into the resolver logic for `StartSprintPoker`.

# Test: Search for the usage and resolver implementation of `StartSprintPoker`.
rg --type graphql --pattern 'StartSprintPoker'

Length of output: 458


Script:

#!/bin/bash
# Description: Verify that the new `name` field is integrated into the resolver logic for `StartSprintPoker`.

# Test: Search for the usage and resolver implementation of `StartSprintPoker`.
rg 'StartSprintPoker'

Length of output: 2881


Script:

#!/bin/bash
# Description: Extract and review the resolver logic for `StartSprintPoker` and its payload structures.

# Extract the resolver logic for `StartSprintPoker`.
echo "Resolver logic in startSprintPoker.ts:"
rg --context 10 'StartSprintPoker' packages/server/graphql/mutations/startSprintPoker.ts

# Extract the payload structures for `StartSprintPoker`.
echo "Payload structures in StartSprintPokerPayload.ts:"
rg --context 10 'StartSprintPoker' packages/server/graphql/types/StartSprintPokerPayload.ts

Length of output: 3746

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Outside diff range, codebase verification and nitpick comments (1)
packages/server/graphql/mutations/helpers/safeCreateRetrospective.ts (1)

18-18: Missing name parameter in calls to safeCreateRetrospective

The name parameter is required in safeCreateRetrospective. However, it is missing in the following calls:

  • packages/server/graphql/public/mutations/startRetrospective.ts
  • packages/server/graphql/private/mutations/processRecurrence.ts

Please ensure that the name parameter is provided in these function calls.

Analysis chain

Ensure name is provided in all calls to safeCreateRetrospective.

The name parameter is now required in meetingSettings. Verify that all calls to safeCreateRetrospective provide this parameter.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all calls to `safeCreateRetrospective` provide the `name` parameter.

# Test: Search for the function usage. Expect: All calls include the `name` parameter.
rg --type js --type ts $'safeCreateRetrospective'

Length of output: 791


Script:

#!/bin/bash
# Description: Check if the `name` parameter is provided in all calls to `safeCreateRetrospective`.

# Extract and display the lines where `safeCreateRetrospective` is called in the identified files
rg --type js --type ts -A 5 $'safeCreateRetrospective(' packages/server/graphql/private/mutations/processRecurrence.ts packages/server/graphql/public/mutations/startRetrospective.ts

Length of output: 281


Script:

#!/bin/bash
# Description: Check if the `name` parameter is provided in all calls to `safeCreateRetrospective`.

# Extract and display the lines where `safeCreateRetrospective` is called in the identified files
rg --type js --type ts -A 5 'safeCreateRetrospective\(' packages/server/graphql/private/mutations/processRecurrence.ts packages/server/graphql/public/mutations/startRetrospective.ts

Length of output: 1263

@Dschoordsch Dschoordsch changed the title fix: Make meeting series naming consistent chore: Make meeting series naming consistent Jul 11, 2024
@Dschoordsch Dschoordsch merged commit 97bfc0f into master Jul 11, 2024
8 checks passed
@Dschoordsch Dschoordsch deleted the fix/9813/consistentMeetingSeriesNaming branch July 11, 2024 16:01
@github-actions github-actions bot mentioned this pull request Jul 11, 2024
24 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants