Skip to content

feat: add template infrastructure (2026-04-07 audit)#1

Closed
NWarila wants to merge 15 commits into
mainfrom
2026-04-07_Daily-Audit
Closed

feat: add template infrastructure (2026-04-07 audit)#1
NWarila wants to merge 15 commits into
mainfrom
2026-04-07_Daily-Audit

Conversation

@NWarila
Copy link
Copy Markdown
Owner

@NWarila NWarila commented Apr 7, 2026

Summary

  • Add complete python-template infrastructure: reusable Python QA workflow (python-qa.yml), 6 check scripts, qa.py orchestrator, cross-platform setup scripts, reference configs, sync mechanism, composite setup action, and test suite
  • Standardize .gitignore and .gitattributes to org-standard allowlist model aligned with nwarila/.github
  • Document git hygiene standard in PLAN.md and README.md
  • Harden template-ci.yml with top-level least-privilege permissions
  • Apply cross-platform CI fixes discovered during 2026-04-07 daily audit

Changes in this update

Git hygiene standardization

  • Root and reference .gitignore switch to ** deny-all with explicit allowlisting (matching org DESIGN.md)
  • Root and reference .gitattributes gain comment-rich grouping, .gitignore/.gitattributes self-normalization, and consistent ordering
  • PLAN.md updated with resolved decisions and documentation for the new baselines
  • README quick start updated with gitignore allowlisting step

Security hardening

  • template-ci.yml gains permissions: { contents: read } at top level for least-privilege defaults

Audit coverage

All 13 Template CI checks passed on the prior push. This update adds 3 commits for gitignore/gitattributes standardization, documentation, and permissions hardening.

What remains blocked

  • PR feat: add template infrastructure (2026-04-07 audit) #1 requires human review to merge
  • actions/dependency-review-action emits Node.js 20 deprecation warning (no newer version available)
  • Dev dependency specs remain loose; hook-version-pinning decision deferred to standards discussion

NWarila added 8 commits April 7, 2026 11:53
Add all template components: reusable Python QA workflow, check scripts,
reference configs, sync mechanism, setup action, and test suite.

Includes audit fixes from 2026-04-07:
- Add PT (flake8-pytest-style) to ruff select in pyproject.toml
- Add tests to ruff src paths in pyproject.toml
- Add concurrency group to template-ci.yml
- Add pip ecosystem to dependabot.yml
- Fix line-length violation in test_scripts.py
- Remove unused `os` import from qa.py
- Extract unicode escape from f-string expression (Python 3.11 compat)
- Use set comprehension instead of set() call in qa.py
- Use unpacking instead of list concatenation in qa.py
- Split long line in check_package.py to stay under 120 chars
- Add [build-system] and [tool.setuptools] packages=[] to pyproject.toml
  to prevent setuptools auto-discovering actions/ and reference/ dirs
- Add .markdownlint-cli2.jsonc at repo root (was only in reference/)
- Add type arguments to dict return types (mypy strict)
- Split long line in check_package.py differently to fit 120 chars
- Use setuptools.build_meta instead of legacy backend for editable install
- Apply ruff format to qa.py
- Add typing.Any import and use dict[str, Any] for pyproject return types
- Add pythonpath=["src"] to smoke project pytest config for src-layout
  import resolution without requiring package installation
- Add pythonpath=["src"] to reference pyproject.toml as best practice
- Use setuptools.build_meta in smoke project conftest (same as template)
- Change --cov=smoke_project to --cov=src for consistency
- Fix smoke CLI to accept argv parameter, preventing sys.argv bleed
  from pytest into argparse during test_main_runs
- Add build, twine, validate-pyproject, pip-audit to template dev deps
  so check_package and check_security scripts can find their tools
  during smoke tests
- Remove if __name__ block from smoke CLI to bring coverage above 90%
- Add README.md and readme field to smoke project for twine --strict
check_package.py now uses shutil.which() to verify entry points are
installed before attempting to run them. This prevents failures when
the package is validated without being pip-installed.
Replace Unicode box-drawing character (U+2500) with plain ASCII dash
to avoid UnicodeEncodeError on Windows default console encoding.
@NWarila NWarila force-pushed the 2026-04-07_Daily-Audit branch from b4189e4 to fd2e2f4 Compare April 7, 2026 19:38
NWarila added 7 commits April 7, 2026 13:39
Switch both root and reference .gitignore to the org-standard
allowlist model (** deny-all, explicit tracked roots). Align
.gitattributes with comment-rich, purpose-grouped format and
add explicit normalization for ignore/attribute files themselves.
…ADME

Update PLAN.md resolved decisions, required baseline, reference-only
starters, and repo-owned sections to reflect the standardized
allowlist gitignore and comment-rich gitattributes baselines.
Add Git Hygiene Standard section and updated quick start to README.
Restrict all jobs to contents:read by default. The dependency-review
job retains its own permissions block for pull-requests:read.
The conventional location for repo-internal composite actions is
.github/actions/, not a top-level actions/ directory. Update all
references in template-ci.yml, .gitignore, PLAN.md, and README.md.
@NWarila
Copy link
Copy Markdown
Owner Author

NWarila commented Apr 8, 2026

Superseded by #2, which contains all commits from this branch plus the 2026-04-08 audit follow-up work.

@NWarila NWarila closed this Apr 8, 2026
@NWarila NWarila deleted the 2026-04-07_Daily-Audit branch April 8, 2026 13:20
NWarila added a commit that referenced this pull request Apr 8, 2026
## Summary

- Refresh third-party action SHA pins and version comments
- **Add self-dogfooding model**: template-ci.yml now runs quality gates
from `.github/scripts/` (released copies) instead of `scripts/`
(development source)

### Action pin updates
- `actions/setup-python`: version comment updated to v6.2.0 (same SHA)
- `actions/dependency-review-action`: version comment updated to v4.9.0
(same SHA)
- `astral-sh/setup-uv`: SHA updated from v7 to v8.0.0

### Dogfooding infrastructure
- **`.github/scripts/`**: Seeded from current `scripts/` — these are the
scripts template-ci.yml uses
- **`auto-release.yml`**: Auto-creates a patch release when `scripts/`
changes land on main
- **`self-update.yml`**: Nightly check downloads released scripts into
`.github/scripts/` and opens a PR
- **`template-ci.yml`** and **composite action**: Updated to reference
`.github/scripts/`
- **PLAN.md**: Documents the dogfooding architecture

### How the dogfood loop works
1. Developer changes `scripts/` → merges to main
2. `auto-release.yml` creates a new patch release
3. Nightly `self-update.yml` detects the release → downloads scripts to
`.github/scripts/` → opens PR
4. CI on that PR runs the NEW scripts against the repo
5. If green, merge updates the dogfood scripts

This ensures the template validates itself with the same artifacts it
ships to downstream repos.

## What remains blocked

- PR #1 requires human review to merge
- `dependency-review-action` Node.js 20 deprecation (no newer SHA
available)
- `sync-downstream.yml` UNVERIFIED-LIVE-RUN-REQUIRED
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