Skip to content

Feature/op 19665 additional calculation operators for calculated fields#24247

Draft
toy wants to merge 11 commits into
devfrom
feature/op-19665-additional-calculation-operators-for-calculated-fields
Draft

Feature/op 19665 additional calculation operators for calculated fields#24247
toy wants to merge 11 commits into
devfrom
feature/op-19665-additional-calculation-operators-for-calculated-fields

Conversation

@toy

@toy toy commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Ticket

https://community.openproject.org/wp/OP-19665

What are you trying to accomplish?

Screenshots

What approach did you choose and why?

Merge checklist

  • Added/updated tests
  • Added/updated documentation in Lookbook (patterns, previews, etc)
  • Tested major browsers (Chrome, Firefox, Edge, ...)

@github-actions

Copy link
Copy Markdown

Warning

Flaky specs

  • rspec ./modules/wikis/spec/features/admin/internal_provider_spec.rb[1:1]
🤖 Ask Copilot to investigate

Copy the prompt below into a new comment on this PR to delegate the investigation to GitHub Copilot. It will look into the flakiness and open a separate pull request with you as reviewer.

@copilot The following spec(s) are flaky in CI (first seen on PR #24247, linked for reference only):

- `rspec ./modules/wikis/spec/features/admin/internal_provider_spec.rb[1:1]`

Treat this as a standalone task, unrelated to PR #24247. Create a new branch from origin/dev and open a new pull request targeting dev — do not stack it on PR #24247 or reuse that branch.

Follow the playbook in docs/development/testing/handling-flaky-tests/README.md to find the root cause and fix the underlying race — do not skip, delete, or weaken the spec to make it pass; disabling is a last resort per the playbook, and only with a bug ticket. Verify the fix by running the spec(s) repeatedly (e.g. `script/bulk_run_rspec --run-count 10`).

If you cannot reproduce the flake or are not confident in a fix after reasonable investigation, do not fabricate a change or skip the spec to force CI green. Instead, leave the pull request in draft and document what you tried, the suspected cause, and any leads in its description, then assign @toy to take over.

Once the fix is verified, title the PR after the spec(s) it fixes, and use the PR description to explain the root cause, how the change resolves it, and the before/after results. Label the PR `flaky-spec`, assign @toy, and request a review from @toy.
On every commit, set @toy as the sole co-author with a `Co-authored-by:` trailer (use their GitHub no-reply email so it links to their account), so it is traceable who dispatched the fix.

toy added 10 commits July 14, 2026 16:30
https://community.openproject.org/wp/OP-19665

**As** a project portfolio manager
**I want to** use additional calculation methods based on project attributes
**so that** I can better evaluate and prioritise projects in my portfolio and communicate this evaluation to my stakeholders

**Acceptance criteria**

*   In addition to the available Mathematical operators: `+`, `-`, `*`, `/`, `%` (modulo and percent), `(` and `)` I want to be able to use operators such as

    *   _Comparison: <, >, <=, >=, <>, !=, =,_

    *   _Logic: IF, AND, OR, XOR, NOT, SWITCH_

    *   _Numeric: MIN, MAX, SUM, AVG, COUNT, ROUND, ROUNDDOWN, ROUNDUP, ABS_

    *   _Selections: CASE_

*   Only small UX changes needed (as Administration-only feature that builds on existing functionality)

**Technical notes**

*   The library "dentaku" is used for calculated values

*   Dentaku supports the operators listed above, but they are hidden via filter

**Permissions and visibility considerations**

*   Permissions are unchanged

**Translation considerations**

*   _Key terms and phrases in the key languages_

**Out of scope**

*   Changes to the Admin-UI on top of adding the operators to the autocompleter.

*   Built-in support for the user on the syntax of the operators.

*   Error messaging on faulty formulas guiding the user to the faulty part of the formula.

*   Using custom fields other than int, float and weighted item list as input

*   Outputting non numerical values as result (e.g. string)
@toy toy force-pushed the feature/op-19665-additional-calculation-operators-for-calculated-fields branch from 2d1d905 to 6883046 Compare July 14, 2026 14:30
@github-actions

Copy link
Copy Markdown

Warning

Flaky specs

  • rspec ./modules/backlogs/spec/features/inbox_column_spec.rb[1:6:1]
  • rspec ./spec/features/activities/work_package/activities_spec.rb[1:5:2:1]
🤖 Ask Copilot to investigate

Copy the prompt below into a new comment on this PR to delegate the investigation to GitHub Copilot. It will look into the flakiness and open a separate pull request with you as reviewer.

@copilot The following spec(s) are flaky in CI (first seen on PR #24247, linked for reference only):

- `rspec ./modules/backlogs/spec/features/inbox_column_spec.rb[1:6:1]`
- `rspec ./spec/features/activities/work_package/activities_spec.rb[1:5:2:1]`

Treat this as a standalone task, unrelated to PR #24247. Create a new branch from origin/dev and open a new pull request targeting dev — do not stack it on PR #24247 or reuse that branch.

Follow the playbook in docs/development/testing/handling-flaky-tests/README.md to find the root cause and fix the underlying race — do not skip, delete, or weaken the spec to make it pass; disabling is a last resort per the playbook, and only with a bug ticket. Verify the fix by running the spec(s) repeatedly (e.g. `script/bulk_run_rspec --run-count 10`).

If you cannot reproduce the flake or are not confident in a fix after reasonable investigation, do not fabricate a change or skip the spec to force CI green. Instead, leave the pull request in draft and document what you tried, the suspected cause, and any leads in its description, then assign @toy to take over.

Once the fix is verified, title the PR after the spec(s) it fixes, and use the PR description to explain the root cause, how the change resolves it, and the before/after results. Label the PR `flaky-spec`, assign @toy, and request a review from @toy.
On every commit, set @toy as the sole co-author with a `Co-authored-by:` trailer (use their GitHub no-reply email so it links to their account), so it is traceable who dispatched the fix.

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant