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

Tests for #4649 and #4650 #389

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open

Tests for #4649 and #4650 #389

wants to merge 1 commit into from

Conversation

ccanos
Copy link
Contributor

@ccanos ccanos commented Dec 20, 2024

  • now the mutation to create a whiteboard instead of receiving profileData receives profile to be consistent with the framing > profile and to be able to create a whiteboard callout with visuals
  • Removed unused file that was giving problems running codegen
  • Run codegen to update the model changes:
    • profile doesn't have avatarURL anymore, it has visuals which is an array of {url: string, name: VisualType} to properly push all the visuals on any profile creation.
    • inputCreator service now can return the visuals
    • Some other updates that I don't know of (see the alkemio-schema file): LicenseCredential, file extensions...

Summary by CodeRabbit

  • Bug Fixes

    • Removed the featureFlagRules GraphQL fragment, impacting related queries and mutations.
  • New Features

    • Updated createWhiteboardOnCallout, createWhiteboardCallout, and createWhiteboardTemplate functions to standardize property naming from profileData to profile, enhancing data structure consistency.
  • Documentation

    • Clarified changes in the structure of data objects for better understanding of API calls.

Copy link

coderabbitai bot commented Dec 20, 2024

Walkthrough

This pull request involves multiple file modifications across test and GraphQL directories. The primary changes include removing a GraphQL fragment (featureFlagRules) and renaming profileData properties to profile in several test parameter request files related to whiteboards and callouts. These changes appear to be part of a broader effort to standardize data structure naming conventions and potentially simplify GraphQL fragment usage.

Changes

File Change Summary
graphql/fragments/features/featureFlagRules.graphql Removed GraphQL fragment featureFlagRules on LicensePolicyCredentialRule type
test/functional-api/callout/* Renamed profileData to profile in whiteboard-related test parameter request files
test/functional-api/templates/whiteboard/whiteboard-templates.request.params.ts Updated createWhiteboardTemplate and updateTemplate functions to use profile instead of profileData

Possibly related PRs

  • #4600: Updates to updateCalloutFraming method for whiteboard content
  • #6908: Template management improvements
  • #7127: Subspaces and templates fixes
  • #7130: Additional template-related modifications
  • #7218: Account rules and entitlements changes
  • #4717: Account rules fixes
  • refactored getting documents from subspace to use lookup #387: Document retrieval refactoring

Suggested Reviewers

  • techsmyth
  • Comoque1

Poem

🐰 A GraphQL fragment, once so neat,
Renamed and trimmed, a coding feat!
Profiles dancing, data so light,
Whiteboards gleaming, everything right!
Code evolution, hop-hop hooray! 🚀

Tip

CodeRabbit's docstrings feature is now available as part of our Early Access Program! Simply use the command @coderabbitai generate docstrings to have CodeRabbit automatically generate docstrings for your pull request. We would love to hear your feedback on Discord.


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>, please review it.
    • 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 gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @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 using 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 generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration 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.

Copy link

@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: 1

🧹 Nitpick comments (1)
test/functional-api/callout/call-for-whiteboards/whiteboard-collection-callout.params.request.ts (1)

54-56: Consider using a more meaningful test display name.

The hardcoded display name '111' could be more descriptive to better represent its purpose in tests.

Suggestion:

             profile: {
-              displayName: '111',
+              displayName: 'test-whiteboard',
             },
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 78dcc3d and 5fdc252.

⛔ Files ignored due to path filters (2)
  • test/generated/alkemio-schema.ts is excluded by !**/generated/**
  • test/generated/graphql.ts is excluded by !**/generated/**
📒 Files selected for processing (5)
  • graphql/fragments/features/featureFlagRules.graphql (0 hunks)
  • test/functional-api/callout/call-for-whiteboards/whiteboard-collection-callout.params.request.ts (1 hunks)
  • test/functional-api/callout/whiteboard/whiteboard-callout.params.request.ts (1 hunks)
  • test/functional-api/callout/whiteboard/whiteboardRt-callout.params.request.ts (1 hunks)
  • test/functional-api/templates/whiteboard/whiteboard-templates.request.params.ts (1 hunks)
💤 Files with no reviewable changes (1)
  • graphql/fragments/features/featureFlagRules.graphql
🔇 Additional comments (3)
test/functional-api/callout/whiteboard/whiteboardRt-callout.params.request.ts (1)

30-33: Verify the necessity of duplicate profile information.

There appears to be profile information defined at two levels:

  1. framing.profile with a dynamic displayName
  2. framing.whiteboard.profile with a hardcoded 'whiteboard' displayName

This might lead to confusion about which profile information takes precedence.

Let's verify if this is the expected behavior by checking other whiteboard-related tests:

✅ Verification successful

Based on the search results, I can now provide a definitive response about the whiteboard profile structure:

The whiteboard profile structure is correct and intentional

The codebase shows that whiteboard callouts consistently use this nested profile structure:

  1. framing.profile - Contains the main callout profile information
  2. framing.whiteboard.profile - Contains whiteboard-specific profile information

This is evidenced by multiple test files showing this pattern, particularly in:

  • Whiteboard template creation
  • Whiteboard callout creation
  • Storage/document handling for whiteboards

The hardcoded 'whiteboard' displayName in framing.whiteboard.profile appears to be a deliberate identifier for the whiteboard component, while the dynamic displayName in framing.profile represents the user-facing callout name.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for similar whiteboard profile structures in test files
rg -A 5 "whiteboard.*profile.*displayName" test/

Length of output: 50


Script:

#!/bin/bash
# Let's try a broader search for profile structures in test files
rg -B 2 -A 5 'profile.*displayName' test/functional-api/

Length of output: 46822


Script:

#!/bin/bash
# Search for whiteboard-related test files to understand the context better
fd whiteboard test/functional-api/ --exec cat {}

Length of output: 91823


Script:

#!/bin/bash
# Look for framing structures in test files
rg -B 2 -A 5 'framing.*profile' test/functional-api/

Length of output: 79694

test/functional-api/callout/whiteboard/whiteboard-callout.params.request.ts (1)

30-33: Same profile duplication concern as in whiteboardRt-callout.params.request.ts

test/functional-api/callout/call-for-whiteboards/whiteboard-collection-callout.params.request.ts (1)

54-56: Verify profile structure consistency across different contexts.

The profile structure is used in different contexts (framing vs contributionData). Let's verify the consistency of this pattern across the codebase.

✅ Verification successful

Let me analyze the search results to verify the profile structure consistency:

  1. In framing context:
  • The profile consistently contains displayName field across all test files
  • The profile structure is defined in schema (test/generated/graphql.ts) with displayName: string
  • Used consistently in callout creation tests with framing: { profile: { displayName: string } }
  1. In whiteboard context:
  • Profile contains storageBucket and visual fields
  • Used consistently in both public and private space document auth tests
  • Same structure used in both framing.whiteboard.profile and contributions[].whiteboard.profile paths
  1. No direct contributionData.profile usage found in the search results

The profile structure appears to be consistent across different contexts, with each context having its specific required fields that are used consistently throughout the test files. The displayName field being used in the test file matches the schema definition and existing usage patterns.

Profile structure is consistent with codebase patterns.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for profile structure usage in different contexts
echo "=== Profile in framing context ==="
rg -A 3 "framing.*profile" test/

echo "=== Profile in contributionData context ==="
rg -A 3 "contributionData.*profile" test/

echo "=== Profile in whiteboard context ==="
rg -A 3 "whiteboard.*profile" test/

Length of output: 68943

Comment on lines +52 to 54
profile: {
displayName: 'Whiteboard Template',
},
Copy link

Choose a reason for hiding this comment

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

💡 Codebase verification

Inconsistency found in GraphQL mutations for template creation

The change from profileData to profile is inconsistent across the codebase:

  • In test files, the new profile structure is correctly used
  • However, GraphQL mutations still use profileData in their template creation:
    • createWhiteboardTemplate.graphql: Input parameter is $profile but used as profileData in mutation
    • createTemplate.graphql: Same inconsistency
    • createTemplateFromCollaboration.graphql: Still using old profileData naming
🔗 Analysis chain

LGTM! Property rename aligns with schema changes.

The change from profileData to profile correctly aligns with the PR objectives and maintains consistency with the framing > profile structure.

Let's verify the consistency of this change across the codebase:

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for any remaining instances of profileData that might need updating
# and verify the new profile structure is used consistently

# Check for any remaining instances of profileData
echo "Checking for remaining profileData instances:"
rg "profileData" -l

# Verify the new profile structure usage
echo "Verifying profile structure usage:"
ast-grep --pattern 'profile: {
  displayName: $_,
  $$$
}'

Length of output: 2190


Script:

#!/bin/bash
# Let's examine the actual usage of profileData in test files to understand if they need updates
# Focus on template-related files first as they're most relevant to our context

echo "Checking profileData usage in template-related files:"
rg "profileData" -B 2 -A 2 test/functional-api/templates/
rg "profileData" graphql/mutations/templates/

echo -e "\nChecking current profile structure in template files:"
rg "profile.*{" -B 2 -A 2 test/functional-api/templates/
rg "profile.*{" -B 2 -A 2 graphql/mutations/templates/

Length of output: 3234


Script:

#!/bin/bash
# Let's fix the regex and check the profile structure properly
# Also examine the specific GraphQL mutations that still use profileData

echo "Checking profile structure in template files:"
rg "profile: \{" -B 2 -A 2 test/functional-api/templates/
rg "profile: \{" -B 2 -A 2 graphql/mutations/templates/

echo -e "\nExamining GraphQL mutations with profileData:"
cat graphql/mutations/templates/createWhiteboardTemplate.graphql
echo -e "\n---\n"
cat graphql/mutations/templates/createTemplate.graphql
echo -e "\n---\n"
cat graphql/mutations/templates/createTemplateFromCollaboration.graphql

Length of output: 6654

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant