Skip to content

Conversation

@matthv
Copy link
Member

@matthv matthv commented Nov 7, 2025

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

@qltysh
Copy link

qltysh bot commented Nov 7, 2025

5 new issues

Tool Category Rule Count
qlty Structure Function with many parameters (count = 9): field 4
qlty Structure Function with high complexity (count = 7): field 1

This is from Qlty Cloud, the successor to Code Climate Quality. Learn more.

@qltysh
Copy link

qltysh bot commented Nov 7, 2025

Diff Coverage: The code coverage on the diff in this pull request is 97.7%.

Total Coverage: This PR will increase coverage by 0.13%.

File Coverage Changes
Path File Coverage Δ Indirect
packages/forest_admin_agent/lib/forest_admin_agent/builder/agent_factory.rb 0.2
packages/forest_admin_datasource_customizer/lib/forest_admin_datasource_customizer/collection_customizer.rb 0.1
packages/forest_admin_datasource_customizer/lib/forest_admin_datasource_customizer/dsl.rb 100.0
packages/forest_admin_datasource_customizer/lib/forest_admin_datasource_customizer/dsl/builders/action_builder.rb 100.0
packages/forest_admin_datasource_customizer/lib/forest_admin_datasource_customizer/dsl/builders/chart_builder.rb 100.0
packages/forest_admin_datasource_customizer/lib/forest_admin_datasource_customizer/dsl/builders/form_builder.rb 100.0
packages/forest_admin_datasource_customizer/lib/forest_admin_datasource_customizer/dsl/context/execution_context.rb 100.0
packages/forest_admin_datasource_customizer/lib/forest_admin_datasource_customizer/dsl/helpers/collection_helpers.rb 94.9
packages/forest_admin_datasource_customizer/lib/forest_admin_datasource_customizer/dsl/helpers/datasource_helpers.rb 85.7
🛟 Help
  • Diff Coverage: Coverage for added or modified lines of code (excludes deleted files). Learn more.

  • Total Coverage: Coverage for the whole repository, calculated as the sum of all File Coverage. Learn more.

  • File Coverage: Covered Lines divided by Covered Lines plus Missed Lines. (Excludes non-executable lines including blank lines and comments.)

    • Indirect Changes: Changes to File Coverage for files that were not modified in this PR. Learn more.

This is from Qlty Cloud, the successor to Code Climate Quality. Learn more.

@matthv matthv force-pushed the feat/dsl-customization branch from cc1dd80 to c9ef24f Compare November 26, 2025 15:30
@matthv matthv changed the title Feat/dsl customization feat(ruby): add DSL for easier agent customization Nov 26, 2025
@matthv matthv changed the title feat(ruby): add DSL for easier agent customization feat: add DSL for easier agent customization Nov 26, 2025

# Disable search on this collection
def disable_search
replace_search { |_query, _context| nil }
Copy link
Contributor

Choose a reason for hiding this comment

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

There is a function disable_search, replace with null is false

Copy link
Member Author

Choose a reason for hiding this comment

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

fixed

# end
#
# @param block [Proc] search handler
def enable_search(&block)
Copy link
Contributor

Choose a reason for hiding this comment

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

enable_search is not the right naming for this imo, usually search is enabled by default by the DS, you either disable it or replace the search not enable it

Copy link
Member Author

Choose a reason for hiding this comment

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

fixed

# @param key [String] header name
# @param value [String] header value
# @return [ExecutionContext] self for chaining
def set_header(key, value)
Copy link
Contributor

Choose a reason for hiding this comment

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

Not useful If I'm not wrong

Copy link
Member Author

Choose a reason for hiding this comment

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

you are correct, I have removed it

# Add a section/page layout to group fields
# @param component [String] layout component type
# @param block [Proc] block containing nested fields
def section(component: 'Page', &block)
Copy link
Contributor

@DayTF DayTF Nov 27, 2025

Choose a reason for hiding this comment

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

let's keep the name page as to not confuse the user

Copy link
Member Author

Choose a reason for hiding this comment

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

fixed

# @param headers [Hash] HTTP headers
# @param body [Hash] request body
# @return [Hash] the webhook result
def webhook(url, method: 'POST', headers: {}, body: {})
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): webhook [qlty:function-parameters]

# @param default [Object] default value
# @param enum_values [Array] enum values if type is enum
# @param block [Proc] computation block receiving (records, context)
def computed_field(name, type:, depends_on: [], default: nil, enum_values: nil, &block)
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 = 6): computed_field [qlty:function-parameters]

# @param origin_key [String, Symbol] origin key field
# @param foreign_key [String, Symbol] foreign key field (for many-to-many)
# @param through [String, Symbol] through collection (for many-to-many)
def has_many(name, collection: nil, origin_key: nil, foreign_key: nil, through: nil)
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 = 5): has_many [qlty:function-parameters]

@matthv matthv force-pushed the feat/dsl-customization branch from c41f08c to 6eb5ea8 Compare November 28, 2025 15:57
# @param description [String] field description
# @param placeholder [String] placeholder text
# @param block [Proc] optional proc for computed values
def field(name, type:, widget: nil, options: nil, readonly: false, default: nil,
Copy link

Choose a reason for hiding this comment

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

Found 2 issues:

1. Function with many parameters (count = 9): field [qlty:function-parameters]


2. Function with high complexity (count = 7): field [qlty:function-complexity]

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants