feat: publish tax-view projections atomically - #9
Merged
Conversation
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.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Lands the
publish-paperless-projections-atomicallywork 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 intohomebrew-tap— whose hardened bump logic is already merged.Verification
pytest— 100 passedruff format --check/ruff check— cleanmypy --strict src— 12 source files, clean