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

feat!: improve events emissions #1295

Merged
merged 14 commits into from
Feb 7, 2024
Merged

Conversation

RiccardoM
Copy link
Contributor

@RiccardoM RiccardoM commented Feb 1, 2024

Description

This PR improves the overall event emissions by standardizing the event names. It also adds missing attributes and events emissions where useful.

Closes: DCD-441, DCD-442, DCD-443, DCD-444, DCD-445


Author Checklist

All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.

I have...

  • included the correct type prefix in the PR title
  • added ! to the type prefix if API or client breaking change
  • targeted the correct branch (see PR Targeting)
  • provided a link to the relevant issue or specification
  • followed the guidelines for building modules
  • included the necessary unit and integration tests
  • added a changelog entry to CHANGELOG.md
  • included comments for documenting Go code
  • updated the relevant documentation or specification
  • reviewed "Files changed" and left comments if necessary
  • confirmed all CI checks have passed

Reviewers Checklist

All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.

I have...

  • confirmed the correct type prefix in the PR title
  • confirmed ! in the type prefix if API or client breaking change
  • confirmed all author checklist items have been addressed
  • reviewed state machine logic
  • reviewed API design and naming
  • reviewed documentation is accurate
  • reviewed tests and test coverage
  • manually tested (if applicable)

Summary by CodeRabbit

  • New Features
    • Enhanced event naming and attributes across various modules for clarity and consistency.
  • Refactor
    • Updated event types and attributes in profiles, reports, and subspaces modules to reflect semantic changes.
    • Standardized event naming convention across the application.
  • Documentation
    • Updated documentation to reflect the new event naming and attribute changes.

@RiccardoM RiccardoM requested a review from a team as a code owner February 1, 2024 11:21
@RiccardoM RiccardoM changed the title feat!: improve feat!: improve events emissions Feb 1, 2024
@github-actions github-actions bot added x/profiles Module that allows to create and manage decentralized social profiles x/subspaces Issue on the x/subspaces module x/relationships labels Feb 1, 2024
Copy link
Contributor

coderabbitai bot commented Feb 1, 2024

Walkthrough

The changes involve a systematic renaming of event types and attributes across multiple files to enhance consistency and readability. This effort aims to standardize event naming conventions and improve the overall clarity of event-related code within the system.

Changes

Files Change Summary
x/profiles/keeper/..._dtag_transfers.go, x/profiles/keeper/..._test.go, x/profiles/spec/05-events.md, x/profiles/types/events.go Renamed and adjusted event types and attributes in the profiles module for clarity and semantic accuracy.
x/reports/types/events.go, x/subspaces/keeper/..._server.go, x/subspaces/keeper/..._test.go, x/subspaces/types/events.go Updated event types and attributes in reporting and subspace modules for consistency and clarity.
.changeset/entries/22c2a6c7f91416899301d06b3b3a7a6bb3a324e0d8575cd332a3558e4eb7e8f0.yaml Refactored event and attribute names in the other module for better naming consistency.

"In the realm of code, where logic intertwines,
A rabbit hopped through, refining the lines.
🐰 With each leap and bound, events renamed with care,
A tale of clarity, in bytes, we now share."

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-tests for this file.
  • 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 tests 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 from git and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit tests.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

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 a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @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.
  • The JSON schema for the configuration file is available here.
  • 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/coderabbit-overrides.v2.json

CodeRabbit Discord Community

Join our Discord Community to get help, request features, and share feedback.

@RiccardoM RiccardoM requested a review from dadamu February 1, 2024 11:22
Copy link

codecov bot commented Feb 1, 2024

Codecov Report

Attention: 18 lines in your changes are missing coverage. Please review.

Comparison is base (2f07dd2) 81.04% compared to head (ef1858d) 81.02%.
Report is 3 commits behind head on master.

❗ Current head ef1858d differs from pull request most recent head c298114. Consider uploading reports for the commit c298114 to get more accurate results

Files Patch % Lines
x/profiles/ibc_module.go 0.00% 12 Missing ⚠️
x/posts/types/models.go 0.00% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1295      +/-   ##
==========================================
- Coverage   81.04%   81.02%   -0.02%     
==========================================
  Files         218      218              
  Lines       17880    17898      +18     
==========================================
+ Hits        14490    14502      +12     
- Misses       2778     2784       +6     
  Partials      612      612              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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.

Review Status

Actionable comments generated: 1

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 3bbac8e and fbc442c.
Files selected for processing (38)
  • types/utils/slices.go (1 hunks)
  • x/posts/abci.go (2 hunks)
  • x/posts/keeper/msg_server.go (12 hunks)
  • x/posts/keeper/msg_server_test.go (15 hunks)
  • x/posts/spec/05-events.md (2 hunks)
  • x/posts/types/events.go (1 hunks)
  • x/posts/types/models.go (1 hunks)
  • x/profiles/abci_test.go (1 hunks)
  • x/profiles/ibc_module.go (3 hunks)
  • x/profiles/keeper/keeper_app_links.go (2 hunks)
  • x/profiles/keeper/keeper_app_links_test.go (5 hunks)
  • x/profiles/keeper/keeper_chain_links.go (1 hunks)
  • x/profiles/keeper/msg_server_app_link.go (1 hunks)
  • x/profiles/keeper/msg_server_app_link_test.go (3 hunks)
  • x/profiles/keeper/msg_server_chain_link.go (2 hunks)
  • x/profiles/keeper/msg_server_chain_link_test.go (2 hunks)
  • x/profiles/keeper/msg_server_dtag_transfers.go (4 hunks)
  • x/profiles/keeper/msg_server_dtag_transfers_test.go (6 hunks)
  • x/profiles/keeper/msgs_server_profile.go (2 hunks)
  • x/profiles/keeper/msgs_server_profile_test.go (5 hunks)
  • x/profiles/spec/05-events.md (2 hunks)
  • x/profiles/types/events.go (1 hunks)
  • x/reactions/keeper/msg_server.go (7 hunks)
  • x/reactions/keeper/msg_server_test.go (8 hunks)
  • x/reactions/spec/05-events.md (1 hunks)
  • x/reactions/types/events.go (1 hunks)
  • x/relationships/keeper/msg_server.go (5 hunks)
  • x/relationships/keeper/msg_server_test.go (5 hunks)
  • x/relationships/spec/05-events.md (1 hunks)
  • x/relationships/types/events.go (1 hunks)
  • x/reports/keeper/msg_server.go (7 hunks)
  • x/reports/keeper/msg_server_test.go (7 hunks)
  • x/reports/spec/05-events.md (1 hunks)
  • x/reports/types/events.go (1 hunks)
  • x/subspaces/keeper/msg_server.go (24 hunks)
  • x/subspaces/keeper/msg_server_test.go (25 hunks)
  • x/subspaces/spec/05-events.md (1 hunks)
  • x/subspaces/types/events.go (1 hunks)
Files not reviewed due to errors (1)
  • x/subspaces/keeper/msg_server_test.go (Error: unable to parse review)
Files skipped from review due to trivial changes (6)
  • x/posts/types/models.go
  • x/profiles/keeper/keeper_app_links.go
  • x/profiles/keeper/msg_server_dtag_transfers.go
  • x/profiles/keeper/msgs_server_profile.go
  • x/profiles/keeper/msgs_server_profile_test.go
  • x/reactions/types/events.go
Additional comments: 158
types/utils/slices.go (1)
  • 3-8: The implementation of the Map function looks good. It correctly applies a transformation function to each element of the input slice, adhering to Go's generic type parameters. This addition enhances the utility functions provided by the package.
x/relationships/types/events.go (1)
  • 6-9: The renaming of event types and attributes in the events.go file enhances clarity and consistency across the relationships module. Removing AttributeKeySubspace aligns with the PR's objectives to refine the codebase.
x/reports/types/events.go (1)
  • 6-12: The renaming of event types and attributes in the events.go file enhances clarity and consistency across the reports module. The changes align with the PR's objectives to refine the codebase and improve readability.
x/posts/abci.go (2)
  • 6-7: The addition of the subspacestypes import statement in the abci.go file is appropriate for accessing the AttributeKeySubspaceID constant. This change supports the updated event attribute usage within the EndBlocker function.
  • 23-24: Updating the event type to EventTypeTalliedPoll and using subspacestypes.AttributeKeySubspaceID for the attribute key in the EndBlocker function enhances clarity and consistency with the rest of the project. These changes align with the PR's objectives to refine event handling.
x/posts/types/events.go (1)
  • 5-16: The renaming of event type constants and attribute keys in the events.go file enhances clarity and consistency across the posts module. These changes align with the PR's objectives to refine the codebase and improve readability.
x/subspaces/types/events.go (1)
  • 5-24: The renaming of event type constants and the addition of the AttributeKeyPermissions in the events.go file enhance clarity and consistency across the subspaces module. These changes align with the PR's objectives to refine the codebase and improve event handling.
x/profiles/keeper/msg_server_app_link.go (1)
  • 52-52: Renaming the event type constant to EventTypeCreatedApplicationLink within the LinkApplication method enhances clarity and consistency with the rest of the project. This change aligns with the PR's objectives to refine event naming.
x/profiles/types/events.go (1)
  • 6-22: The renaming of event types and the introduction of new event types in the events.go file enhance clarity and consistency across the profiles module. These changes align with the PR's objectives to refine the codebase and improve event handling.
x/relationships/spec/05-events.md (1)
  • 10-56: The updates to the event attribute keys and values in the 05-events.md file enhance clarity and consistency within the relationships module documentation. These changes align with the PR's objectives to refine the codebase and ensure documentation accuracy.
x/profiles/keeper/msg_server_chain_link.go (2)
  • 32-32: Renaming the event type to EventTypeCreatedChainLink within the LinkChainAccount function enhances clarity and consistency with the rest of the project. This change aligns with the PR's objectives to refine event naming.
  • 58-58: Renaming the event type to EventTypeDeletedChainLink within the UnlinkChainAccount function enhances clarity and consistency with the rest of the project. This change aligns with the PR's objectives to refine event naming.
x/reports/spec/05-events.md (1)
  • 16-82: The updates to the event types and attributes in the 05-events.md file enhance clarity and consistency within the reports module documentation. These changes align with the PR's objectives to refine the codebase and ensure documentation accuracy.
x/profiles/abci_test.go (1)
  • 89-89: Updating the event type to EventTypeDeletedApplicationLink in the TestBeginBlocker function enhances clarity and consistency with the rest of the project. This change aligns with the PR's objectives to refine event naming.
x/reactions/spec/05-events.md (1)
  • 16-65: The updates to the event types and attributes in the 05-events.md file enhance clarity and consistency within the reactions module documentation. These changes align with the PR's objectives to refine the codebase and ensure documentation accuracy.
x/relationships/keeper/msg_server.go (4)
  • 53-56: Updating the event type to EventTypeCreatedRelationship and using subspacestypes.AttributeKeySubspaceID for the attribute key in the CreateRelationship function enhances clarity and consistency with the rest of the project. These changes align with the PR's objectives to refine event handling.
  • 82-85: Updating the event type to EventTypeDeletedRelationship and using subspacestypes.AttributeKeySubspaceID for the attribute key in the DeleteRelationship function enhances clarity and consistency with the rest of the project. These changes align with the PR's objectives to refine event handling.
  • 111-114: Updating the event type to EventTypeBlockedUser and using subspacestypes.AttributeKeySubspaceID for the attribute key in the BlockUser function enhances clarity and consistency with the rest of the project. These changes align with the PR's objectives to refine event handling.
  • 140-143: Updating the event type to EventTypeUnblockedUser and using subspacestypes.AttributeKeySubspaceID for the attribute key in the UnblockUser function enhances clarity and consistency with the rest of the project. These changes align with the PR's objectives to refine event handling.
x/profiles/keeper/keeper_chain_links.go (1)
  • 59-66: Emitting the EventTypeSavedChainLink event with detailed attributes in the SaveChainLink method enhances functionality by providing more detailed event logging. This addition aligns with the PR's objectives to refine event handling within the profiles module.
x/posts/spec/05-events.md (12)
  • 16-22: The event type and attribute keys have been updated to reflect the action more accurately, changing from create_post to created_post. This change improves semantic clarity.
  • 29-33: The event type and attribute keys have been updated to edited_post, enhancing semantic clarity by indicating the past action of editing a post.
  • 40-43: The event type and attribute keys have been updated to deleted_post, which more accurately reflects the action of deleting a post.
  • 50-55: The event type and attribute keys have been updated to added_post_attachment, improving semantic clarity by indicating the addition of an attachment to a post.
  • 62-66: The event type and attribute keys have been updated to removed_post_attachment, enhancing semantic clarity by indicating the removal of an attachment from a post.
  • 74-78: The event type and attribute keys have been updated to answered_poll, which more accurately reflects the action of answering a poll associated with a post.
  • 93-97: The event type and attribute keys have been updated to moved_post, improving semantic clarity by indicating the action of moving a post to a different subspace or section.
  • 105-109: The event type and attribute keys have been updated to requested_post_owner_transfer, which more accurately reflects the action of requesting the transfer of post ownership.
  • 117-121: The event type and attribute keys have been updated to canceled_post_owner_transfer, enhancing semantic clarity by indicating the cancellation of a post owner transfer request.
  • 128-132: The event type and attribute keys have been updated to accepted_post_owner_transfer, improving semantic clarity by indicating the acceptance of a post owner transfer request.
  • 141-145: The event type and attribute keys have been updated to refused_post_owner_transfer, which more accurately reflects the action of refusing a post owner transfer request.
  • 154-156: The event type and attribute keys have been updated to tallied_poll, enhancing semantic clarity by indicating the completion and tallying of a poll associated with a post.
x/profiles/keeper/msg_server_chain_link_test.go (3)
  • 111-115: The event type EventTypeSavedChainLink and associated attributes have been correctly updated to reflect the action of saving a chain link. This change enhances the clarity and accuracy of the event.
  • 117-117: The addition of the EventTypeCreatedChainLink event type and its attributes accurately reflects the creation of a new chain link. This is a positive change that adds detail to the events emitted by the system.
  • 208-208: The event type EventTypeDeletedChainLink and associated attributes have been correctly updated to reflect the action of deleting a chain link. This change enhances the clarity and accuracy of the event.
x/reports/keeper/msg_server.go (7)
  • 98-100: The event type EventTypeReportedPost and attribute keys have been updated to reflect the action of reporting a post more accurately. This change improves semantic clarity.
  • 105-106: The event type EventTypeReportedUser and attribute keys have been updated to reflect the action of reporting a user more accurately. This change improves semantic clarity.
  • 116-117: The event type EventTypeCreatedReport and attribute keys have been updated to reflect the action of creating a report more accurately. This change improves semantic clarity.
  • 158-159: The event type EventTypeDeletedReport and attribute keys have been updated to reflect the action of deleting a report more accurately. This change improves semantic clarity.
  • 208-209: The event type EventTypeSupportedStandardReason and attribute keys have been updated to reflect the action of supporting a standard reason for reporting more accurately. This change improves semantic clarity.
  • 255-256: The event type EventTypeAddedReportingReason and attribute keys have been updated to reflect the action of adding a reporting reason more accurately. This change improves semantic clarity.
  • 290-291: The event type EventTypeRemovedReportingReason and attribute keys have been updated to reflect the action of removing a reporting reason more accurately. This change improves semantic clarity.
x/relationships/keeper/msg_server_test.go (4)
  • 87-90: The event type EventTypeCreatedRelationship and attribute keys have been updated to reflect the action of creating a relationship more accurately. This change improves semantic clarity.
  • 186-189: The event type EventTypeDeletedRelationship and attribute keys have been updated to reflect the action of deleting a relationship more accurately. This change improves semantic clarity.
  • 288-291: The event type EventTypeBlockedUser and attribute keys have been updated to reflect the action of blocking a user more accurately. This change improves semantic clarity.
  • 388-391: The event type EventTypeUnblockedUser and attribute keys have been updated to reflect the action of unblocking a user more accurately. This change improves semantic clarity.
x/profiles/spec/05-events.md (9)
  • 16-24: The event type and attribute keys have been updated to reflect semantic changes, improving clarity and consistency.
  • 27-32: The event type and attribute keys have been updated to reflect semantic changes, improving clarity and consistency.
  • 36-43: The event type and attribute keys have been updated to reflect semantic changes, improving clarity and consistency.
  • 46-53: The event type and attribute keys have been updated to reflect semantic changes, improving clarity and consistency.
  • 57-65: The event type and attribute keys have been updated to reflect semantic changes, improving clarity and consistency.
  • 69-75: The event type and attribute keys have been updated to reflect semantic changes, improving clarity and consistency.
  • 81-98: The event type and attribute keys have been updated to reflect semantic changes, improving clarity and consistency.
  • 113-121: The event type and attribute keys have been updated to reflect semantic changes, improving clarity and consistency. Additionally, new attributes have been added, enhancing the event's descriptive quality.
  • 125-132: The event type and attribute keys have been updated to reflect semantic changes, improving clarity and consistency.
x/reactions/keeper/msg_server.go (5)
  • 95-96: The event type EventTypeAddedReaction has been correctly used to reflect the action of adding a reaction. This change aligns with the semantic updates across the project.
  • 144-145: The event type EventTypeRemovedReaction has been correctly used to reflect the action of removing a reaction. This change aligns with the semantic updates across the project.
  • 194-195: The event type EventTypeAddedRegisteredReaction has been correctly used to reflect the action of adding a registered reaction. This change aligns with the semantic updates across the project.
  • 238-238: The event type ActionEditRegisteredReaction is used here, which seems to be a deviation from the established pattern of using EventType as a prefix for event types. Please verify if this is intentional and aligns with the project's event naming conventions.
  • 270-271: The event type EventTypeRemovedRegisteredReaction has been correctly used to reflect the action of removing a registered reaction. This change aligns with the semantic updates across the project.
x/profiles/ibc_module.go (4)
  • 244-246: The event type EventTypeReceivedLinkChainAccountPacket correctly reflects the action of receiving a link chain account packet, aligning with the semantic updates across the project. Additionally, the new attribute AttributeKeyChainLinkOwner enhances the event's descriptive quality.
  • 275-279: The event type EventTypeReceivedOracleResponsePacketData correctly reflects the action of receiving oracle response packet data, aligning with the semantic updates across the project.
  • 315-321: > 📝 NOTE

This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [318-329]

The event type EventTypeReceivedOracleResponsePacketData is used to reflect the action of receiving oracle response packet data. However, it appears twice with different contexts (acknowledgment success and result). Ensure this usage is consistent and clear in the context of the events being emitted.

  • 336-336: The event type EventTypeReceivedOracleResponsePacketData is used to reflect the action of receiving oracle response packet data with an error. This usage aligns with the semantic updates across the project, ensuring clarity in event logging.
x/subspaces/spec/05-events.md (20)
  • 16-24: The event type and attribute keys have been updated to reflect semantic changes, improving clarity and consistency.
  • 28-33: The event type and attribute keys have been updated to reflect semantic changes, improving clarity and consistency.
  • 37-42: The event type and attribute keys have been updated to reflect semantic changes, improving clarity and consistency.
  • 46-52: The event type and attribute keys have been updated to reflect semantic changes, improving clarity and consistency.
  • 56-62: The event type and attribute keys have been updated to reflect semantic changes, improving clarity and consistency.
  • 66-72: The event type and attribute keys have been updated to reflect semantic changes, improving clarity and consistency.
  • 76-82: The event type and attribute keys have been updated to reflect semantic changes, improving clarity and consistency.
  • 86-92: The event type and attribute keys have been updated to reflect semantic changes, improving clarity and consistency.
  • 96-102: The event type and attribute keys have been updated to reflect semantic changes, improving clarity and consistency.
  • 106-112: The event type and attribute keys have been updated to reflect semantic changes, improving clarity and consistency.
  • 120-120: The addition of the permissions attribute to the set_user_group_permissions event enhances the event's descriptive quality, providing more detail about the permissions set.
  • 127-133: The event type and attribute keys have been updated to reflect semantic changes, improving clarity and consistency.
  • 137-144: The event type and attribute keys have been updated to reflect semantic changes, improving clarity and consistency.
  • 148-155: The event type and attribute keys have been updated to reflect semantic changes, improving clarity and consistency.
  • 162-163: The addition of the permissions attribute to the set_user_permissions event enhances the event's descriptive quality, providing more detail about the permissions set.
  • 171-178: The event type and attribute keys have been updated to reflect semantic changes, improving clarity and consistency.
  • 182-189: The event type and attribute keys have been updated to reflect semantic changes, improving clarity and consistency.
  • 193-201: The event type and attribute keys have been updated to reflect semantic changes, improving clarity and consistency.
  • 205-213: The event type and attribute keys have been updated to reflect semantic changes, improving clarity and consistency.
  • 217-223: The event type and attribute keys have been updated to reflect semantic changes, improving clarity and consistency.
x/profiles/keeper/msg_server_app_link_test.go (3)
  • 234-240: The renaming of event types from EventTypesApplicationLinkSaved and EventTypesApplicationLinkCreated to EventTypeSavedApplicationLink and EventTypeCreatedApplicationLink respectively, as well as from EventTypeApplicationLinkDeleted to EventTypeDeletedApplicationLink, enhances clarity and consistency in the codebase. This change aligns with the PR's objectives and follows best practices for naming conventions.
  • 340-346: The consistent renaming of event types within the TestMsgServer_LinkApplication function further aligns with the PR's objectives to improve clarity and maintainability. The changes are correctly implemented and follow the established naming conventions.
  • 513-513: The update in the TestMsgServer_UnlinkApplication function, where EventTypeApplicationLinkDeleted has been changed to EventTypeDeletedApplicationLink, correctly reflects the action being performed and aligns with the PR's goal of enhancing clarity through better naming conventions.
x/profiles/keeper/msg_server_dtag_transfers_test.go (5)
  • 86-86: Renaming event types within the TestMsgServer_RequestDTagTransfer function to EventTypeRequestedDTagTransferRequest improves clarity and consistency across the codebase. This change is in line with the PR's objectives and follows best practices for naming conventions.
  • 153-153: The update in the TestMsgServer_CancelDTagTransfer function, where event types have been renamed to EventTypeCanceledDTagTransferRequest, aligns with the PR's goal of enhancing clarity through better naming conventions. This change correctly reflects the action being performed and follows established best practices.
  • 367-373: > 📝 NOTE

This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [370-399]

The renaming of event types within the TestMsgServer_AcceptDTagTransfer function to EventTypeAcceptedDTagTransferRequest is correctly implemented and enhances the codebase's clarity and maintainability. This change aligns with the PR's objectives and follows best practices for naming conventions.

  • 437-437: The consistent renaming of event types within the TestMsgServer_AcceptDTagTransfer function further aligns with the PR's objectives to improve clarity and maintainability. The changes are correctly implemented and follow the established naming conventions.
  • 514-514: The update in the TestMsgServer_RefuseDTagTransfer function, where event types have been renamed to EventTypeRefusedDTagTransferRequest, correctly reflects the action being performed and aligns with the PR's goal of enhancing clarity through better naming conventions. This change is in line with the PR's objectives and follows established best practices.
x/profiles/keeper/keeper_app_links_test.go (5)
  • 65-65: The event type EventTypeSavedApplicationLink correctly reflects the action of saving an application link, aligning with the semantic changes mentioned in the PR objectives.
  • 425-425: The event type EventTypeDeletedApplicationLink accurately represents the deletion of an application link, which is consistent with the renaming strategy outlined in the PR objectives.
  • 479-479: The usage of EventTypeDeletedApplicationLink here also correctly signifies the deletion action in a test case scenario, adhering to the new naming conventions.
  • 533-533: Again, EventTypeDeletedApplicationLink is used appropriately to denote the deletion of an application link in a different test scenario, maintaining consistency with the renaming effort.
  • 587-587: The event type EventTypeDeletedApplicationLink is consistently applied across different test scenarios, including this one, which tests the deletion functionality under various conditions.
x/posts/keeper/msg_server.go (12)
  • 10-10: The import of the github.com/desmos-labs/desmos/v6/types/utils package is correctly added to support the new utility functions introduced in the PR.
  • 109-111: The renaming of the event type to EventTypeCreatedPost and the update of attribute keys are in line with the semantic changes described in the PR objectives. This enhances clarity and consistency across the codebase.
  • 163-164: The event type EventTypeEditedPost correctly reflects the action of editing a post, aligning with the semantic updates aimed at improving clarity in the codebase.
  • 202-203: The use of EventTypeDeletedPost for the deletion of a post is consistent with the renaming strategy for event types, improving semantic clarity.
  • 302-303: The event type EventTypeAddedPostAttachment accurately represents the addition of a post attachment, adhering to the new naming conventions for better clarity.
  • 359-360: Similarly, EventTypeRemovedPostAttachment is used appropriately to denote the removal of a post attachment, following the updated event naming conventions.
  • 438-445: The introduction of EventTypeAnsweredPoll with attributes for AnswersIndexes and Answerer is a significant addition. However, the use of utils.Map for converting msg.AnswersIndexes to a string list is a good practice for handling such data transformations. This change enhances the event's descriptive quality by including detailed information about the poll answers.
  • 540-541: The event type EventTypeMovedPost along with the new attributes for NewSubspaceID and NewPostID correctly reflects the action of moving a post to a different subspace or section. This change is part of the semantic updates to event types and attributes, improving clarity and consistency.
  • 596-597: The event type EventTypeRequestedPostOwnerTransfer is introduced to denote the action of requesting a post owner transfer. This addition aligns with the PR's objectives to enhance functionality and improve semantic clarity in the codebase.
  • 627-628: EventTypeCanceledPostOwnerTransfer is used to represent the cancellation of a post owner transfer request. This naming convention is consistent with the PR's goal of improving semantic clarity and functionality.
  • 683-684: The use of EventTypeAcceptedPostOwnerTransfer for accepting a post owner transfer request is in line with the semantic updates and enhances the clarity of the codebase by accurately describing the action taken.
  • 713-714: Finally, EventTypeRefusedPostOwnerTransfer correctly denotes the refusal of a post owner transfer request, adhering to the updated naming conventions and improving the semantic clarity of the codebase.
x/reports/keeper/msg_server_test.go (9)
  • 283-284: The event type CreateReport has been correctly renamed to CreatedReport, aligning with the PR's objective to enhance semantic clarity across the codebase. This change is consistent and correctly implemented here.
  • 290-291: The event type ReportUser has been updated to ReportedUser, which is in line with the PR's goal of improving semantic accuracy. This renaming enhances the clarity of the event's purpose.
  • 379-380: The event type CreateReport has been renamed to CreatedReport for a post target scenario. This change is consistent with the PR's objectives and correctly applied, improving the semantic clarity of the event type.
  • 386-387: The renaming of the event type from ReportPost to ReportedPost is correctly implemented here, aligning with the PR's objectives to enhance semantic clarity and consistency across the codebase.
  • 594-595: The event type DeleteReport has been updated to DeletedReport, which correctly reflects the action that has occurred. This change is in line with the PR's objectives and is correctly implemented.
  • 636-637: The event type DeleteReport has been correctly renamed to DeletedReport in the context of a moderator action. This renaming aligns with the PR's goal of improving semantic accuracy and clarity.
  • 801-802: The event type SupportStandardReason has been updated to SupportedStandardReason, which is consistent with the PR's objectives to enhance semantic clarity. This change is correctly implemented and improves the readability of the event type.
  • 979-980: The event type AddReason has been renamed to AddedReportingReason, aligning with the PR's objectives to improve semantic clarity and consistency. This change is correctly implemented and enhances the understanding of the event's purpose.
  • 1118-1119: The event type RemoveReason has been updated to RemovedReportingReason, which is consistent with the PR's objectives to enhance semantic clarity. This change is correctly implemented and improves the readability of the event type.
x/reactions/keeper/msg_server_test.go (7)
  • 6-7: The import of subspacestypes and poststypes packages reflects the changes in the codebase to use updated event types and attribute keys. This aligns with the PR's objective to enhance consistency across modules.
  • 421-423: The event type and attribute keys in the TestMsgServer_AddReaction method have been correctly updated to use the new constants from subspacestypes and poststypes. This change ensures that the tests reflect the updated event naming conventions and attribute keys, maintaining consistency with the rest of the codebase.
  • 785-787: The event type and attribute keys in the TestMsgServer_RemoveReaction method have been correctly updated to use the new constants from subspacestypes and poststypes. This ensures that the tests are aligned with the changes made in the codebase, accurately reflecting the new event naming conventions and attribute keys.
  • 952-953: The event type and attribute keys in the TestMsgServer_AddRegisteredReaction method have been correctly updated to use the new constants from subspacestypes. This change ensures that the tests accurately reflect the updated event naming conventions and attribute keys, maintaining consistency with the rest of the codebase.
  • 1143-1143: The event type and attribute keys in the TestMsgServer_EditRegisteredReaction method have been correctly updated to use the new constants from subspacestypes. This ensures that the tests accurately reflect the updated event naming conventions and attribute keys, maintaining consistency with the rest of the codebase.
  • 1286-1287: The event type and attribute keys in the TestMsgServer_RemoveRegisteredReaction method have been correctly updated to use the new constants from subspacestypes. This ensures that the tests accurately reflect the updated event naming conventions and attribute keys, maintaining consistency with the rest of the codebase.
  • 1420-1420: The event type in the TestMsgServer_SetReactionsParams method has been correctly updated to reflect the changes in the codebase. This ensures that the tests are aligned with the new event naming conventions, maintaining consistency across the project.
x/subspaces/keeper/msg_server.go (20)
  • 6-6: The import of the "strings" package is added, which is necessary for the new functionality introduced in this file, specifically for joining permissions into a string in the SetUserGroupPermissions method.
  • 55-55: The event type types.EventTypeCreateSubspace has been correctly updated to types.EventTypeCreatedSubspace to reflect past tense, aligning with the PR's objective to improve clarity and consistency across the codebase.
  • 100-100: The event type types.EventTypeEditSubspace has been correctly updated to types.EventTypeEditedSubspace. This change is consistent with the PR's goal of renaming event types for clarity.
  • 132-132: The event type types.EventTypeDeleteSubspace has been updated to types.EventTypeDeletedSubspace, which is in line with the PR's objectives to use past tense for event types.
  • 185-185: The event type types.EventTypeCreateSection has been updated to types.EventTypeCreatedSection. This change enhances consistency and clarity in the codebase.
  • 234-234: The event type types.EventTypeEditSection has been updated to types.EventTypeEditedSection, aligning with the PR's goal of improving clarity through consistent naming conventions.
  • 290-290: The event type types.EventTypeMoveSection has been updated to types.EventTypeMovedSection. This change is consistent with the PR's objectives and improves the clarity of the event naming.
  • 328-328: The event type types.EventTypeDeleteSection has been updated to types.EventTypeDeletedSection, which aligns with the PR's objectives to use past tense for event types, enhancing clarity.
  • 404-404: The event type types.EventTypeCreateUserGroup has been updated to types.EventTypeCreatedUserGroup. This change aligns with the PR's goal of renaming event types for consistency and clarity.
  • 450-450: The event type types.EventTypeEditUserGroup has been updated to types.EventTypeEditedUserGroup, which is consistent with the PR's objectives to improve clarity through consistent naming conventions.
  • 559-559: The use of the "strings" package for joining permissions into a string is appropriate and aligns with the added import. This change is necessary for the functionality introduced in this method.
  • 596-596: The event type types.EventTypeDeleteUserGroup has been correctly updated to types.EventTypeDeletedUserGroup, aligning with the PR's objective to use past tense for event types.
  • 645-645: The event type types.EventTypeAddUserToGroup has been updated to types.EventTypeAddedUserToGroup. This change is consistent with the PR's goal of improving clarity through consistent naming conventions.
  • 690-690: The event type types.EventTypeRemoveUserFromGroup has been updated to types.EventTypeRemovedUserFromGroup, which aligns with the PR's objectives to use past tense for event types, enhancing clarity.
  • 742-742: The use of the "strings" package for joining permissions into a string in the SetUserPermissions method is appropriate and aligns with the added import. This change is necessary for the functionality introduced in this method.
  • 785-785: The event type types.EventTypeGrantTreasuryAuthorization has been updated to types.EventTypeGrantedTreasuryAuthorization, aligning with the PR's objective to use past tense for event types, which enhances clarity.
  • 823-823: The event type types.EventTypeRevokeTreasuryAuthorization has been updated to types.EventTypeRevokedTreasuryAuthorization, which is consistent with the PR's goal of renaming event types for clarity.
  • 852-852: The event type types.EventTypeGrantAllowance has been updated to types.EventTypeGrantedAllowance. This change aligns with the PR's goal of improving clarity through consistent naming conventions.
  • 911-911: The event type types.EventTypeRevokeAllowance has been updated to types.EventTypeRevokedAllowance, which is consistent with the PR's objectives to use past tense for event types, enhancing clarity.
  • 963-963: The event type types.EventTypeUpdateSubspaceFeeToken has been updated to types.EventTypeUpdatedSubspaceFeeToken, aligning with the PR's objective to use past tense for event types, which enhances clarity.
x/posts/keeper/msg_server_test.go (13)
  • 367-369: The event attributes use the correct keys after the renaming, ensuring consistency with the updated event types and attribute keys.
  • 483-485: The event attributes use the correct keys after the renaming, ensuring consistency with the updated event types and attribute keys.
  • 770-771: The event attributes use the correct keys after the renaming, ensuring consistency with the updated event types and attribute keys.
  • 971-972: The event attributes use the correct keys after the renaming, ensuring consistency with the updated event types and attribute keys.
  • 1263-1264: The event attributes use the correct keys after the renaming, ensuring consistency with the updated event types and attribute keys.
  • 1587-1588: The event attributes use the correct keys after the renaming, ensuring consistency with the updated event types and attribute keys.
  • 2191-2192: The event attributes use the correct keys after the renaming, ensuring consistency with the updated event types and attribute keys.
  • 2274-2275: The event attributes use the correct keys after the renaming, ensuring consistency with the updated event types and attribute keys.
  • 2773-2774: The event attributes use the correct keys after the renaming, ensuring consistency with the updated event types and attribute keys.
  • 3162-3163: The event attributes use the correct keys after the renaming, ensuring consistency with the updated event types and attribute keys.
  • 3271-3272: The event attributes use the correct keys after the renaming, ensuring consistency with the updated event types and attribute keys.
  • 3511-3512: The event attributes use the correct keys after the renaming, ensuring consistency with the updated event types and attribute keys.
  • 3606-3607: The event attributes use the correct keys after the renaming, ensuring consistency with the updated event types and attribute keys.

x/subspaces/keeper/msg_server.go Outdated Show resolved Hide resolved
Signed-off-by: Riccardo Montagnin <[email protected]>
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.

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between fbc442c and 75fb5e6.
Files selected for processing (1)
  • x/subspaces/types/events.go (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • x/subspaces/types/events.go

Signed-off-by: Riccardo Montagnin <[email protected]>
x/reports/types/events.go Outdated Show resolved Hide resolved
x/reports/types/events.go Outdated Show resolved Hide resolved
x/profiles/types/events.go Outdated Show resolved Hide resolved
x/profiles/spec/05-events.md Outdated Show resolved Hide resolved
x/profiles/spec/05-events.md Outdated Show resolved Hide resolved
x/profiles/spec/05-events.md Outdated Show resolved Hide resolved
@dadamu
Copy link
Contributor

dadamu commented Feb 5, 2024

Overall looks good to me, just some naming unconsistency.

x/posts/types/models.go Outdated Show resolved Hide resolved
Signed-off-by: Riccardo Montagnin <[email protected]>
Signed-off-by: Riccardo Montagnin <[email protected]>
@RiccardoM RiccardoM requested a review from dadamu February 7, 2024 13:36
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.

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 75fb5e6 and c298114.
Files selected for processing (8)
  • x/profiles/keeper/msg_server_dtag_transfers.go (4 hunks)
  • x/profiles/keeper/msg_server_dtag_transfers_test.go (6 hunks)
  • x/profiles/spec/05-events.md (2 hunks)
  • x/profiles/types/events.go (1 hunks)
  • x/reports/types/events.go (1 hunks)
  • x/subspaces/keeper/msg_server.go (24 hunks)
  • x/subspaces/keeper/msg_server_test.go (25 hunks)
  • x/subspaces/types/events.go (1 hunks)
Files skipped from review as they are similar to previous changes (8)
  • x/profiles/keeper/msg_server_dtag_transfers.go
  • x/profiles/keeper/msg_server_dtag_transfers_test.go
  • x/profiles/spec/05-events.md
  • x/profiles/types/events.go
  • x/reports/types/events.go
  • x/subspaces/keeper/msg_server.go
  • x/subspaces/keeper/msg_server_test.go
  • x/subspaces/types/events.go

Signed-off-by: Riccardo Montagnin <[email protected]>
@RiccardoM RiccardoM merged commit 9cf83a8 into master Feb 7, 2024
18 of 26 checks passed
@RiccardoM RiccardoM deleted the riccardom/fix-events-emission branch February 7, 2024 16:15
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.

Review Status

Actionable comments generated: 1

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between c298114 and 019ffa1.
Files selected for processing (1)
  • .changeset/entries/22c2a6c7f91416899301d06b3b3a7a6bb3a324e0d8575cd332a3558e4eb7e8f0.yaml (1 hunks)

type: refactor
module: other
pull_request: 1295
description: Updated the event andattributes names for better naming consistency
Copy link
Contributor

Choose a reason for hiding this comment

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

Typo in "andattributes" should be "and attributes".

- description: Updated the event andattributes names for better naming consistency
+ description: Updated the event and attributes names for better naming consistency

Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
description: Updated the event andattributes names for better naming consistency
description: Updated the event and attributes names for better naming consistency

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
x/profiles Module that allows to create and manage decentralized social profiles x/relationships x/subspaces Issue on the x/subspaces module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants