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

IAN mention includes comment origin name #4780

Merged
merged 3 commits into from
Dec 12, 2024
Merged

IAN mention includes comment origin name #4780

merged 3 commits into from
Dec 12, 2024

Conversation

hero101
Copy link
Collaborator

@hero101 hero101 commented Dec 12, 2024

Summary by CodeRabbit

  • New Features

    • Introduced a new field resolver method commentOriginName for in-app notifications, enhancing the information available in notifications.
  • Chores

    • Updated the version of the @alkemio/notifications-lib dependency from 0.10.0 to 0.10.1.

@hero101 hero101 requested a review from bobbykolev December 12, 2024 09:32
Copy link
Contributor

coderabbitai bot commented Dec 12, 2024

Warning

Rate limit exceeded

@hero101 has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 22 minutes and 17 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 65032ef and 83470ed.

📒 Files selected for processing (1)
  • src/domain/in-app-notification-reader/field-resolvers/in.app.notification.user.mentioned.resolver.fields.ts (1 hunks)

Walkthrough

The pull request includes two main changes: an update to the package.json file where the version of the @alkemio/notifications-lib dependency is increased from 0.10.0 to 0.10.1, and the addition of a new method commentOriginName to the InAppNotificationUserMentionedResolverFields class in a TypeScript file. This new method is designed to resolve a GraphQL field by extracting the displayName from the commentOrigin object.

Changes

File Change Summary
package.json Updated @alkemio/notifications-lib dependency version from 0.10.0 to 0.10.1.
src/domain/in-app-notification-reader/field-resolvers/in.app.notification.user.mentioned.resolver.fields.ts Added method commentOriginName to InAppNotificationUserMentionedResolverFields class.

Possibly related PRs

  • version bump #4526: This PR involves a version bump in the package.json, similar to the version update of the @alkemio/notifications-lib dependency in the main PR.
  • version bump #4555: This PR also reflects a version bump in the package.json, indicating a related change in versioning practices.
  • Version #4572: This PR updates the version number in the package.json, aligning with the version update theme present in the main PR.
  • Version bump #4647: This PR includes a version bump in the package.json, which is directly related to the versioning aspect of the main PR.

Suggested reviewers

  • ccanos

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. (Experiment)
  • @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.

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

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 15c1951 and 65032ef.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (2)
  • package.json (1 hunks)
  • src/domain/in-app-notification-reader/field-resolvers/in.app.notification.user.mentioned.resolver.fields.ts (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
src/domain/in-app-notification-reader/field-resolvers/in.app.notification.user.mentioned.resolver.fields.ts (1)

Pattern src/**/*.{ts,js}: Review the TypeScript/JavaScript code for NestJS best practices, dependency injection, module structure, and potential bugs.

Context Files (Do Not Review):

  • docs/Design.md - Design overview of the project
  • docs/Pagination.md - Pagination design overview
  • docs/Developing.md - Development setup overview
  • docs/graphql-typeorm-usage.md - overview of GraphQL and TypeORM usage and how they are used together with NestJS in the project
  • docs/database-definitions.md - guidelines for creating TypeORM entity defnitions
  • src/core/error-handling/graphql.exception.filter.ts - GraphQL error handling
  • src/core/error-handling/http.exception.filter.ts - HTTP error handling
  • src/core/error-handling/rest.error.response.ts - REST error response
  • src/core/error-handling/unhandled.exception.filter.ts - Global exception handler

Guidelines:

  • Our project uses global exception handlers (UnhandledExceptionFilter), so avoid suggesting additional try/catch blocks unless handling specific cases.
  • Use NestJS latest documentation from https://docs.nestjs.com/ for reference on NestJS best practices.
  • Use TypeORM latest documentation from https://typeorm.io/ for reference on TypeORM best practices.
  • Refer to the design overview in the context files for better understanding.
🔇 Additional comments (2)
src/domain/in-app-notification-reader/field-resolvers/in.app.notification.user.mentioned.resolver.fields.ts (1)

41-45: Consider adding null checks for commentOrigin and displayName.

The code assumes payload.commentOrigin and payload.commentOrigin.displayName are always defined. Consider adding null checks to handle edge cases gracefully.

Let's verify the payload structure in the notifications library:

package.json (1)

59-59: Verify the notifications-lib version update.

The update from 0.10.0 to 0.10.1 is a patch version change. Let's verify the changes and if there's a newer version available.

✅ Verification successful

Version 0.10.1 is the latest available version of notifications-lib

The update from 0.10.0 to 0.10.1 is appropriate as:

  • It's a patch version update following semver
  • It's the latest version available on npm registry
  • No older versions are being skipped

While the GitHub release notes are not accessible via the API, the version update itself is verified to be current and follows proper versioning practices.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check available versions and changelog for notifications-lib

# Check latest version on npm
npm view @alkemio/notifications-lib versions --json

# Check for any release notes or changelog
gh api repos/alkem-io/notifications-lib/releases/latest

Length of output: 788

@hero101 hero101 merged commit 9d07e87 into develop Dec 12, 2024
3 checks passed
@hero101 hero101 deleted the 7305 branch December 12, 2024 13:18
valentinyanakiev added a commit that referenced this pull request Dec 16, 2024
* wip

* moved dir to adapters

* poc wingback create customer

* poc wingback create customer

* getEntitlements

* comment added

* first pass at two new modules for TemplatesManager, TemplateDefault

* added templates manager to space; removed the SpaceDefaults entity (module still present until move all data to be via defaults

* added templatesManager to platform

* moved creating of default innovatin flow input to space defaults

* back out space type on Template; tidy up Template module to use switch statements

* created template applier module

* tidy up naming

* updated set of default template types

* fixed circular dependency; moved logic for creating collaboration input to space defaults

* removed loading of defaults from files for collaboration content

* removed code based addition of callouts, innovation flow states

* tidy up naming

* added loading of default templates at platform level in to bootstrap

* removed option to create new innovation flow template

* added in migration:

* loading in templates on bootstrap

* added field for collaboration templates on templatesSet; added lookup for templatesManager

* added mutation to create template from collaboration; added logic to prevent template used as default to be deleted; fixed removal of template set on template manager

* initial creation of license + entitlements modules

* add license into account

* updated account to have license service + use that in mutations checking limits, removing notion of soft limits

* ensure data is loaded properly on account for license checking

* added mutation to reset the license calculations on account, including new auth privilege to be able to do so

* renamed Licensing module to LicensingFramework module; trigger license reset on Account after assigning / removing license

* removed usage of LicenseEngine outside of license services on space or account

* renamed entitlement to licenseEntitlement as entity; first pass at migration

* fixed issues in migration

* fixed issues related to auth reset; tidied up loader creator imports

* fixed auth cascade for templates of type post

* license reset running

* reset licenses on space after adding / removing license plans

* removed need for license check in community; added entitlement check in roleset when adding a VC

* remove auth reset when assigning / removing license plans

* added License to RoleSet

* added license to collaboration

* tidied up retrieval of license for whiteboard; added license to collaboration in migration

* fix typo; fix space spec file

* fix additional tests

* moved tempaltesManager to last migration in the list

* fixed retrieval of template when creating collaboration

* added logging

* fixed bootstrap setting of templates

* refactored inputCreator to do the data loading closer to usage; fixed picking up of templates; fixed bootstrap usage of templates

* added ability to retrieve limits on entitlements + current usage

* updated field names on entitlements

* updated field names on entitlements

* fixed account mutaiton logic bug

* ensure that licenses are reset when assigning beta tester or vc campaign role to a user

* added reset all account licenses mutation

* fixed bug on space entitlements; refactored code to reduce duplication

* fixed url generation for templates inside of TempaltesManager

* fixed bootstrap order to create forum earlier

* ensure collaboration creation on template provides some defaults for callouts

* fix deletion of templates of type post

* ensure more data is defaulted inside of template service for collaboration; add setting of isTemplate field on Collaboration, and also on contained Callouts

* ensure isTempalte is passed to Collaboration entity

* fixed groups in bootstrap space template; updated signature for creating callout from collaboration

* fixed missing field

* fixed type on mutation to create from collaboration

* fixed typo

* fixed groups in bootstrap space template; updated signature for creating callout from collaboration

* fixed missing field

* fixed type on mutation to create from collaboration

* fixed typo

* reworked applying collaboraiton template to collaboration

* improved error message in wrong type of ID passed in

* fixed build

* made migration last in the list

* rename migration to be last

* removed read check when looking up collaboration

* track free / plus / premium space entitlements separately

* updated migration order

* removed duplicate migration

* moved auth reset to mutation for applying the template to another collaboration

* extend lookup of entitlement usage to cover new types

* updaed license policy to reflect new entitlements; made license engine work with entitlements, not license privileges; removed license privilege (no longer relevant)

* updated migration to not drop indexes already removed

* fix for license reset on space

* added license policy rule for free space credential

* ensure license entitlements are reset as part of the bootstrap

* fixed typo

* extended reset all to include resetting licenses on accounts + AI server; moved migration to be last

* Address pr comment

* Address PR feedback

* Address PR comment

* Address PR comments

* Address PR comments

* Address PR comment

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* Improved types & naming

* Address PR comments

* Fixed switch-case logic in entitlements

* Converge entitlements schema

* Remove unused AuthorizationPrivilege

* pass in spaceID on space authorization as reload the entity

* initial rework of the space authorization to clean up logic so that the Space does not know about the parent account authorization

* removed privileges on space that are no longer used there

* minor tidy up

* fixed logic check: space auth does need license entitlements

* renamed the two ways for assigning entitlements

* fix compilation:

* renaming; code setup

* take rabbit suggestion

* simplify usage of wingback api setup

* added flag to be able to disable wingback

* fix build

* fix build

* fix build

* TypeОRM default timezone to be UTC (#4732)

* typeorm default timezone to be UTC

* timezone read from the config

* Added comment about default timezone

---------

Co-authored-by: Neil Smyth <[email protected]>
Co-authored-by: Valentin Yanakiev <[email protected]>

* In-app notifications  (#4760)

* wip

* wip

* wip

* wip

* wip

* handled empty arrays

* fix for new member notification

* update state mutation

* rename

* wip

* wip

* wip

* wip

* connection to remote service

* wip

* new fields

* typeorm default timezone to be UTC

* timezone read from the config

* return sorted result by time triggered

* category is the proper type

* commentUrl on user mentioned

* graphql enums redefined

* notifications limited to beta testers only

* fixed tests

* renamed migrations to be on top

* version bump

* timezone changes reverted

* timezone changes reverted from config

* update state authorization

* removed notificationsAll query

* redundant code

* reviewer suggestions

* getAgent -> getAgentOrFail

* first set of review changes

* improved updating state

* introducing mixin to avoid CD

* removed unused extends from mixin

* added mixin for other concrete classes

---------

Co-authored-by: Svetoslav <[email protected]>
Co-authored-by: bobbykolev <[email protected]>

* Async invoke all engines ingest (#4766)

* Async invoke all engines ingest

* Reviewer suggestions

* Revert unused code

* notification dates properly serialized

* dataloader output order must match key order (#4770)

* Propagate anonymousReadAccess from parentAuthorization for Space

* dataloader can now resolve to null for nullable fields

* Fixed imports

* proper return type

* Update src/services/external/wingback/wingback.manager.ts

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* Auto stash before merge of "wingback" and "origin/wingback"

* Update src/platform/licensing/wingback-subscription/licensing.wingback.subscription.service.spec.ts

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* fixed comments / test issue

* IAN mention includes comment origin name (#4780)

* mention includes comment origin name

* package version bump

* added correct description to the field

* New callouts to be on top (#4781)

* introduce AlkemioVirtualContributorEngine for OpenAI generic and assistant engines

* update quickstart-services

* add powerpoint mimetypes (#4784)

* 7327 Don't allow nameIds on createSubspaceInput (#4785)

Co-authored-by: Valentin Yanakiev <[email protected]>

* correct contributor data loader

---------

Co-authored-by: Svetoslav <[email protected]>
Co-authored-by: Neil Smyth <[email protected]>
Co-authored-by: Neil Smyth <[email protected]>
Co-authored-by: Carlos Cano <[email protected]>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: bobbykolev <[email protected]>
Co-authored-by: Evgeni Dimitrov <[email protected]>
Co-authored-by: Vladimir Aleksiev <[email protected]>
Co-authored-by: Vladimir Aleksiev <[email protected]>
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.

2 participants