Skip to content

refactor: unify test and static-check scripts for local and CI - #2

Open
davfive wants to merge 34 commits into
mainfrom
dmay.isoloate-test-scripts
Open

refactor: unify test and static-check scripts for local and CI#2
davfive wants to merge 34 commits into
mainfrom
dmay.isoloate-test-scripts

Conversation

@davfive

@davfive davfive commented Nov 30, 2025

Copy link
Copy Markdown
Owner
  • Move all test and static analysis logic to ./scripts/ for bash, cmd, and pwsh
  • Update composite GitHub Actions to call shared scripts (no duplication)
  • Add .github/actions/static-checks composite action
  • Update workflows to use composite actions for tests and static checks
  • Ensure local CLI and CI workflows are fully DRY and consistent

- Move all test and static analysis logic to ./scripts/ for bash, cmd, and pwsh
- Update composite GitHub Actions to call shared scripts (no duplication)
- Add .github/actions/static-checks composite action
- Update workflows to use composite actions for tests and static checks
- Ensure local CLI and CI workflows are fully DRY and consistent
- Move shell/ directory into src/gitspaces/shell/ to avoid user-visible top-level clutter and ensure scripts are distributed with the PyPI package.
- Update scripts/install-pypi.sh to install test venvs in /tmp/pypi/<TAG> or /tmp/test.pypi/<TAG> by default, keeping the project directory clean.
- Move all runtime, dev, test, and lint dependencies to pyproject.toml ([project] and [project.optional-dependencies.dev])
- Remove requirements.txt and requirements-dev.txt
- Update all scripts and CI to use `pip install -e .[dev]`
- Update documentation to reflect modern setup and installation
- Ensure all static checks, tests, and workflows use unified dependency management
- Add --fix argument to static-checks.sh/.cmd/.ps1 for ruff+black autofix
- Update DEVELOPMENT.md and README.md with autofix and code quality instructions
- Document platform variants and usage for CI/local workflows
- Rename composite action input and flag from \`--quick\` to \`--no-security\`
- Update scripts to accept/propagate \`--no-security\`
- Move CodeQL \`init\`/\`analyze\` into the reusable \`static-checks\` workflow
- Remove duplicate Bandit/security job from \`test-all.yml\`
- Update docs to reflect the new flag
@github-advanced-security

Copy link
Copy Markdown

This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation.

- Rename composite action input/flag `--quick` → `--no-security` and update callers
- Add `publish_reports` input to reusable `static-checks` to control CodeQL + report publishing
- Move CodeQL run + Bandit publish into `static-checks.yml`; upload Bandit only when `publish_reports` and report exists
- Ensure Bandit upload runs before CodeQL and uses `always()` guard so artifact is preserved on failures
- Adjust composite action to detect WSL (`inputs.windows-shell == 'wsl-bash'`) and expose `bandit_json_exists` output
- Add .github/workflows/allow-pr-merge.yml to produce single check "allow-pr-merge / successful-tests"
- Trigger on completed test-pyall workflow_run for pull requests and only run on success
- Enables requiring a single, authoritative check in branch protection to block merges until the full pipeline passes
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