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

fix: (webAPI): Add revision to search dto (ServiceOwner) #1216

Merged
merged 2 commits into from
Oct 2, 2024

Conversation

oskogstad
Copy link
Collaborator

@oskogstad oskogstad commented Oct 2, 2024

Description

Related Issue(s)

Verification

  • Your code builds clean without any errors or warnings
  • Manual testing done (required)
  • Relevant automated test added (if you find this hard, leave it and we'll help out)

Documentation

  • Documentation is updated (either in docs-directory, Altinnpedia or a separate linked PR in altinn-studio-docs., if applicable)

Copy link
Contributor

coderabbitai bot commented Oct 2, 2024

📝 Walkthrough

Walkthrough

The changes introduced in this pull request involve modifications to the OpenAPI schema for the Dialogporten API and updates to the mapping configurations in the application. Key updates include the addition of a revision property to the SearchDialogDto and SearchDialogDtoSO schemas, a deletedAt property to the GetDialogDto and GetDialogDtoSO schemas, and an isAuthorized property to the GetDialogTransmissionDto and GetDialogTransmissionDtoSO schemas. Additionally, the mapping for the Revision property was removed from the MappingProfile, and the SearchDialogDtoBase class was updated to include the new Revision property.

Changes

File Path Change Summary
docs/schema/V1/swagger.verified.json Added revision property to SearchDialogDto and SearchDialogDtoSO schemas. Added deletedAt property to GetDialogDto and GetDialogDtoSO schemas. Added isAuthorized property to GetDialogTransmissionDto and GetDialogTransmissionDtoSO schemas.
src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/Dialogs/Queries/Get/MappingProfile.cs Removed mapping configuration for Revision property from DialogEntity to GetDialogDto.
src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/Dialogs/Queries/Search/SearchDialogDtoBase.cs Added public Guid Revision { get; set; } property to SearchDialogDtoBase class.

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

@oskogstad oskogstad changed the title [DRAFT] feat(webAPI): Add revision to search dto (ServiceOwner) feat(webAPI): Add revision to search dto (ServiceOwner) Oct 2, 2024
@oskogstad oskogstad marked this pull request as ready for review October 2, 2024 17:09
@oskogstad oskogstad requested a review from a team as a code owner October 2, 2024 17:09
Copy link

sonarqubecloud bot commented Oct 2, 2024

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

📥 Commits

Files that changed from the base of the PR and between f2e68e8 and e293fce.

📒 Files selected for processing (3)
  • docs/schema/V1/swagger.verified.json (1 hunks)
  • src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/Dialogs/Queries/Get/MappingProfile.cs (0 hunks)
  • src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/Dialogs/Queries/Search/SearchDialogDtoBase.cs (1 hunks)
💤 Files with no reviewable changes (1)
  • src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/Dialogs/Queries/Get/MappingProfile.cs
🔇 Additional comments (2)
src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/Dialogs/Queries/Search/SearchDialogDtoBase.cs (1)

22-27: Verify the impact of the Revision property on related components.

The addition of the Revision property to SearchDialogDtoBase is well-implemented. However, it's important to ensure that this change is properly reflected in any related components of the system.

Please run the following script to check for any potential impacts:

This script will help identify any areas of the codebase that might need to be updated to accommodate the new Revision property. Please review the results and make any necessary adjustments.

✅ Verification successful

The addition of the Revision property does not impact related components.

All mapping configurations, serialization/deserialization logic, database queries, ORM configurations, and API controllers or service methods have been checked and show no adverse effects from this change.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for potential impacts of adding the Revision property

# Test 1: Check for any mapping configurations that might need updating
echo "Checking for mapping configurations:"
rg --type csharp "CreateMap.*SearchDialogDtoBase" -A 10

# Test 2: Check for any serialization/deserialization logic that might need updating
echo "Checking for serialization/deserialization logic:"
rg --type csharp "JsonSerializer.Serialize.*SearchDialogDtoBase|JsonSerializer.Deserialize.*SearchDialogDtoBase"

# Test 3: Check for any database queries or ORM configurations that might need updating
echo "Checking for database queries or ORM configurations:"
rg --type csharp "SearchDialogDtoBase" -A 10 | rg "DbSet|Table|Column"

# Test 4: Check for any API controllers or service methods that use SearchDialogDtoBase
echo "Checking for API controllers or service methods:"
rg --type csharp "SearchDialogDtoBase" -A 10 | rg "Controller|Service"

Length of output: 4441

docs/schema/V1/swagger.verified.json (1)

3268-3273: LGTM: Addition of revision property to SearchDialogDtoSO

The revision property has been correctly added to the SearchDialogDtoSO schema as mentioned in the AI summary. This addition enhances the schema by including a unique identifier for the revision in UUIDv4 format.

Comment on lines +22 to +27
/// <summary>
/// The unique identifier for the revision in UUIDv4 format.
/// </summary>
/// <example>a312cb9c-7632-43c2-aa38-69b06aed56ca</example>
public Guid Revision { get; set; }

Copy link
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick (assertive)

LGTM! Consider adding a note about the UUIDv4 format.

The addition of the Revision property is well-implemented and aligns with the PR objective. The use of Guid is appropriate for a unique identifier, and the XML documentation provides clear information about the property's purpose.

Consider adding a note in the XML documentation to clarify why UUIDv4 is used for the revision instead of UUIDv7, which is used for the Id property. This would help developers understand the reasoning behind the different UUID versions.

 /// <summary>
-/// The unique identifier for the revision in UUIDv4 format.
+/// The unique identifier for the revision in UUIDv4 format. UUIDv4 is used for revisions to distinguish them from the UUIDv7 used for the main Id.
 /// </summary>
 /// <example>a312cb9c-7632-43c2-aa38-69b06aed56ca</example>
 public Guid Revision { get; set; }
📝 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. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
/// <summary>
/// The unique identifier for the revision in UUIDv4 format.
/// </summary>
/// <example>a312cb9c-7632-43c2-aa38-69b06aed56ca</example>
public Guid Revision { get; set; }
/// <summary>
/// The unique identifier for the revision in UUIDv4 format. UUIDv4 is used for revisions to distinguish them from the UUIDv7 used for the main Id.
/// </summary>
/// <example>a312cb9c-7632-43c2-aa38-69b06aed56ca</example>
public Guid Revision { get; set; }

@oskogstad oskogstad changed the title feat(webAPI): Add revision to search dto (ServiceOwner) fix: (webAPI): Add revision to search dto (ServiceOwner) Oct 2, 2024
@oskogstad oskogstad merged commit 3b6d130 into main Oct 2, 2024
25 checks passed
@oskogstad oskogstad deleted the feat/add-revision-on-so-dialog-search-dto branch October 2, 2024 17:15
oskogstad pushed a commit that referenced this pull request Oct 2, 2024
🤖 I have created a release *beep* *boop*
---


##
[1.20.2](v1.20.1...v1.20.2)
(2024-10-02)


### Bug Fixes

* (webAPI): Add revision to search dto (ServiceOwner)
([#1216](#1216))
([3b6d130](3b6d130))
* **graphQL:** GraphQL subscription not notified on
DialogActivityCreated
([#1187](#1187))
([f28e291](f28e291))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
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