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

Create audit trail for crUpdateFields #269

Merged

Conversation

MatthewErispe
Copy link
Collaborator

@MatthewErispe MatthewErispe commented Jul 8, 2024

Summary by CodeRabbit

  • New Features

    • Enhanced audit capabilities: Now logs update events for better tracking.
  • Bug Fixes

    • Corrected HTTP method from PATCH to POST for better compliance and functionality.
  • Refactor

    • Renamed methods and updated references to align with the corrected HTTP method changes.

@rcrichton
Copy link
Member

Copy link
Contributor

coderabbitai bot commented Jul 8, 2024

Walkthrough

The recent updates introduced several key modifications across different components of the JeMPI application. The ProxyRoutes class changed its HTTP method from PATCH to POST for the proxyPatchCrUpdateFieldsDoIt method. The LibMPI update added audit event logic in the updateGoldenRecordField method. A new UPDATE_EVENT enum was added in GlobalConstants. Additionally, method references were updated to reflect the new HTTP method change in the Linker component classes.

Changes

File Path Change Summary
...empi/libapi/ProxyRoutes.java Changed HTTP method from PATCH to POST in proxyPatchCrUpdateFieldsDoIt.
...bempi/libmpi/LibMPI.java Added logic to send an audit event in updateGoldenRecordField method.
...empi/shared/models/GlobalConstants.java Added UPDATE_EVENT to AuditEventType enum.
...empi/linker/Ask.java Renamed method patchCrUpdateField to postCrUpdateField.
...empi/linker/Routes.java Updated proxyPostCrUpdateField to call postCrUpdateField instead of patchCrUpdateField.

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant ProxyRoutes
    participant LibMPI
    participant AuditService

    Client->>ProxyRoutes: POST /updateField
    ProxyRoutes->>LibMPI: updateGoldenRecordField(goldenId, fieldName, newValue)
    LibMPI-->>ProxyRoutes: success/failure
    LibMPI->>AuditService: auditEvent(UPDATE_EVENT, result)
    ProxyRoutes-->>Client: update result
Loading

Poem

A tweak, a change, a POST instead,
The golden record's fields are fed.
Audit trails in shadows lurk,
Keeping logs with careful work.
A coder's realm, a dance of bytes,
In quiet lines, our code ignites. 🌟🐇


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

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

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

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

CodeRabbit Commands (invoked as PR comments)

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

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

CodeRabbit Configration File (.coderabbit.yaml)

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

Documentation and Community

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

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between f4021dc and 92555e8.

Files selected for processing (5)
  • JeMPI_Apps/JeMPI_LibAPI/src/main/java/org/jembi/jempi/libapi/ProxyRoutes.java (1 hunks)
  • JeMPI_Apps/JeMPI_LibMPI/src/main/java/org/jembi/jempi/libmpi/LibMPI.java (1 hunks)
  • JeMPI_Apps/JeMPI_LibShared/src/main/java/org/jembi/jempi/shared/models/GlobalConstants.java (1 hunks)
  • JeMPI_Apps/JeMPI_Linker/src/main/java/org/jembi/jempi/linker/Ask.java (1 hunks)
  • JeMPI_Apps/JeMPI_Linker/src/main/java/org/jembi/jempi/linker/Routes.java (1 hunks)
Files skipped from review due to trivial changes (1)
  • JeMPI_Apps/JeMPI_LibAPI/src/main/java/org/jembi/jempi/libapi/ProxyRoutes.java
Additional comments not posted (4)
JeMPI_Apps/JeMPI_LibShared/src/main/java/org/jembi/jempi/shared/models/GlobalConstants.java (1)

81-82: Addition of UPDATE_EVENT to the AuditEventType enum looks good.

The addition is consistent with existing enum constants.

JeMPI_Apps/JeMPI_Linker/src/main/java/org/jembi/jempi/linker/Ask.java (1)

Line range hint 136-141:
Addition of postCrUpdateField method looks good.

The method is consistent with existing methods and correctly integrated.

JeMPI_Apps/JeMPI_LibMPI/src/main/java/org/jembi/jempi/libmpi/LibMPI.java (1)

294-302: Implementation of audit logging in updateGoldenRecordField method looks good.

The audit logging is correctly integrated and consistent with existing code.

JeMPI_Apps/JeMPI_Linker/src/main/java/org/jembi/jempi/linker/Routes.java (1)

Line range hint 281-291:
Update in proxyPostCrUpdateField method looks good.

The method is correctly updated and integrated with existing code.

Copy link
Contributor

@martino-jembi martino-jembi left a comment

Choose a reason for hiding this comment

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

Looking good to me @MatthewErispe

@MatthewErispe MatthewErispe merged commit 9963b83 into dev Jul 9, 2024
5 checks passed
@MatthewErispe MatthewErispe deleted the CU-86bya4d64_Create-audit-trail-for-crUpdateFields branch July 9, 2024 13:09
@MatthewErispe MatthewErispe restored the CU-86bya4d64_Create-audit-trail-for-crUpdateFields branch July 9, 2024 13:09
@MatthewErispe MatthewErispe deleted the CU-86bya4d64_Create-audit-trail-for-crUpdateFields branch July 9, 2024 13:09
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.

3 participants