Skip to content

feat(api chart): allow customizing api chart with query or body parameters#278

Merged
arnaud-moncel merged 3 commits intomainfrom
feat/params-in-chart
Mar 20, 2026
Merged

feat(api chart): allow customizing api chart with query or body parameters#278
arnaud-moncel merged 3 commits intomainfrom
feat/params-in-chart

Conversation

@arnaud-moncel
Copy link
Member

@arnaud-moncel arnaud-moncel commented Mar 18, 2026

Definition of Done

General

  • Write an explicit title for the Pull Request, following Conventional Commits specification
  • Test manually the implemented changes
  • Validate the code quality (indentation, syntax, style, simplicity, readability)

Security

  • Consider the security impact of the changes made

Note

Allow API chart handlers to receive query and body parameters

  • Adds QueryStringParser.parse_chart_parameters to extract scalar (non-hash, non-array, non-nil) request params and pass them through to render_chart on both collection and datasource chart routes.
  • Extends ChartContext and the new DatasourceChartContext with a frozen parameters attr, making request params accessible to custom chart handlers.
  • Updates render_chart signatures across the decorator stack, RPC datasource/collection, and toolkit base classes to accept and forward a parameters = {} hash.
  • RPC agent chart routes now extract parameters from the incoming payload and forward them to render_chart, completing the end-to-end propagation.

Macroscope summarized d833fcf.

@qltysh
Copy link

qltysh bot commented Mar 18, 2026

5 new issues

Tool Category Rule Count
qlty Structure Function with many parameters (count = 4): render_chart 5

end

def render_chart(caller, name, record_id)
def render_chart(caller, name, record_id, parameters = {})
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function with many parameters (count = 4): render_chart [qlty:function-parameters]

attr_reader :composite_record_id, :parameters

def initialize(collection, caller, record_id)
def initialize(collection, caller, record_id, parameters = {})
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function with many parameters (count = 4): initialize [qlty:function-parameters]

end

def render_chart(_caller, name, _record_id)
def render_chart(_caller, name, _record_id, _parameters = {})
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function with many parameters (count = 4): render_chart [qlty:function-parameters]


def render_chart(caller, name, record_id)
@child_collection.render_chart(caller, name, record_id)
def render_chart(caller, name, record_id, parameters = {})
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function with many parameters (count = 4): render_chart [qlty:function-parameters]


def render_chart(caller, name, record_id)
params = build_params(chart: name, record_id: record_id)
def render_chart(caller, name, record_id, parameters = {})
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function with many parameters (count = 4): render_chart [qlty:function-parameters]

Copy link
Member

@matthv matthv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀

@arnaud-moncel arnaud-moncel merged commit 3728660 into main Mar 20, 2026
36 checks passed
@arnaud-moncel arnaud-moncel deleted the feat/params-in-chart branch March 20, 2026 15:00
forest-bot added a commit that referenced this pull request Mar 20, 2026
# [1.26.0](v1.25.3...v1.26.0) (2026-03-20)

### Features

* **api chart:** allow customizing api chart with query or body parameters ([#278](#278)) ([3728660](3728660))
@forest-bot
Copy link
Member

🎉 This PR is included in version 1.26.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants