Skip to content

JCN-518: Actualizar README para sacar nota de doble wildcard#29

Merged
jormaechea merged 1 commit intomasterfrom
JCN-518-update-readme-file
Jul 11, 2025
Merged

JCN-518: Actualizar README para sacar nota de doble wildcard#29
jormaechea merged 1 commit intomasterfrom
JCN-518-update-readme-file

Conversation

@lautaro-echeverria
Copy link
Copy Markdown
Contributor

@lautaro-echeverria lautaro-echeverria commented Jul 2, 2025

Historia de usuario

https://janiscommerce.atlassian.net/browse/JCN-517

Sub-tarea

https://janiscommerce.atlassian.net/browse/JCN-518

Descripcion del requerimiento

Actualizar archivo README del paquete @janiscommerce/model para generar confusiones redundantes sobre el uso del doble wildcard.

Descripcion de la solucion

  • Se actualizo archivo README para ser mas especificos sobre el uso del doble wildcard, dando ejemplos y no mencionando que funciona igual utilizando la field unica
  • Se modifico un test para funcionar como el ejemplo del archivo README

Summary by CodeRabbit

  • Documentation

    • Improved examples and explanations for excluding sensitive nested fields from logs, clarifying wildcard usage and updating sample data and output.
  • Tests

    • Updated tests to verify exclusion of a different nested field pattern in logs, ensuring correct handling of wildcard exclusions.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Jul 2, 2025

📝 Walkthrough

Walkthrough

The documentation and related test for excluding fields from logs were updated to demonstrate and verify the exclusion of a different nested field using wildcard patterns. The example now focuses on excluding the specialNotes field under any preferences subpath, with corresponding changes in both the documentation and test data.

Changes

Files Change Summary
README.md Updated documentation and examples for excluding nested fields from logs, focusing on specialNotes.
tests/model.js Modified test to verify exclusion of specialNotes under any preferences subpath using wildcards.

Sequence Diagram(s)

sequenceDiagram
    participant Model
    participant Logger

    Model->>Logger: Prepare data for logging
    Logger->>Logger: Exclude fields matching patterns (e.g., *.preferences.**.specialNotes)
    Logger-->>Model: Return sanitized log data
Loading

Possibly related PRs

Suggested labels

documentation, enhancement

Poem

In the warren of logs, where secrets might hide,
The rabbit hops in, with patterns as guide.
"specialNotes" now vanished, with wildcards in tow,
Leaving addresses visible, for all logs to show.
🐇✨

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ast-grep (0.38.1)
tests/model.js

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ 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.
    • Explain this complex logic.
    • 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 explain this code block.
    • @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 explain its main purpose.
    • @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.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

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 sequence diagram to generate a sequence diagram of the changes in this 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.

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.

@coderabbitai coderabbitai bot added documentation Improvements or additions to documentation enhancement New feature or request labels Jul 2, 2025
Copy link
Copy Markdown

@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

🧹 Nitpick comments (1)
README.md (1)

843-843: Fix markdown formatting issues.

The static analysis tool has flagged hard tabs in the markdown file. Please replace the hard tabs with spaces for consistent formatting.

-	<summary>You can exclude fields for logs in case you have sensitive information in your entries such as passwords, secondFactor, etc.</summary>
+    <summary>You can exclude fields for logs in case you have sensitive information in your entries such as passwords, secondFactor, etc.</summary>

-			'preferences.**.specialNotes', // Exclude the specialNotes field without knowing the intermediate field path between such field and the root path
+            'preferences.**.specialNotes', // Exclude the specialNotes field without knowing the intermediate field path between such field and the root path

-	preferences: {
-		shippingDetails: {
-			specialNotes: 'some shipping notes'
-		}
-	}
+    preferences: {
+        shippingDetails: {
+            specialNotes: 'some shipping notes'
+        }
+    }

-	preferences: {
-		shippingDetails: {}
-	}
-	location: {
-		country: 'some-country',
-		address: 'some-address'
+    preferences: {
+        shippingDetails: {}
+    }
+    location: {
+        country: 'some-country',
+        address: 'some-address'

Also applies to: 852-852, 866-870, 906-912

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 46ec6f3 and a24f345.

📒 Files selected for processing (2)
  • README.md (6 hunks)
  • tests/model.js (2 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
`**/*.js`: Never report errors of the following categories `lint/suspicious/noRe...

**/*.js: Never report errors of the following categories lint/suspicious/noRedundantUseStrict, lint/complexity/noThisInStatic, lint/complexity/noStaticOnlyClass, reported by Biome.

⚙️ Source: CodeRabbit Configuration File

List of files the instruction was applied to:

  • tests/model.js
🧠 Learnings (2)
README.md (1)
Learnt from: lautaro-echeverria
PR: janis-commerce/model#28
File: lib/helpers/log.js:33-36
Timestamp: 2025-05-13T18:17:19.791Z
Learning: In the @janiscommerce/model package, the `omitRecursive` function in `lib/helpers/utils.js` expects an array of string patterns as its second parameter. If a non-array value is passed, it will return a clone of the original object without excluding any fields.
tests/model.js (1)
Learnt from: lautaro-echeverria
PR: janis-commerce/model#28
File: lib/helpers/log.js:33-36
Timestamp: 2025-05-13T18:17:19.791Z
Learning: In the @janiscommerce/model package, the `omitRecursive` function in `lib/helpers/utils.js` expects an array of string patterns as its second parameter. If a non-array value is passed, it will return a clone of the original object without excluding any fields.
🪛 markdownlint-cli2 (0.17.2)
README.md

843-843: Hard tabs
Column: 1

(MD010, no-hard-tabs)


852-852: Hard tabs
Column: 1

(MD010, no-hard-tabs)


866-866: Hard tabs
Column: 1

(MD010, no-hard-tabs)


867-867: Hard tabs
Column: 1

(MD010, no-hard-tabs)


868-868: Hard tabs
Column: 1

(MD010, no-hard-tabs)


869-869: Hard tabs
Column: 1

(MD010, no-hard-tabs)


870-870: Hard tabs
Column: 1

(MD010, no-hard-tabs)


906-906: Hard tabs
Column: 1

(MD010, no-hard-tabs)


907-907: Hard tabs
Column: 1

(MD010, no-hard-tabs)


908-908: Hard tabs
Column: 1

(MD010, no-hard-tabs)


909-909: Hard tabs
Column: 1

(MD010, no-hard-tabs)


910-910: Hard tabs
Column: 1

(MD010, no-hard-tabs)


911-911: Hard tabs
Column: 1

(MD010, no-hard-tabs)

🔇 Additional comments (8)
tests/model.js (3)

867-867: LGTM! Test exclusion pattern updated to match documentation.

The change from '**.address' to '*.preferences.**.specialNotes' correctly aligns the test with the updated README example, demonstrating proper double wildcard usage for excluding nested fields without knowing the complete intermediate path.


875-879: LGTM! Test data structure matches the new documentation example.

The added preferences.shippingDetails.specialNotes structure is consistent with the updated exclusion pattern example in the README, ensuring the test validates the correct behavior.


888-894: LGTM! Expected output correctly reflects the new exclusion pattern.

The expected logged output properly shows:

  • preferences.shippingDetails becomes an empty object {} (specialNotes excluded)
  • location.address remains in the output (no longer excluded)

This validates that the field exclusion mechanism works as documented.

README.md (5)

161-161: LGTM! Link reference improvement.

The updated link reference provides better navigation to the specific section about excluding fields from logs.


852-852: LGTM! Improved example demonstrates double wildcard usage more clearly.

The change from '**.address' to 'preferences.**.specialNotes' provides a better example of when to use the double wildcard pattern - when you need to exclude a specific nested field without knowing the complete intermediate path structure.


866-870: LGTM! Example data structure supports the new exclusion pattern.

The updated example data with preferences.shippingDetails.specialNotes effectively demonstrates the scenario where the double wildcard pattern is useful.


906-912: LGTM! Logged output example correctly shows the exclusion behavior.

The updated example output clearly demonstrates that:

  • The specialNotes field is excluded (empty object at preferences.shippingDetails)
  • Other fields like location.address remain visible
  • The double wildcard pattern works as intended

936-936: LGTM! Clearer explanation of double wildcard usage.

The updated note better explains that ** is used when the intermediate field path is unknown between the root and the target field.

@lautaro-echeverria lautaro-echeverria changed the title JCN-518: Permita ocultar logs de secondFactor del shipping JCN-518: Actualizar README package Model para sacar nota de doble wildcard Jul 2, 2025
@lautaro-echeverria lautaro-echeverria changed the title JCN-518: Actualizar README package Model para sacar nota de doble wildcard JCN-518: Actualizar README para sacar nota de doble wildcard Jul 2, 2025
@jormaechea jormaechea merged commit 725eee2 into master Jul 11, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants