feat: add --rules flag to topology command#9
Merged
Conversation
Add --rules flag that displays the actual SQL or correlation filter expression beneath each subscription rule name in the topology output. Supports all three output formats: - tree: shows expression on indented sub-line with → prefix - json: includes filter property on rule objects - mermaid: uses filter expression as edge label instead of rule name $Default TrueFilter rules (1=1) are hidden in mermaid output.
Split into formatSqlFilter and formatCorrelationFilter helpers. Replace repeated if-checks with data-driven CORRELATION_FIELDS array.
Extract getDlqCount, runExecCommand, and sendNotification into standalone helpers to bring the poll function under the complexity limit.
…er 15 Extract data gathering (gatherQueueCosts, gatherTopicCosts), issue detection (detectQueueIssues, detectTopicIssues), cost estimation (estimateMonthlyCost), and rendering (renderSummary, renderTable, renderOptimizations) into standalone functions. The action handler is now a simple orchestrator.
Extract generic diffNamedEntities and diffProperties helpers to eliminate the repeated map-build/added/removed/compare pattern across diffQueues, diffTopics, diffSubscriptions, and diffRules.
Extract createReceiver, buildJsonOutput, renderMessage, renderApplicationProperties, and renderBody into standalone functions.
Extract treePrefixes, renderRulesTree, renderSubscriptionsTree, and getRuleLabel helpers to flatten the deeply nested loop structure and eliminate the duplicated showRules if/else branches.
peekMessages has a batch ceiling, so searching with --count >100 would silently return fewer results. Now peeks in 100-message batches using fromSequenceNumber to walk through the full queue.
- ESLint flat config with typescript-eslint recommended rules - Prettier with double quotes, semicolons, trailing commas, 80 char width - eslint-config-prettier to avoid rule conflicts - Added lint, lint:fix, format, and format:check scripts - Formatted all source files
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
--rulesflag to thecrucible topologycommand that shows the actual filter expression beneath each subscription rule name$DefaultTrueFilter rules are hidden in Mermaid output to reduce noiseExample
Test plan
crucible topologywithout--rules— verify existing behavior unchangedcrucible topology --rules— verify filter expressions appear under rule namescrucible topology --rules --format json— verify filter property in outputcrucible topology --rules --format mermaid— verify expressions as edge labels