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

[52233] Allow % Complete edition in work-based mode #16041

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

Conversation

cbliard
Copy link
Member

@cbliard cbliard commented Jul 4, 2024

cbliard added 19 commits July 4, 2024 17:26
One class for work-based mode, one for status-based mode (strategy
pattern).
- `work` over `estimated_hours`
- `remaining_work` over `remaining_hours`
- `percent_complete` over `done_ratio`
Saves ~140ms.

Get flamegraph of rspec boot time by prepending
`TEST_STACK_PROF_IGNORE_GC=1 TEST_STACK_PROF_FORMAT=json TEST_STACK_PROF=boot`
to rspec command.
Saves ~25ms. (Yeah, not the most impactful, but low-hanging fruit anyway).

Get flamegraph of rspec boot time by prepending
`TEST_STACK_PROF_IGNORE_GC=1 TEST_STACK_PROF_FORMAT=json TEST_STACK_PROF=boot`
to rspec command.
It floowos the extraction of `UpdateProgressValuesStatusBased` and
`UpdateProgressValuesWorkBased` classes for a better separation of
concerns.
Rounding to 2 decimals, and then using the value to set
`work_package.done_ratio` acts like taking the floor value without any
rounding, which is inaccurate.
The check for invalid values is done once instead of being done in each
update method, and the value is updated only if the attribute can be
derived. An attribute can only be derived if the user did not set it and
some value from the 2 other attributes have changed.
Still incomplete and some tests are failing, but this is usable first
draft.
@github-actions github-actions bot temporarily deployed to gh-6899875-pr-16041 July 11, 2024 07:59 Inactive
@github-actions github-actions bot temporarily deployed to gh-6899875-pr-16041 July 11, 2024 08:18 Inactive
@github-actions github-actions bot temporarily deployed to gh-6899875-pr-16041 July 11, 2024 11:18 Inactive
@github-actions github-actions bot temporarily deployed to gh-6899875-pr-16041 July 11, 2024 12:58 Inactive
@github-actions github-actions bot temporarily deployed to gh-6899875-pr-16041 July 11, 2024 16:41 Inactive
@github-actions github-actions bot temporarily deployed to gh-6899875-pr-16041 July 12, 2024 12:12 Inactive
- It's allowed to set only one progress value while the two others are
  unset.
- It's not allowed to have two progress values set while the other one
  is unset.
- Do not output "inconsistent % complete" error if work < remaining work
  to avoid having too many errors displayed at the same time.
@github-actions github-actions bot temporarily deployed to gh-6899875-pr-16041 July 12, 2024 14:42 Inactive
No need to wait 5 secs to check if the selector is present or not.
@github-actions github-actions bot temporarily deployed to gh-6899875-pr-16041 July 15, 2024 14:38 Inactive
The values were not retained between modifications of percent values, so
a new parameter `initial` was introduced to "save" the entered values
between edits.

It also fixed the progress modal having empty values when opening it a
second time in the create work package page.
@github-actions github-actions bot temporarily deployed to gh-6899875-pr-16041 July 15, 2024 15:35 Inactive
- Hide some less important errors when some of the progress values are
  invalid.
- Provide a more meaningful error message when % complete is not in the
  0-100 range. (previous message was "is not included in the list.". It
  is now "must be between 0 and 100.")
- The error messages are now the same for work and remaining work when
  they are negative.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
1 participant