Skip to content

PDFCLOUD-6418: Upgrade repository quality scaffolding - #48

Open
datalogics-kam wants to merge 6 commits into
mainfrom
pdfcloud-6418-repository-quality-scaffolding
Open

datalogics-kam wants to merge 6 commits into
mainfrom
pdfcloud-6418-repository-quality-scaffolding

Conversation

@datalogics-kam

@datalogics-kam datalogics-kam commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

PDFCLOUD-6418

Why this change

The existing quality setup lacked several common gates, ran basedpyright in a separate workflow, and allowed formatters to rewrite uploaded test resources. Apply the targeted common, Python, and shell profiles from cit-repository-quality-scaffolding while preserving the established tools.

What changed (high level)

Keep one pre-commit quality gate, including the project-managed basedpyright environment. Add structural file checks, actionlint, and a read-only tracked-filename UTF-8 NFC checker. Protect service fixtures in hook scopes and Git attributes, retain the Python attributes and complete sourced common module, and document standalone checker usage. Keep the generated uv.lock out of TOML sorting.

Behavior changes

Quality CI runs on Ubuntu/Python 3.11 for pull requests and pushes to main, develop, and feature-*, with contents: read, frozen installs, verified action SHAs, a runtime-aware hook cache, and a 20-minute timeout. Filename problems and normalization collisions now fail the gate without renaming files. The signing-key exception is limited to the public test fixture; fixture JSON still receives syntax checks and maintained Python under resources remains checked.

The existing Python 3.10-3.14 test and example matrices, Python 3.11 PR/scheduled live tests, PR-only diff coverage and docs previews, and publishing are preserved. There are no SDK API or package-version changes.

Reconcile CI with GitHub Pages already being turned off: remove the obsolete Docs workflow, whose Pages setup fails before compilation. Netlify currently hosts python.pdfrest.com. Documentation validation remains in Test and Publish through Docs Check (uv run mkdocs build --strict on Python 3.11), including PR preview artifacts and the documentation gate before package publishing. Update the contributor CI guidance to reflect the hosting setup.

Validation

The independent branch snapshot based on upstream/main passed the full pre-commit suite, Ruff lint and format checks on all 123 Python files, and basedpyright with zero errors or warnings. All hook revisions/IDs and quality-workflow action pins were verified through gh. Six NFC scenarios and disposable-repository tests for formatter exclusions, maintained Python coverage, fixture JSON validation, and LF-only CSV checkout preservation passed. The original checkout's 44 resource hashes and unrelated local edits were preserved; repeat inspection/rendering showed no source drift. The GitHub-Markdown formatting hook had no matching files.

For the Pages workflow removal, the strict MkDocs build, remaining GitHub workflow validation, Markdown formatting, commit hooks, and diff checks passed. SDK pytest/Nox, live tests, examples, and package builds were not rerun because the change affects CI configuration and guidance. Repository-wide Ruff in the original checkout still reports 39 existing undefined names in its untracked demo notebook; that file is absent from this PR and remains untouched. Hosted CI results are pending.

Risks and follow-ups

Basedpyright is now included in the pre-commit status instead of a separate workflow. Inspected branch rules did not require the retired status, and no GitHub settings were changed. Broader gitignore refreshes and unrelated tool-version upgrades are deferred.

@netlify

netlify Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for pdfrest-python ready!

Name Link
🔨 Latest commit f29fe21
🔍 Latest deploy log https://app.netlify.com/projects/pdfrest-python/deploys/6ac7dfa5405f210008b59f4d
😎 Deploy Preview https://deploy-preview-48--pdfrest-python.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@datalogics-kam
datalogics-kam force-pushed the pdfcloud-6418-repository-quality-scaffolding branch from 867a795 to 9db1576 Compare October 6, 2026 04:10
@datalogics-kam
datalogics-kam marked this pull request as ready for review October 6, 2026 20:28
@datalogics-tsmith

datalogics-tsmith commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

From Codex

P3] Align the standalone script with Python 3.10 support.
requires-python = ">=3.11" and the corresponding README statement unnecessarily exclude the repository’s supported Python 3.10 baseline (AGENTS.md (line 62)). The script contains no 3.11-only syntax or APIs. My Python 3.10 probe completed but emitted an incompatibility warning; environments that prohibit uv-managed interpreter downloads may have more trouble. I suggest changing both references to 3.10.

@datalogics-tsmith datalogics-tsmith left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requesting changes for the two inline findings below: add durable regression coverage for the new filename quality gate, and keep the required contributor hook aligned with the repository's Python 3.10 baseline.

from typing import Any


def tracked_filename_report(root: Path) -> dict[str, Any]:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P2] Add automated coverage for the checker’s failure paths

This function is now part of the required quality gate, but the PR does not add regression tests for non-NFC paths, normalization collisions, invalid UTF-8, missing Git, or a failed git ls-files invocation. The manual validation described in the PR will not prevent these guarantees from regressing later. Please add focused pytest coverage for the clean and failure cases.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed on the coverage gap: there are no automated tests for this checker in the current PR, and the manual validation does not provide lasting regression protection. Focused pytest cases for clean paths, non-NFC names, normalization collisions, invalid UTF-8, missing Git, and a failed git ls-files invocation are appropriate for a gate that can block contributor commits. The CLI exit codes and diagnostics should also be asserted so the tests cover the observable hook behavior. I consider this a valid finding to address before merging.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The NFC checking script is now injected in a location that is marked for not needing review. It's tested in the skill repository.

@@ -0,0 +1,97 @@
# /// script
# requires-python = ">=3.11"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P3] Keep the required hook compatible with Python 3.10

The repository targets Python 3.10–3.14, and this script does not use any Python 3.11-only syntax or APIs. Declaring >=3.11 can require an extra uv-managed interpreter—or warn/fail in restricted 3.10-only contributor environments. Please change this to >=3.10 and update the corresponding README statement.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The SDK compatibility baseline and the contributor tooling baseline are different here. At this PR's head, .python-version selects Python 3.11, and pre-commit CI explicitly uses 3.11. The SDK remains compatible with 3.10, with the test matrix covering 3.10–3.14. This script is contributor tooling, so its declared 3.11 minimum matches the established development environment.

I also verified that direct execution under Python 3.10 succeeds; explicitly selecting 3.10 through uv succeeds with the metadata warning you described. Lowering the requirement would be a reasonable portability improvement, but a 3.10-only contributor environment is outside the currently configured development baseline. I would treat this as a non-blocking suggestion rather than an SDK compatibility defect, and retain the current declaration and README wording.

@datalogics-kam
datalogics-kam marked this pull request as draft October 7, 2026 17:04
@datalogics-kam

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

To use Codex here, create a Codex account and connect to github.

Keep service inputs out of mutating formatters and preserve their Git
checkout bytes. Add explicit LF and whitespace defaults while retaining
Markdown hard breaks and the existing Python attributes. Exclude the
uv lockfile from TOML sorting.

Assisted-by: Codex
Check JSON syntax, case conflicts, merge markers, private keys, and
GitHub Actions workflows. Exempt only the public signing-key fixture
from private-key detection.

Add a standalone NFC filename checker with an always-run hook and
README usage. Resolve Git explicitly and report unavailable Git,
invalid UTF-8 paths, and normalization collisions.

Assisted-by: Codex
Run basedpyright through the frozen project environment and retire its
separate workflow. Run all quality hooks in the shared job with
read-only repository permissions, a timeout, pinned actions, and a hook
cache keyed by platform, tool versions, and configuration.

Assisted-by: Codex
- Vendor the upstream NFC checker with provenance and byte exclusions.
- Refresh complete ignore modules while preserving local amendments.
- Pin compatible quality tools and CI actions.
- Retain the established Ruff rule selection across the tool upgrade.

Assisted-by: Codex
- Include Markdown in Ruff formatting while preserving fixture bytes.
- Format Python examples in the file-usage guide.

Assisted-by: Codex
- Remove the Docs workflow and its GitHub Pages deployment.
- Update CI guidance for Docs Check and Netlify hosting.

Assisted-by: Codex

This branch was successfully deployed

1 active deployment
ci-live — f29fe215 Deployed Oct 8, 2026 by datalogics-kam via Examples (Python 3.11) #545
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