Skip to content

fix(pdf): compute overdue tasks from one export timestamp - #334

Merged
DeepDiver1975 merged 1 commit into
mainfrom
fix/pdf-export-timestamp
Sep 15, 2026
Merged

DeepDiver1975 merged 1 commit into
mainfrom
fix/pdf-export-timestamp

Conversation

@DeepDiver1975

Copy link
Copy Markdown
Contributor

Summary

Another item off the #302 checklist.

TasksSection.Compose read DateTimeOffset.Now to decide which Aufgaben render as "FÄLLIG", so
the same closed Einsatz exported twice could disagree — and the section could not be tested at
all, because its output depended on when the suite happened to run. It was the only .Now in
LageBuch.Documents; every other section is already a pure function of the incident.

An explicit asOf is now threaded through the export chain, sourced in
LocalIncidentSession.ExportPdfAsync, which already holds an IClock. The view model is
untouched:

ExportPdfAsync → IIncidentPdfExporter.Generate → IncidentPdf.Generate
              → IncidentReportDocument → TasksSection.Compose

asOf sits immediately after incident on the public signatures (required parameters must
precede optional ones), which is what moves the test call sites — nothing else about them changed.

Changes

  • TasksSection.Compose takes DateTimeOffset asOf and compares against it
  • IncidentReportDocument, IncidentPdf.Generate, IIncidentPdfExporter.Generate thread it
    through; QuestPdfIncidentExporter, NoopIncidentPdfExporter and the three test doubles follow
  • LocalIncidentSession.ExportPdfAsync reads _clock.Now once per export
  • TasksSectionTests grows from one smoke assertion to four that pin the behaviour: an open task
    renders differently either side of its due date, the same timestamp renders the same both times,
    and a completed task is never overdue however late the export is
  • Mechanical asOf argument added at the IncidentPdf.Generate call sites in IncidentPdfTests,
    CoMessprotokollSectionTests and PdfAttachmentMergerTests
  • Changelog entry under Fixed

Checklist

  • Commits follow Conventional Commits and are DCO signed off (git commit -s)
  • dotnet build and dotnet test pass locally (make ci, all eight projects)
  • UI changes include before/after screenshots — n/a, no UI change; the PDF's layout is unchanged, only which timestamp decides "FÄLLIG"
  • No real master data / personnel data committed

Part of #302.

🤖 Generated with Claude Code

https://claude.ai/code/session_01YavFrkz1GFaMNXbHQKsMyf

@DeepDiver1975
DeepDiver1975 force-pushed the fix/pdf-export-timestamp branch from 698fa1b to f08bfdd Compare September 15, 2026 20:17
TasksSection.Compose read DateTimeOffset.Now to decide which Aufgaben
render as "FÄLLIG", so the same closed Einsatz exported twice could
disagree -- and the section could not be tested at all, because its output
depended on when the suite happened to run. It was the only .Now in
LageBuch.Documents; every other section is a pure function of the incident.

Thread an explicit asOf through the export chain instead. It is sourced in
LocalIncidentSession.ExportPdfAsync, which already holds an IClock, so the
view model is untouched:

  ExportPdfAsync -> IIncidentPdfExporter.Generate -> IncidentPdf.Generate
  -> IncidentReportDocument -> TasksSection.Compose

asOf sits immediately after incident on the public signatures, which is
what moves the test call sites; nothing else about them changed.

TasksSectionTests grew from one smoke assertion to four that actually pin
the behaviour: an open task renders differently either side of its due
date, the same timestamp renders the same both times, and a completed task
is never overdue however late the export is.

Part of #302.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YavFrkz1GFaMNXbHQKsMyf
Signed-off-by: Thomas Müller <1005065+DeepDiver1975@users.noreply.github.com>
@DeepDiver1975
DeepDiver1975 force-pushed the fix/pdf-export-timestamp branch from f08bfdd to a4b1e41 Compare September 15, 2026 21:01
@DeepDiver1975
DeepDiver1975 merged commit 81f8d3d into main Sep 15, 2026
3 checks passed
@DeepDiver1975
DeepDiver1975 deleted the fix/pdf-export-timestamp branch September 15, 2026 21:08
DeepDiver1975 added a commit that referenced this pull request Sep 15, 2026
Every pull request inserted its bullet at the top of the same list under
`## [Unreleased]`, so the insertion anchor was byte-identical across branches.
Git saw two independent inserts at one position, could not order them, and
conflicted — and merging any one PR invalidated every other open PR's hunk.
`git merge-tree` reproduces it: #334 and #335 conflicted on CHANGELOG.md and
nothing else, while two PRs writing to different sections merged clean.

Each change now carries its entry as its own file in changelog.d/, which
towncrier folds into CHANGELOG.md when a release is cut. Different PRs create
different files, so there are no shared lines left to conflict over.

Fragments use towncrier's orphan naming (+<slug>.<type>.md) rather than the
default <issue>.<type>.md: several entries cite the same ticket (#302), and
issue-numbered filenames would have reintroduced the same collision as an
add/add conflict.

A `merge=union` driver in .gitattributes was tried first and rejected. It does
resolve these merges correctly on the client, but GitHub does not run merge
drivers server-side when computing pull request mergeability, so the PRs would
still have shown as conflicting.

The changelog-check job now runs `towncrier check` instead of requiring a
CHANGELOG.md edit. Its job id and display name are unchanged, so an existing
required status check keeps matching.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Thomas Müller <1005065+DeepDiver1975@users.noreply.github.com>
DeepDiver1975 added a commit that referenced this pull request Sep 16, 2026
Every pull request inserted its bullet at the top of the same list under
`## [Unreleased]`, so the insertion anchor was byte-identical across branches.
Git saw two independent inserts at one position, could not order them, and
conflicted — and merging any one PR invalidated every other open PR's hunk.
`git merge-tree` reproduces it: #334 and #335 conflicted on CHANGELOG.md and
nothing else, while two PRs writing to different sections merged clean.

Each change now carries its entry as its own file in changelog.d/, which
towncrier folds into CHANGELOG.md when a release is cut. Different PRs create
different files, so there are no shared lines left to conflict over.

Fragments use towncrier's orphan naming (+<slug>.<type>.md) rather than the
default <issue>.<type>.md: several entries cite the same ticket (#302), and
issue-numbered filenames would have reintroduced the same collision as an
add/add conflict.

A `merge=union` driver in .gitattributes was tried first and rejected. It does
resolve these merges correctly on the client, but GitHub does not run merge
drivers server-side when computing pull request mergeability, so the PRs would
still have shown as conflicting.

The changelog-check job now runs `towncrier check` instead of requiring a
CHANGELOG.md edit. Its job id and display name are unchanged, so an existing
required status check keeps matching.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Thomas Müller <1005065+DeepDiver1975@users.noreply.github.com>
DeepDiver1975 added a commit that referenced this pull request Sep 16, 2026
Every pull request inserted its bullet at the top of the same list under
`## [Unreleased]`, so the insertion anchor was byte-identical across branches.
Git saw two independent inserts at one position, could not order them, and
conflicted — and merging any one PR invalidated every other open PR's hunk.
`git merge-tree` reproduces it: #334 and #335 conflicted on CHANGELOG.md and
nothing else, while two PRs writing to different sections merged clean.

Each change now carries its entry as its own file in changelog.d/, which
towncrier folds into CHANGELOG.md when a release is cut. Different PRs create
different files, so there are no shared lines left to conflict over.

Fragments use towncrier's orphan naming (+<slug>.<type>.md) rather than the
default <issue>.<type>.md: several entries cite the same ticket (#302), and
issue-numbered filenames would have reintroduced the same collision as an
add/add conflict.

A `merge=union` driver in .gitattributes was tried first and rejected. It does
resolve these merges correctly on the client, but GitHub does not run merge
drivers server-side when computing pull request mergeability, so the PRs would
still have shown as conflicting.

The changelog-check job now runs `towncrier check` instead of requiring a
CHANGELOG.md edit. Its job id and display name are unchanged, so an existing
required status check keeps matching.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Thomas Müller <1005065+DeepDiver1975@users.noreply.github.com>
DeepDiver1975 added a commit that referenced this pull request Sep 20, 2026
Every pull request inserted its bullet at the top of the same list under
`## [Unreleased]`, so the insertion anchor was byte-identical across branches.
Git saw two independent inserts at one position, could not order them, and
conflicted — and merging any one PR invalidated every other open PR's hunk.
`git merge-tree` reproduces it: #334 and #335 conflicted on CHANGELOG.md and
nothing else, while two PRs writing to different sections merged clean.

Each change now carries its entry as its own file in changelog.d/, which
towncrier folds into CHANGELOG.md when a release is cut. Different PRs create
different files, so there are no shared lines left to conflict over.

Fragments use towncrier's orphan naming (+<slug>.<type>.md) rather than the
default <issue>.<type>.md: several entries cite the same ticket (#302), and
issue-numbered filenames would have reintroduced the same collision as an
add/add conflict.

A `merge=union` driver in .gitattributes was tried first and rejected. It does
resolve these merges correctly on the client, but GitHub does not run merge
drivers server-side when computing pull request mergeability, so the PRs would
still have shown as conflicting.

The changelog-check job now runs `towncrier check` instead of requiring a
CHANGELOG.md edit. Its job id and display name are unchanged, so an existing
required status check keeps matching.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Thomas Müller <1005065+DeepDiver1975@users.noreply.github.com>
DeepDiver1975 added a commit that referenced this pull request Sep 20, 2026
* build(changelog): assemble CHANGELOG.md from per-PR fragments

Every pull request inserted its bullet at the top of the same list under
`## [Unreleased]`, so the insertion anchor was byte-identical across branches.
Git saw two independent inserts at one position, could not order them, and
conflicted — and merging any one PR invalidated every other open PR's hunk.
`git merge-tree` reproduces it: #334 and #335 conflicted on CHANGELOG.md and
nothing else, while two PRs writing to different sections merged clean.

Each change now carries its entry as its own file in changelog.d/, which
towncrier folds into CHANGELOG.md when a release is cut. Different PRs create
different files, so there are no shared lines left to conflict over.

Fragments use towncrier's orphan naming (+<slug>.<type>.md) rather than the
default <issue>.<type>.md: several entries cite the same ticket (#302), and
issue-numbered filenames would have reintroduced the same collision as an
add/add conflict.

A `merge=union` driver in .gitattributes was tried first and rejected. It does
resolve these merges correctly on the client, but GitHub does not run merge
drivers server-side when computing pull request mergeability, so the PRs would
still have shown as conflicting.

The changelog-check job now runs `towncrier check` instead of requiring a
CHANGELOG.md edit. Its job id and display name are unchanged, so an existing
required status check keeps matching.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Thomas Müller <1005065+DeepDiver1975@users.noreply.github.com>

* docs(releasing): fold the changelog with towncrier, not by hand

The release runbook still told the maintainer to "move the [Unreleased]
entries under a new version heading before tagging" — the one step this
branch removes. Following it after this merges produces no section at all,
and with the guard from #369 in place the tag is refused outright.

Replace that with the towncrier build, keeping the three things it does not
do for you: the summary paragraph, the link definitions at the bottom of
CHANGELOG.md, and the milestone. The tag command moves below the assembly,
which is the order it now has to happen in.

CONTRIBUTING.md's Hacktoberfest bullet still listed "a CHANGELOG.md entry"
among the unchanged rules, contradicting the section below it that says
never to edit that file; and its "Cutting a release" section now duplicated
the runbook, so it points at docs/releasing.md instead of maintaining the
same steps twice.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Thomas Müller <1005065+DeepDiver1975@users.noreply.github.com>

---------

Signed-off-by: Thomas Müller <1005065+DeepDiver1975@users.noreply.github.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.

1 participant