chore: improve tooling quality and docs

- close_issue.sh: add set -euo pipefail, argument validation, confirmation output
- mark_issue.sh: track previously untracked claim/release script
- create_pr.sh: remove hardcoded one-off (use create_pr.py instead)
- README.md: reflect current toolset with usage examples
- .gitignore: ignore venv/ and __pycache__/
This commit is contained in:
2026-06-21 17:11:44 -04:00
parent d3659534ef
commit 7404f768d3
5 changed files with 104 additions and 29 deletions
+35 -11
View File
@@ -2,23 +2,47 @@
A collection of Python and Bash scripts to automate interactions with Gitea instances.
## Setup
## Supported Instances
A Python virtual environment is included. Activate it using:
```bash
source venv/bin/activate
```
| Remote | Host | Org / Repo |
|----------------|----------------------------|-------------------------------------|
| `dadeschools` | `gitea.dadeschools.net` | `Contractor / Timesheet` |
| `prgs` | `gitea.prgs.cc` | `Scaled-Tech-Consulting / Timesheet`|
## Authentication
These scripts securely extract tokens from the macOS keychain to avoid hardcoding secrets.
- **Dade Schools (gitea.dadeschools.net)**: Retrieved via `git credential fill`. Ensure you have logged in via Git over HTTPS at least once so the keychain caches your credentials.
- **NetBridge / Personal (gitea.prgs.cc)**: Retrieved using `security find-generic-password` for the service `netbridge-gitea-token`.
Credentials are retrieved via `git credential fill` for the target host. Ensure you have
logged in via Git over HTTPS at least once so the keychain caches your credentials.
## Available Scripts
- `./create_issue.py` - Create an issue in the Gitea tracker
- `./create_pr.py` - Open a Pull Request from a branch via the API
- `./create_pr.sh` - Bash equivalent for creating a PR via the API
- `./close_issue.sh` - Close a specific issue via the API
| Script | Description |
|---------------------|-----------------------------------------------------|
| `create_issue.py` | Create an issue (`--remote`, `--title`, `--body`) |
| `create_pr.py` | Open a Pull Request (`--remote`, `--title`, `--head`, `--base`) |
| `close_issue.sh` | Close a specific issue (dadeschools only) |
| `mark_issue.sh` | Claim/release an issue via `status:in-progress` label |
| `manage_labels.py` | Create label set and apply label mappings (`--dry` to preview) |
### Quick Examples
```bash
# Create an issue
./create_issue.py --title "Fix PDF output" --body "Blank on Safari"
# Create a PR
./create_pr.py --title "feat: add validation" --head feat/validation --body "Closes #12"
# Close issue #5
./close_issue.sh 5
# Claim an issue before working on it
./mark_issue.sh 10 start
# Release when done
./mark_issue.sh 10 done
```
Use `--help` on any Python script for full usage details.