fix(task): enforce group concurrency at dequeue time#105
Conversation
|
Warning Review limit reached
More reviews will be available in 46 minutes and 40 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (32)
WalkthroughThis PR introduces substantial enhancements to clicky's rendering infrastructure, task execution model, and RPC command handling. New callout, keyed wrapper, and document types enrich the rendering system. A ChangesRendering, Concurrency, and RPC Infrastructure
Possibly related PRs
✨ Finishing Touches🧪 Generate unit tests (beta)
✨ Simplify code
|
…and UI parameter roles Introduce three major capabilities: 1. Filter lifting (entity.go): Add Filterable interface and LiftFilters function to allow subcommand options structs to expose typed filter lookups that diverge from parent entity filters. This enables fine-grained filter control when positional arguments pin certain identifier filters. 2. HTTP request population (flags/request.go): Add PopulateFromRequest function to populate struct fields from HTTP request data without shared pflag state. This fixes state leakage across concurrent requests where slice values would accumulate across calls. Includes support for CSV expansion, file loading, and type parsing (int, bool, duration, time). 3. OpenAPI parameter roles (rpc/openapi.go): Add ClickyParameterMeta and paramRole function to classify query parameters for UI routing (pagination, time-range, filters) instead of generic text inputs. Roles are assigned based on parameter name conventions and operation capabilities. 4. Hierarchical subcommand paths (sub_command.go): Extend RegisterSubCommand and RegisterSubCommandFn to accept slash-delimited paths (e.g., "billing/policy") for nested command registration, creating missing intermediates and reusing existing nodes. Includes comprehensive test coverage for concurrent request isolation, CSV parsing, default values, file loading, parameter role classification, and path-aware subcommand registration.
…ering Introduce Admonition type to support callout blocks with severity levels (note, info, tip, warning, danger) and multi-format rendering (text, ANSI, HTML, Markdown). Add Keyed wrapper type to associate stable identifiers with Textable values for structured JSON output without affecting other formats. Also fix Markdown table rendering to escape pipe characters in cell content, preventing GFM table layout corruption. Add shell completion support for Filterable subcommands and refactor RPC data function to use PopulateFromRequest for proper concurrent request handling. Add WithKey helper function to format.go for convenient Keyed wrapper creation.
…body Move semaphore acquisition from task function wrapper to worker dequeue time. This prevents worker slots from being blocked on group semaphores, allowing independent tasks to run while a concurrency-limited group is busy. The parent group is now set via withParent option before task enqueue, ensuring the worker can access the group's semaphore at dequeue time. This fixes a deadlock risk when concurrency=1 and prevents worker starvation. Adds TestGroupConcurrencySlots to verify independent tasks can run concurrently with a saturated serial group.
…le serialization Introduce NewClickyDocument() to build clicky documents directly from Textable objects, bypassing PrettyData conversion. This preserves rich formatting (code blocks, collapsibles, tables) verbatim without flattening through PrettyData. Add ClickyText wrapper type that implements json.Marshaler to emit structured clicky documents instead of plain strings, enabling use in struct fields with `json:"field"` tags. Export previously private clicky* types (ClickyDocument, ClickyNode, ClickyStyle, ClickyField, ClickyColumn, ClickyRow, ClickyTreeItem, ClickyStackFrame) to support external consumption and round-tripping through encoding/json. Add comprehensive tests verifying code blocks, collapsed sections, and JSON round-trip fidelity.
…ink JSON payload support Introduce PrettyShort interface to enable objects to provide compact, single-line representations for table cells (typically self-links), distinct from Pretty()'s fuller detail view. Cell renderers now prefer PrettyShort() over Pretty() when available. Add JSON field to Link struct with WithJSON() builder method and MarshalJSON() implementation to serialize links as structured objects with href, text, tooltip, and optional payload. This allows structured-JSON consumers to render links as anchors while preserving navigation metadata. Add `short` pretty-tag flag to FieldMeta to control field rendering via PrettyShort() in structs, tables, and clicky+json printers. Update TryTypedValue to check Pretty before Textable, ensuring types implementing both (e.g. EntityLink) honor their Pretty() method rather than serializing as bare structs. Includes comprehensive tests for Link.MarshalJSON, PrettyShort precedence, and Pretty/Textable interaction.
b21bc8a to
5c5c408
Compare
|
🎉 This PR is included in version 1.21.11 |
What
Why
Notes
Summary by CodeRabbit
New Features
PrettyShort.Bug Fixes
Documentation