feat(jay): create skeleton walk and run sub-commands (#408)#410
feat(jay): create skeleton walk and run sub-commands (#408)#410plastikfan merged 1 commit intomainfrom
Conversation
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughWalkthroughThis PR adds a comprehensive CLI command infrastructure for the Changes
Sequence Diagram(s)sequenceDiagram
participant User as User/CLI Entry
participant Bootstrap
participant Root as Root Command
participant Viper as Configuration
participant LangDetect as Language Detector
participant Container as Cobra Container
User->>Bootstrap: Create Bootstrap instance
Bootstrap->>Bootstrap: prepare() - set defaults
User->>Bootstrap: Root(options...)
Bootstrap->>Bootstrap: apply options
Bootstrap->>Viper: configure() - init Viper
Viper-->>Bootstrap: load config file
Bootstrap->>LangDetect: Scan() detect language
LangDetect-->>Bootstrap: language.Tag
Bootstrap->>Bootstrap: handleLangSetting() - set i18n
Bootstrap->>Container: NewCobraContainer(root)
Container->>Root: Register root command
Bootstrap->>Container: MustRegisterParamSet (root, families)
Container-->>Bootstrap: configured container
Bootstrap-->>User: *cobra.Command (root)
sequenceDiagram
participant CLI as Walk Command
participant Input as Input Parser
participant Options as Option Builder
participant Agenor as Agenor Engine
participant UI as UI Manager
CLI->>Input: Parse flags, tree path
Input->>Input: ResolveSubscription(flag)
Input-->>CLI: WalkInputs struct
CLI->>Options: buildOptions(shared flags)
Options-->>CLI: []agenor.Option
CLI->>Agenor: pref.Using(facade) or pref.Relic(facade)
Agenor->>Agenor: Tortoise(isPrime)(facade, opts...).Navigate(ctx)
loop For each visited node
Agenor->>UI: OnNode(*core.Node)
UI-->>Agenor: nil or error
end
Agenor-->>CLI: traversal result
CLI->>UI: Info/Error (completion metrics)
sequenceDiagram
participant CLI as Run Command
participant Input as Input Parser
participant Agenor as Agenor Engine
participant Pool as Worker Pool
participant UI as UI Manager
participant WG as WaitGroup
CLI->>Input: Parse flags, tree path, worker config
Input-->>CLI: RunInputs (includes WorkerPool ParamSet)
CLI->>Agenor: pref.Using or pref.Relic with facade
Agenor->>Agenor: apply pool options (--cpu/--now)
Agenor->>Pool: Initialize worker pool
CLI->>WG: Create WaitGroup
CLI->>Agenor: age.Hare(isPrime)(facade, opts...).Navigate(ctx)
par Concurrent Traversal
Agenor->>Pool: Distribute work to workers
Pool->>Pool: Process nodes concurrently
Pool->>UI: OnNode (synchronized via mutex)
UI-->>Pool: callback result
end
Agenor->>WG: Complete
WG->>CLI: Wait() returns
CLI->>UI: Info (completion metrics)
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment Tip CodeRabbit can scan for known vulnerabilities in your dependencies using OSV Scanner.OSV Scanner will automatically detect and report security vulnerabilities in your project's dependencies. No additional configuration is required. |
Summary by CodeRabbit
Release Notes
New Features
walkcommand for directory traversal with subscription control, action targeting, and resume support.runcommand for concurrent directory traversal via worker pool with CPU configuration options.inspecttool to query exported declarations from cached Go modules.Documentation
Chores