Skip to content

feat: publish tax-view projections atomically - #9

Merged
NikAcc merged 5 commits into
mainfrom
publish-paperless-projections-atomically
Jul 30, 2026
Merged

feat: publish tax-view projections atomically#9
NikAcc merged 5 commits into
mainfrom
publish-paperless-projections-atomically

Conversation

@NikAcc

@NikAcc NikAcc commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Lands the publish-paperless-projections-atomically work that had been uncommitted in the workspace.

A projection was written in place, so an interrupted post-process left a half-written tax view that looked complete. Projections are now staged and moved into place atomically; an interrupted run leaves the previous view intact rather than a partial one.

Also adds structured logging with a configured level in place of bare prints.

Release

feat:1.0.0 → 1.1.0. Publishes to PyPI via OIDC, cuts a GitHub Release, and dispatches a formula bump into homebrew-tap — whose hardened bump logic is already merged.

Verification

  • pytest — 100 passed
  • ruff format --check / ruff check — clean
  • mypy --strict src — 12 source files, clean

NikAcc and others added 2 commits July 29, 2026 14:15
A projection was written in place, so an interrupted post-process left a
half-written tax view that looked complete. Projections are now staged and moved
into place atomically, and an interrupted run leaves the previous view intact
rather than a partial one.

Adds structured logging with a configured level in place of bare prints.

Owned by the `publish-paperless-projections-atomically` OpenSpec change.
@NikAcc
NikAcc requested a review from Gykonik as a code owner July 30, 2026 15:44
Gykonik added 3 commits July 30, 2026 18:20
The test asserted each option appeared in `--help` output, which is Rich's
render: it wraps, colours and boxes to the terminal it thinks it has. That made
the assertion a function of the runner's width — it passed locally and failed on
all three CI platforms, where help rendered at 80 columns and the option names
were not in the text at all.

The contract is "the README documents the options that exist", so it now reads
the command tree, including `secondary_opts` so a flag's negative form
(`--no-tax-view`) is found where Typer actually puts it.
The durability step opened each published file 'rb' and fsynced it. POSIX allows
that; Windows does not — os.fsync reaches _commit, which needs a writable handle,
so it raised EBADF on every file and failed the whole publication.

Now tolerated, matching _fsync_directory, which already swallows the same refusal
for directory handles. This weakens the explicit flush on Windows; failing the
publish outright would have made an atomic tax view impossible there at all.
shlex.split defaults to POSIX rules, where a backslash escapes the next
character. On Windows that silently destroyed every path it was given:
'C:\hostedtoolcache\Python\3.12\x64\python.exe' came back as
'C:hostedtoolcachePython3.12x64python.exe', so the exporter could not be launched
and four CLI tests exited 3 instead of running.

Also fixes the passphrase source check: Windows cannot open a directory as a
descriptor, so a directory failed at os.open and was reported as 'must not be a
symlink', never reaching the S_ISREG check that says what is actually wrong. The
two platforms gave different messages for the same mistake.
@NikAcc
NikAcc merged commit d60ecf3 into main Jul 30, 2026
14 checks passed
@NikAcc
NikAcc deleted the publish-paperless-projections-atomically branch July 30, 2026 16:48
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.

2 participants