feat: delete orphan workflows during sync — preserve custom-* prefix #315

Merged
jmiller merged 4 commits from feature/delete-orphan-workflows into main 2026-06-23 21:49:40 +00:00
Owner

Summary

workflow_sync.php --delete-orphans now removes workflows from repos that are not in the platform template.

Protected from deletion:

  • Workflows matching template names (synced normally)
  • Workflows with custom- prefix (repo-specific convention)
  • The custom/ subdirectory (future: subfolder discovery, see #314)

New methods:

  • deleteOrphanWorkflows() — compares repo workflows against template, deletes extras
  • deleteFile() — deletes a file via Gitea Contents API
  • listWorkflowEntries() — lists all entries (files + dirs) in workflows dir

Test plan

  • php -l cli/workflow_sync.php passes
  • --delete-orphans with --dry-run shows WOULD DELETE for non-template workflows
  • custom-*.yml files are preserved (shown as KEPT)
  • Template workflows are not deleted
  • Summary line includes deleted count
## Summary `workflow_sync.php --delete-orphans` now removes workflows from repos that are not in the platform template. **Protected from deletion:** - Workflows matching template names (synced normally) - Workflows with `custom-` prefix (repo-specific convention) - The `custom/` subdirectory (future: subfolder discovery, see #314) **New methods:** - `deleteOrphanWorkflows()` — compares repo workflows against template, deletes extras - `deleteFile()` — deletes a file via Gitea Contents API - `listWorkflowEntries()` — lists all entries (files + dirs) in workflows dir ## Test plan - [ ] `php -l cli/workflow_sync.php` passes - [ ] `--delete-orphans` with `--dry-run` shows WOULD DELETE for non-template workflows - [ ] `custom-*.yml` files are preserved (shown as KEPT) - [ ] Template workflows are not deleted - [ ] Summary line includes deleted count
jmiller added 1 commit 2026-06-23 18:31:45 +00:00
feat: delete orphan workflows during sync — preserve custom-* prefix
Platform: mokocli CI / Gate 2: Unit Tests (8.1) (pull_request) Blocked by required conditions
Platform: mokocli CI / Gate 2: Unit Tests (8.2) (pull_request) Blocked by required conditions
Platform: mokocli CI / Gate 2: Unit Tests (8.3) (pull_request) Blocked by required conditions
Platform: mokocli CI / Gate 3: Self-Health Check (pull_request) Blocked by required conditions
Platform: mokocli CI / Gate 4: Governance (pull_request) Blocked by required conditions
Platform: mokocli CI / Gate 5: Template Integrity (pull_request) Blocked by required conditions
Platform: mokocli CI / CI Summary (pull_request) Blocked by required conditions
Universal: PR Check / Build RC Package (pull_request) Blocked by required conditions
Universal: PR Check / Report Issues (pull_request) Blocked by required conditions
Generic: Repo Health / Scripts governance (pull_request) Blocked by required conditions
Generic: Repo Health / Repository health (pull_request) Blocked by required conditions
Generic: Repo Health / Report Issues (pull_request) Blocked by required conditions
Universal: Auto Version Bump / Version Bump (push) Successful in 29s
Universal: Build & Release / Promote to RC (pull_request) Failing after 16s
Universal: Build & Release / Build & Release Pipeline (pull_request) Has been skipped
Universal: PR Check / Branch Policy (pull_request) Failing after 2s
Universal: PR Check / Secret Scan (pull_request) Successful in 6s
Universal: PR Check / Validate PR (pull_request) Failing after 4s
Generic: Repo Health / Access control (pull_request) Successful in 1s
Generic: Repo Health / Site Health (pull_request) Has been skipped
Platform: mokocli CI / Gate 1: Code Quality (pull_request) Failing after 1m38s
8cea26d748
workflow_sync.php --delete-orphans now removes workflows from repos that
are not in the platform template. Protected from deletion:
- Workflows matching template names (synced normally)
- Workflows with custom- prefix (repo-specific convention)
- The custom/ subdirectory (future: subfolder discovery)
jmiller added 1 commit 2026-06-23 18:34:41 +00:00
jmiller added 1 commit 2026-06-23 19:13:45 +00:00
fix: address review findings in workflow_sync.php
Platform: mokocli CI / Gate 2: Unit Tests (8.1) (pull_request) Blocked by required conditions
Platform: mokocli CI / Gate 2: Unit Tests (8.2) (pull_request) Blocked by required conditions
Platform: mokocli CI / Gate 2: Unit Tests (8.3) (pull_request) Blocked by required conditions
Platform: mokocli CI / Gate 3: Self-Health Check (pull_request) Blocked by required conditions
Platform: mokocli CI / Gate 4: Governance (pull_request) Blocked by required conditions
Platform: mokocli CI / Gate 5: Template Integrity (pull_request) Blocked by required conditions
Platform: mokocli CI / CI Summary (pull_request) Blocked by required conditions
Universal: PR Check / Build RC Package (pull_request) Blocked by required conditions
Universal: PR Check / Report Issues (pull_request) Blocked by required conditions
Generic: Repo Health / Scripts governance (pull_request) Blocked by required conditions
Generic: Repo Health / Repository health (pull_request) Blocked by required conditions
Generic: Repo Health / Report Issues (pull_request) Blocked by required conditions
Universal: PR Check / Branch Policy (pull_request) Failing after 1s
Generic: Repo Health / Access control (pull_request) Successful in 2s
Generic: Repo Health / Site Health (pull_request) Has been skipped
Universal: PR Check / Validate PR (pull_request) Failing after 13s
Universal: PR Check / Secret Scan (pull_request) Successful in 16s
Universal: Auto Version Bump / Version Bump (push) Successful in 26s
Platform: mokocli CI / Gate 1: Code Quality (pull_request) Failing after 1m0s
2d856c8846
- Fix #1: protect PLATFORM_EXCLUDES workflows from orphan deletion
- Fix #2: remove dead CUSTOM_DIR constant and listWorkflowEntries()
- Fix #3: fix pre-existing undefined $label bug on EXCLUDED branch
jmiller added 1 commit 2026-06-23 19:14:13 +00:00
chore(version): auto-bump patch 09.38.02-dev [skip ci]
RC Revert / Rename rc/ back to dev/ (pull_request) Has been skipped
Universal: Build & Release / Promote to RC (pull_request) Has been skipped
Branch Cleanup / Delete merged branch (pull_request) Failing after 3s
Universal: Workflow Sync Trigger / Sync workflows to live repos (pull_request) Failing after 6s
Universal: Build & Release / Build & Release Pipeline (pull_request) Successful in 30s
5a918e2d1f
jmiller merged commit 4e3e9b7899 into main 2026-06-23 21:49:40 +00:00
jmiller deleted branch feature/delete-orphan-workflows 2026-06-23 21:49:42 +00:00
Sign in to join this conversation.
No Reviewers
No labels
Priority -
Type -
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: MokoConsulting/MokoCLI#315