Skip to content

CATROID-909: Enable evaluation of user-defined functions in formulas#5174

Open
harshsomankar123-tech wants to merge 7 commits intoCatrobat:developfrom
harshsomankar123-tech:feature/user-defined-reporter-functions-CATROID-909
Open

CATROID-909: Enable evaluation of user-defined functions in formulas#5174
harshsomankar123-tech wants to merge 7 commits intoCatrobat:developfrom
harshsomankar123-tech:feature/user-defined-reporter-functions-CATROID-909

Conversation

@harshsomankar123-tech
Copy link
Copy Markdown
Member

Description

Resolves:
CATROID-909
https://catrobat.atlassian.net/browse/CATROID-909

Summary of changes:
This PR enables the evaluation of user-defined reporter functions within formulas. This allows users to create custom logic that returns a value and use it directly inside other bricks' formula fields.

Key Implementations:

  • Execution & Reporting: When a user-defined function is included in a formula, its definition script executes with the provided parameters. Reaching a "Report" brick correctly halts the definition script's execution and returns the formula field's value to the calling formula.
  • Default Value Handling: If a script finishes without reaching a "Report" brick, the formula gracefully falls back to receiving 0 as the result.
  • Concurrency: Function evaluation is designed to be non-blocking, ensuring other scripts in the project continue to run in parallel without interruption.
  • Recursion Support: Implemented call stack propagation to support recursive calls, allowing functions to reliably call themselves or other functions.

Checklist for this pull request

Please review the contributing guidelines and wiki pages of this repository.

  • Include the name of the Jira ticket in the PR’s title
  • Include a summary of the changes plus the relevant context
  • Choose the proper base branch (develop)
  • Confirm that the changes follow the project’s coding guidelines
  • Verify that the changes generate no compiler or linter warnings
  • Perform a self-review of the changes
  • Verify to commit no other files than the intentionally changed ones
  • Include reasonable and readable tests verifying the added or changed behavior
  • Confirm that new and existing unit tests pass locally
  • Check that the commits’ message style matches the project’s guideline
  • Stick to the project’s gitflow workflow
  • Verify that your changes do not have any conflicts with the base branch
  • After the PR, verify that all CI checks have passed
  • Post a message in the catroid-stage or catroid-ide Slack channel and ask for a code reviewer

@harshsomankar123-tech harshsomankar123-tech marked this pull request as draft April 5, 2026 20:19
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Apr 5, 2026

@harshsomankar123-tech harshsomankar123-tech marked this pull request as ready for review April 6, 2026 09:47
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.

2 participants