-
-
Notifications
You must be signed in to change notification settings - Fork 113
chore(runtime): replace traverse dependency #2160
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
Conversation
📝 WalkthroughWalkthroughThe changes replace usage of the external Changes
Sequence Diagram(s)sequenceDiagram
participant Caller
participant simpleTraverse
participant Callback
Caller->>simpleTraverse: Call with (root, cb)
loop For each node in object tree
simpleTraverse->>Callback: cb({ path, key, value, update })
alt Callback calls update
Callback-->>simpleTraverse: update(newValue)
simpleTraverse-->>simpleTraverse: Replace node value, skip children
else Callback does not call update
simpleTraverse-->>simpleTraverse: Continue traversal into children
end
end
simpleTraverse-->>Caller: Return updated root object
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms (6)
✨ Finishing Touches
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed 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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (2)
packages/runtime/package.json
is excluded by!**/*.json
pnpm-lock.yaml
is excluded by!**/pnpm-lock.yaml
,!**/*.yaml
📒 Files selected for processing (4)
packages/runtime/src/enhancements/node/delegate.ts
(2 hunks)packages/runtime/src/enhancements/node/policy/policy-utils.ts
(2 hunks)packages/runtime/src/local-helpers/index.ts
(1 hunks)packages/runtime/src/local-helpers/simple-traverse.ts
(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (7)
- GitHub Check: build-test (20.x)
- GitHub Check: build-test (20.x)
- GitHub Check: OSSAR-Scan
- GitHub Check: build-test (20.x)
- GitHub Check: dependency-review
- GitHub Check: Analyze (javascript-typescript)
- GitHub Check: GitGuardian Security Checks
🔇 Additional comments (7)
packages/runtime/src/local-helpers/simple-traverse.ts (2)
23-31
: Review update function behaviorThe update function correctly prevents further traversal when called (
keepGoing = false
) and only allows updates when there's a parent. The logic looks sound for preventing infinite loops during updates.
17-18
: Verify circular reference detection logicThe circular reference detection compares object identity using
===
. This should work correctly for detecting when the same object appears multiple times in the traversal path.#!/bin/bash # Search for any existing circular reference handling patterns in the codebase rg -A 3 -B 3 "circular|cycle" --type tspackages/runtime/src/local-helpers/index.ts (1)
1-1
: LGTM: Clean export additionThe export follows the established pattern and makes
simpleTraverse
available to other modules in the codebase.packages/runtime/src/enhancements/node/delegate.ts (1)
16-16
: Verify import path and availabilityEnsure the
simpleTraverse
import is correctly resolved from the local helpers.#!/bin/bash # Verify the simpleTraverse function is properly exported and can be imported fd "index.ts" packages/runtime/src/local-helpers/ --exec cat {}packages/runtime/src/enhancements/node/policy/policy-utils.ts (3)
17-17
: LGTM: Clean dependency replacementGood addition of the local
simpleTraverse
utility to replace the external traverse dependency.
705-712
: Clean conversion of delegate constraint resolutionThe conversion from
traverse(result).forEach()
tosimpleTraverse(result, callback)
maintains the same logic for resolving delegate constraints. The destructured callback parameters{ value, update }
provide a clean API.
693-703
: ```shell
#!/bin/bashLocate all occurrences of simpleTraverse to find its implementation
rg -n "simpleTraverse" -C5 packages/runtime/src
</details> </blockquote></details> </details> <!-- This is an auto-generated comment by CodeRabbit for review status -->
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @DoctorFTB , LGTM!
Replace traverse dependency as it has over 60+ dependencies..
You can find the change history in the commits.
Feel free to squash commits.