Skip to content

chore: remove generated-config bloat and dead files (ponytail audit) - #76

Open
maehr wants to merge 5 commits into
mainfrom
chore/ponytail-audit-cleanup
Open

chore: remove generated-config bloat and dead files (ponytail audit)#76
maehr wants to merge 5 commits into
mainfrom
chore/ponytail-audit-cleanup

Conversation

@maehr

@maehr maehr commented Jul 2, 2026

Copy link
Copy Markdown
Owner

Summary

Repo-wide over-engineering audit: cuts generated config bloat, dead files, and hand-rolled stdlib. Net: −967 lines across 11 files, no behavior change for template users.

What changed

  • .gitignore 493 → 33 lines: replaced the toptal-generated multi-OS/multi-editor file with entries for what this toolchain actually emits (Quarto, lychee, Node, uv/ruff/pytest/Jupyter, R, .env, OS junk). Removing the mega-ignore surfaced two stale local artifacts (.jampack/ cache from a tool no longer referenced, empty build/) that were deleted rather than re-ignored.
  • .gitattributes 365 → 22 lines: * text=auto plus explicit binary patterns covers every file in the tree; dropped the exhaustive generated Python/R extension tables (including the surprising *.csv eol=crlf).
  • scripts/release_site_archive.py 117 → 62 lines: zipping now uses shutil.make_archive; dropped the --site-dir/--archive-dir flags that no caller ever set. CLI stays compatible (--tag, --stage), so npm run release:prepare and release.yml are untouched. Smoke-tested: archive builds and unzips correctly.
  • Deleted .github/copilot-instructions.md: it restated AGENTS.md, and Copilot reads AGENTS.md natively now. References in CONTRIBUTING.md and the template-site release-workflow page point at AGENTS.md instead.
  • Deleted .github/workflows/changelog.yaml: it generated CHANGELOG.md in CI, printed it, and threw it away — no commit, no artifact, no gate. npm run changelog covers this locally.
  • Deleted empty test/conftest.py: test/.gitkeep already keeps the directory.
  • cliff.toml: dropped commit parsers that only matched this repo's pre-1.0 history (^Devcontainer, ^Branding, ^Quarto, etc.) so project instances don't inherit them; the .* → Other catch-all still handles stray commits. Verified npm run changelog:unreleased still renders.
  • CODE_OF_CONDUCT.md: enforcement contact is now moritz.maehr@gmail.com (this repo's working CoC), while CODE_OF_CONDUCT.template.md keeps the [INSERT CONTACT METHOD] placeholder for template users. Also removed the file from .prettierignore, which had let it drift from the template's formatting (* vs - list markers) — both are prettier-formatted now.

Deliberately not touched

  • commitlint (feat: enforce commitlint with prek #74) and the CI lint jobs for Python/R — flagged in the audit as speculative, but they're recent deliberate choices; overrule separately if wanted.
  • jupyter/papermill dev deps — Quarto may need the Jupyter kernel for executable .qmd chunks in project instances; dropping them is a separate decision.
  • Root + .template file pairs — that duplication is the template's design.

Validation

  • npm run check, uv run ruff check, uv run ty check all pass; prek pre-commit + commitlint hooks green on every commit.
  • Archive script smoke-tested end to end; git-cliff config verified.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Documentation

    • Updated repository guidance to point contributors to the current setup instructions.
    • Cleaned up community and contribution docs formatting and contact details.
  • Chores

    • Simplified file ignore and attribute rules for a leaner, more consistent project setup.
    • Removed outdated automation for changelog generation and streamlined release-site archiving.
    • Adjusted release artifact handling so site archives are packaged in a simpler, more predictable way.

Copilot AI review requested due to automatic review settings July 2, 2026 08:31

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This pull request streamlines the template repository by removing large, generator-produced Git config files and dead/duplicated maintenance files, while keeping the repo’s intended workflows (Quarto build + Zenodo-ready site archive + git-cliff changelog) intact.

Changes:

  • Simplified .gitignore / .gitattributes down to the patterns needed for this repo’s actual toolchain outputs.
  • Simplified scripts/release_site_archive.py to use shutil.make_archive while preserving the --tag / --stage interface used by npm scripts and GitHub Actions.
  • Removed redundant/dead files and updated references to point at AGENTS.md (instead of the deleted .github/copilot-instructions.md).

Reviewed changes

Copilot reviewed 9 out of 11 changed files in this pull request and generated no comments.

Show a summary per file
File Description
test/conftest.py Removes an empty, unused pytest config file.
scripts/release_site_archive.py Simplifies the site-zip creation logic using shutil.make_archive while keeping the release workflow interface.
CONTRIBUTING.md Updates agent guidance link to AGENTS.md.
CODE_OF_CONDUCT.md Normalizes list formatting and updates enforcement contact to an email address.
cliff.toml Removes repo-history-specific commit parsers so downstream instances inherit fewer special cases.
.prettierignore Stops excluding CODE_OF_CONDUCT.md so it stays formatted consistently.
.gitignore Replaces a large generated ignore file with a focused set of entries for this repository’s toolchain.
.github/workflows/changelog.yaml Deletes a CI workflow that generated/printed changelog output without persisting it.
.github/template-site/agent-release-workflow.qmd Updates agent workflow docs to reference AGENTS.md.
.github/copilot-instructions.md Removes redundant agent instructions now covered by AGENTS.md.
.gitattributes Replaces exhaustive tables with * text=auto plus a focused list of binary patterns.

@coderabbitai

coderabbitai Bot commented Jul 2, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

This PR simplifies repository configuration files (.gitattributes, .gitignore, .prettierignore), updates CODE_OF_CONDUCT.md formatting and contact info, removes copilot-instructions.md and the changelog workflow in favor of AGENTS.md references, trims cliff.toml commit parsers, and rewrites the release archive script with fixed paths.

Changes

Repository configuration and documentation cleanup

Layer / File(s) Summary
Simplify .gitattributes and .gitignore
.gitattributes, .gitignore
Replaces extensive language/project-specific rules with a minimal set: global text normalization, notebook/CSV handling, binary extensions, and trimmed Node/Python/R/OS ignore patterns.
Update CODE_OF_CONDUCT, CONTRIBUTING, prettierignore
CODE_OF_CONDUCT.md, CONTRIBUTING.md, .prettierignore
Reformats unacceptable-behavior bullets, replaces GitHub-username contact with a mailto link, updates CONTRIBUTING.md's agent-setup reference to AGENTS.md, and removes CODE_OF_CONDUCT.md from prettierignore.

Copilot instructions to AGENTS.md migration

Layer / File(s) Summary
Migrate references to AGENTS.md
.github/copilot-instructions.md, .github/template-site/agent-release-workflow.qmd
Removes copilot-instructions.md content and updates the agent-release-workflow doc's "Project setup" reference to point to AGENTS.md.

Changelog workflow removal and release script rewrite

Layer / File(s) Summary
Trim changelog workflow and cliff.toml parsers
.github/workflows/changelog.yaml, cliff.toml
Removes the changelog-generation workflow entirely and drops several commit_parsers skip/grouping rules in cliff.toml.
Rewrite release_site_archive.py
scripts/release_site_archive.py
Replaces parameterized helper functions with fixed SITE_DIR/ARCHIVE_DIR constants, a simplified --tag/--stage-only argparse CLI, shutil.make_archive-based zipping, and a direct main() call without exit-code wrapping.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description is detailed, but it does not follow the required template and is missing the Proposed changes, Types of changes, and Checklist sections. Rewrite it using the repository template and include the required headings, checked type boxes, and checklist items.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately summarizes the repo cleanup and removal of dead/generated files.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/ponytail-audit-cleanup

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@scripts/release_site_archive.py`:
- Around line 45-56: The cleanup in release_site_archive.py is too broad because
it removes every site-*.zip from ARCHIVE_DIR, which can delete unrelated
committed release archives and stage those deletions when args.stage is set.
Update the archive cleanup logic around ARCHIVE_DIR.glob and shutil.make_archive
to delete only the current release’s site-{safe_tag}.zip before recreating it,
keeping all other existing ZIPs untouched.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: d13bbd9b-df2a-4325-84a5-a641cfa583dd

📥 Commits

Reviewing files that changed from the base of the PR and between c6ec5bc and 69edf6c.

📒 Files selected for processing (11)
  • .gitattributes
  • .github/copilot-instructions.md
  • .github/template-site/agent-release-workflow.qmd
  • .github/workflows/changelog.yaml
  • .gitignore
  • .prettierignore
  • CODE_OF_CONDUCT.md
  • CONTRIBUTING.md
  • cliff.toml
  • scripts/release_site_archive.py
  • test/conftest.py
💤 Files with no reviewable changes (4)
  • .github/copilot-instructions.md
  • .github/workflows/changelog.yaml
  • .prettierignore
  • cliff.toml

Comment on lines +45 to +56
ARCHIVE_DIR.mkdir(exist_ok=True)
for old_archive in ARCHIVE_DIR.glob("site-*.zip"):
old_archive.unlink()
archive_path = shutil.make_archive(
str(ARCHIVE_DIR / f"site-{safe_tag}"), "zip", SITE_DIR
)


def main() -> int:
args = parse_args()
site_dir = Path(args.site_dir).expanduser().resolve()
archive_dir = Path(args.archive_dir).expanduser().resolve()
safe_tag = sanitize_tag(args.tag or default_tag())
archive_name = f"site-{safe_tag}.zip"
archive_path = archive_dir / archive_name

ensure_site_dir(site_dir)
remove_existing_archives(archive_dir, archive_name)
build_archive(site_dir, archive_path)

if args.stage:
stage_archive_dir(archive_dir)
subprocess.run(
["git", "add", "-A", str(ARCHIVE_DIR)], cwd=REPO_ROOT, check=True
)
print(f"Staged {ARCHIVE_DIR}")

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '\n== release script ==\n'
cat -n scripts/release_site_archive.py

printf '\n== release artifact references ==\n'
rg -n "release-artifacts|site-v\\d|make_archive|stage" -S .

printf '\n== candidate guidance files ==\n'
fd -a -g 'AGENTS.md' -g 'README.md' -g 'CONTRIBUTING.md' -g 'docs/**' .

Repository: maehr/open-research-data-template

Length of output: 3920


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '\n== AGENTS release instructions ==\n'
sed -n '118,186p' AGENTS.md

printf '\n== release-artifacts contents ==\n'
find release-artifacts -maxdepth 1 -type f -name 'site-*.zip' -printf '%f\n' 2>/dev/null | sort

Repository: maehr/open-research-data-template

Length of output: 5776


Limit cleanup to the current release archive

release_site_archive.py:45-56 deletes every site-*.zip in release-artifacts/, so a new release can remove previously committed release ZIPs and, with --stage, stage those deletions too. Remove only site-{safe_tag}.zip instead of purging the whole directory.

🧰 Tools
🪛 ast-grep (0.44.0)

[error] 52-54: Command coming from incoming request
Context: subprocess.run(
["git", "add", "-A", str(ARCHIVE_DIR)], cwd=REPO_ROOT, check=True
)
Note: [CWE-78] Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection').

(subprocess-from-request)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@scripts/release_site_archive.py` around lines 45 - 56, The cleanup in
release_site_archive.py is too broad because it removes every site-*.zip from
ARCHIVE_DIR, which can delete unrelated committed release archives and stage
those deletions when args.stage is set. Update the archive cleanup logic around
ARCHIVE_DIR.glob and shutil.make_archive to delete only the current release’s
site-{safe_tag}.zip before recreating it, keeping all other existing ZIPs
untouched.

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