Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[49409] Exclude work package from totals calculation by status #15370

Draft
wants to merge 16 commits into
base: dev
Choose a base branch
from

Conversation

cbliard
Copy link
Member

@cbliard cbliard commented Apr 24, 2024

@cbliard cbliard force-pushed the feature/49409-status-exclude-from-totals branch 2 times, most recently from b3be21c to 7469cea Compare April 25, 2024 08:44
- Use correct progress terminology in test description.
- Merge tests changing work and remaining work: the tests setup and
  expectations where the same. Only the action differed: one was calling
  the service with `estimated_hours` being modified, the other with
  `remaining_hours` being modified.
- Make tests faster (from 13 secs to 5 secs)
- Introduce `shared_let_work_packages` to create work packages with
  table helpers in a `shared_let` fashion.
- Introduce `for_each_context` which runs the same set of tests with
  different RSpec shared contexts.
@cbliard cbliard force-pushed the feature/49409-status-exclude-from-totals branch from 7469cea to 36faf2d Compare April 25, 2024 09:01
cbliard added 15 commits May 2, 2024 09:44
The leaves are no more used in `UpdateAncestorsService`.
The job has been updated to excluded work packages having a status with
`excluded_from_totals` set to true. The journal entry has valid values
so that the cause renders correctly.

The job is not yet triggered properly when the "excluded from totals"
attribute of a status is changed in the administration.
Use 2 custom matchers to test rendering. It avoids creating contexts to
set different values fro `html`. The rspec output with documentation
formatter also looks nicer.
The column headers of the statuses page have a shorter text to fit a
reasonable page width.
- Update the messages according to latest specification
- Update the journal cause to handle multiple changes in one cause
It's to prevent silly mistakes when writing and copy-pasting tables in
specs.
There was a bug in the way the excluded work packages were affecting the
query which updates the totals, especially regarding looking at the
`MAX(generations)` value. When considering work packages after filtering
out excluded work packages, the parent is alone, and its
`MAX(generations)` is 0, which is interpreted like it is a leaf work
package and leading to totals being unset, which is not correct.

Now the check for `MAX(generations) > 0` is done outside of the
filtering to prevent this bug from happening.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant