Repository navigation
fix(gantt): cascaded issues and the critical path keep their working-day duration - #11065
Conversation
|
Hi @MichaelUray
|
In working-days mode simulateCascade placed a shifted issue's anchor on a working day but moved its other end by the same number of calendar days, so the issue kept its calendar-day length and could end on a weekend or a holiday. A pushed successor and a pulled predecessor now keep their length in working days (workingDaySpan, never below 1); the free end is dueForSpan / startForSpan of the anchored end, for all four relation kinds. The anchor, the FS gap floor and the violation check are unchanged, and without a calendar the arithmetic is byte-identical. Test updates: the chain push from hcengineering#11054 now ends B on Mon 19 (two working days) and C on Tue 20 - Wed 21; the multi-hop floor test uses a Monday primary so the floor still dominates the second hop; the pull test uses a two-working-day predecessor and keeps its expectation. Signed-off-by: Michael Uray <michaeluray@users.noreply.github.com>
computeCriticalPath preserved each issue's duration in milliseconds, so with a working-days calendar the latest start of a predecessor rolled back across a weekend was too early and its slack too large. The forward and backward passes now keep the working-day span (endFor / startFor via dueForSpan / startForSpan) when a calendar is active, so LS/LF match what the cascade would produce. Legacy mode keeps the millisecond duration; slack stays in milliseconds. Signed-off-by: Michael Uray <michaeluray@users.noreply.github.com>
…tical-path coverage, doc placement Signed-off-by: Michael Uray <michaeluray@users.noreply.github.com>
03d1ca8 to
f70a031
Compare
|
Rebased onto current
|
b962dfb
into
hcengineering:develop
Follow-up to #11054, which listed working-day durations for cascaded successors as
out of scope. Builds on the working-day span helpers from #11060 (merged).
Problem
In working-days mode
simulateCascadeplaces a shifted issue's anchor on a working daybut moves its other end by the same number of calendar days, so the issue keeps its
calendar-day length: a two-day successor pushed from Mon–Tue to a Friday ends on
Saturday (B Fri 16–Sat 17 in the #11054 example), a three-working-day predecessor pulled
across a weekend grows to five working days, and a successor pushed onto the day before
a holiday ends on the holiday. This applies to all four relation kinds; only which end
is anchored differs. The critical path computes LS/LF the same way, so the latest start
of a predecessor that is rolled back across a weekend is too early and its slack too large.
Change
simulateCascade: with a calendar, a pushed or pulled issue keeps its length inworking days (
workingDaySpan, never below 1): the free end isdueForSpan/startForSpanof the anchored end, for FS/SS (start anchored) and FF/SF (dueanchored) alike. The anchor, the FS gap floor and the violation check from
feat(tracker): Gantt chart for the issue tracker #10992/fix(tracker): Gantt cascade — do not pull a predecessor back when its due falls on a non-working day #11054 are unchanged. Without a calendar the arithmetic is byte-identical.
computeCriticalPath: the forward and backward passes preserve the working-day spaninstead of the millisecond duration, so LS/LF match what the cascade would produce.
MAX_WORKING_SPAN_DAYScalendar days retain their exact calendar-daylength when moved; the bounded working-day helpers are not allowed to silently shorten
them.
A bar stored entirely on non-working days counts as one working day once it is moved.
This normalisation is intentionally lossy: for example, Fri–Sat and Sat–Sun both become
one working-day bars, so pushing and then undoing such a bar does not restore its original
dates.
Tests
Updated: the #11054 chain now ends B on Mon 19 (two working days) and C on Tue 20–Wed 21;
the multi-hop floor test uses a Monday primary so the floor still dominates the second hop;
the pull test uses a two-working-day predecessor and keeps its expectation; three
working-days tests assert the far end as well. New: push and pull across a weekend for
every relation kind (FS, SS, FF, SF), holiday step-over, weekend-only and inverted bars,
long bars beyond the span cap, legacy calendar-day length for push and pull with fixed
values, and working-calendar CPM coverage for every relation type, holidays, non-working
project finishes, and a non-working latest finish in the backward pass.