fix: When generating a DAG or HTML rulegraph, use consistent colours#3189
Conversation
for the different rules.
📝 WalkthroughWalkthroughThe changes made in the Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant DAGGenerator
participant ColorAssigner
User->>DAGGenerator: Request DAG visualization
DAGGenerator->>ColorAssigner: Sort rules by name
ColorAssigner->>ColorAssigner: Calculate hue factor
ColorAssigner-->>DAGGenerator: Return colored rules
DAGGenerator-->>User: Deliver DAG visualization
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
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? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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 (
|
|
🤖 I have created a release *beep* *boop* --- ## [8.25.3](v8.25.2...v8.25.3) (2024-11-11) ### Bug Fixes * correctly set params in bash scripts ([#3188](#3188)) ([07ddab5](07ddab5)) * more robust inference of source path that properly respects hosting provider urls without loosing release or commit information ([#3195](#3195)) ([bd8212b](bd8212b)) * When generating a DAG or HTML rulegraph, use consistent colours ([#3189](#3189)) ([5f651d2](5f651d2)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>



Summary
When generating a DAG or HTML rulegraph, use consistent colours for the different rules (resolves issue #1709).
This PR just sorts the set of rules prior to making the colour map, as sets in Python are enumerated in arbitrary order and this is what leads to the random colour assignment.
QC
I believe any regression should be covered by existing tests (and testing for [in]consistency is very tricky.) I don't see anywhere in the docs that it says the colours will or will not be be randomised each time, so no change needed.
Summary by CodeRabbit
New Features
Documentation