Commit Graph

50 Commits

Author SHA1 Message Date
Jonathan Miller dcd22dcfdc feat: cascading update channels — stable updates all, rc updates rc+below, etc
Channels cascade downward:
- stable → development, alpha, beta, rc, stable
- rc → development, alpha, beta, rc
- beta → development, alpha, beta
- alpha → development, alpha
- development → development

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-21 16:49:33 -05:00
Jonathan Miller adcbd2d2f4 chore: add .claude-worktree*/ to all gitignore templates
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-21 14:20:56 -05:00
Jonathan Miller 14b4477ff2 docs: document auto-bump on all branches in multi-channel architecture
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-21 12:30:21 -05:00
Jonathan Miller 032c32637f feat: auto-bump patch on all branches including dev
Previously dev branches were excluded from auto-bump. Now all
stability branches (dev, alpha, beta, rc) bump patch automatically.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-21 12:26:57 -05:00
Jonathan Miller 16a86a94b7 docs: add multi-channel updates.xml architecture, update Joomla template listings
- Add Multi-Channel updates.xml Architecture section to README.md
- Document auto-release.yml.template and update-server.yml.template
- Update joomla/index.md with current template inventory

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-21 12:17:46 -05:00
Jonathan Miller b68a23622a fix: remove patch 00 skip in auto-release template, all patches release
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-21 12:11:31 -05:00
Jonathan Miller 005ae12598 feat: MySQL export reads from config files, hardcode jmiller permissions
export-mysql.yml.template:
- Reads MySQL credentials from remote config files automatically:
  - Joomla: configuration.php ($user, $password, $db)
  - Dolibarr: conf/conf.php ($dolibarr_main_db_*)
- No MySQL secrets needed — credentials come from the app config
- Auto-detects platform (Joomla vs Dolibarr)
- Removed DEV_MYSQL_PASSWORD/DEMO_MYSQL_PASSWORD secret requirements

Permission hardcoding:
- Added ALLOWED_USERS="jmiller gitea-actions[bot]" to:
  deploy-demo, deploy-dev, deploy-rs, branch-freeze templates

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-19 17:18:48 -05:00
Jonathan Miller 3834781899 feat: add pull-from-dev and export-mysql workflow templates
pull-from-dev.yml.template:
- Downloads files from dev server via rsync/SSH into repo src/
- Configurable via DEV_SSH_HOST, DEV_SSH_USERNAME, DEV_PULL_PATH vars
- Auth via DEV_SSH_KEY secret
- Dry-run mode, branch selection, diff preview

export-mysql.yml.template:
- Exports MySQL database from dev or demo server
- Supports both Joomla and Dolibarr environments
- Sanitizes PII: passwords (bcrypt), emails, sessions, API keys, tokens
- Preserves admin/moko emails, strips everything else
- Dolibarr-specific: clears api_key, pass_crypted, ldap_pass, oauth secrets
- Saves as artifact (30d retention) or commits to sql/exports/
- Configurable per environment (dev/demo) via org or repo variables

Required variables (org or repo):
- DEV_SSH_HOST, DEV_SSH_PORT, DEV_SSH_USERNAME
- DEV_MYSQL_DATABASE, DEV_MYSQL_USER
- Secrets: DEV_SSH_KEY, DEV_MYSQL_PASSWORD

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-19 15:02:01 -05:00
Jonathan Miller c00a04087f Fix: protected files skip entirely before stale token check
Protected files (like updates.xml) were being overwritten because
the stale-token check ran AFTER the canOverwrite gate. Now protected
files continue (skip) immediately, even with --force.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-19 14:10:14 -05:00
Jonathan Miller 2b9bfb032e Protect updates.xml from bulk sync overwrite
Set protected=true, remove template reference. updates.xml is managed
by the release workflow, not bulk sync — sync was replacing it with
a stub template containing {{EXTENSION_NAME}} placeholders.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-19 13:07:35 -05:00
Jonathan Miller b9109c51bc docs: update release cycle — Gitea-only pre-release, dual stable downloads
- Added platform distribution table (stable=dual, pre-release=Gitea only)
- Updated all example URLs from GitHub to Gitea
- Stable gets dual <downloadurl> (Gitea + GitHub)
- RC/Beta/Alpha/Dev get single <downloadurl> (Gitea only)
- Updated targetplatform to [56].*
- Updated Dolibarr update.txt URL to Gitea
- Removed sha256/client fields from examples (not used)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-19 13:04:32 -05:00
Jonathan Miller 0f9f110c2d Gitea-primary: update definitions, sync lib, token guidance
- waas-component.tf: 27 lines — GitHub URLs→Gitea, GA_TOKEN guidance,
  gitea-actions[bot], jmiller username
- joomla-template.tf: same pattern
- RepositorySynchronizer.php: jmiller-moko→jmiller

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-19 12:45:23 -05:00
Jonathan Miller 4cf931e7a3 fix: align updates.xml template with MokoCassiopeia format
- Removed copyright/FILE INFORMATION header (not needed in synced XML)
- Hardcoded org names: MokoConsulting (Gitea), mokoconsulting-tech (GitHub)
- Download URLs formatted with line breaks matching MokoCassiopeia
- Target platform: [56].* (matches Joomla 5.x and 6.x)
- PHP minimum: 8.1 (matching live repos)
- Removed {{GITEA_ORG}}/{{GITHUB_ORG}} tokens — orgs are fixed

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-19 01:01:26 -05:00
Jonathan Miller a7f758f888 fix: remove self-require and fix script paths in composer.json
- Removed mokoconsulting-tech/enterprise self-reference from require
  (package cannot require itself)
- Fixed phpcs/phpstan script paths: api/ → lib/ validate/ automation/

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-19 00:55:26 -05:00
Jonathan Miller 7b863f690d fix: remove all stale api/ path references across PHP codebase
Updated ~60 files: comments, usage docs, SCRIPT_PATH constants,
wrapper paths, require paths, error messages, and help text.
All api/validate/ → validate/, api/automation/ → automation/, etc.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-18 19:18:22 -05:00
Jonathan Miller bd53fe834f feat: add gitignore validation, move bulk-repo-sync workflow here
- Add REQUIRED_GITIGNORE_ENTRIES constant with mandatory patterns:
  Sublime project/workspace, sftp-config, IDE dirs, secrets, vendor, logs
- Add validateGitignoreEntries() method for checking required entries
- mergeGitConfigFile() still appends missing entries (non-destructive)
- Add .gitea/workflows/bulk-repo-sync.yml (moved from MokoStandards)
  - Runs from this repo directly (checkout self, not remote)
  - Org updated to MokoConsulting (Gitea)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-18 18:17:24 -05:00
Jonathan Miller 784f423973 Fix remaining --jq, --paginate, --input flags in workflow templates
branch-freeze, repository-cleanup, manage-repo-templates converted
from gh CLI flags to curl/jq equivalents.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-18 17:03:33 -05:00
Jonathan Miller 4742dfcbec fix: rename update.xml → updates.xml across all definitions and templates
Standardizes the Joomla update server filename to `updates.xml` (plural)
across all .tf definitions, workflow templates, and automation scripts.
The singular `update.xml` was inconsistent with the Joomla convention
and the updates.xml.template already in use.

Files fixed: 16 (definitions, templates, automation scripts)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-18 15:39:21 -05:00
Jonathan Miller 5dff3346f0 Fix auto-release template: use Gitea API for main sync, auth push URL
- Replace git push to main with Gitea contents API (bypasses branch protection)
- Add authenticated push URL step after checkout
- Matches MokoCassiopeia release.yml pattern

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-18 12:53:23 -05:00
Jonathan Miller 029033c2f6 Fix: set authenticated push URL in auto-release template for branch protection 2026-04-18 12:34:43 -05:00
Jonathan Miller 700e0abaac Fix: auto-release pushes updates.xml to main for update server
When releasing from a non-main branch, updates.xml is cherry-picked
to main so the Joomla update server always serves current data.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-18 12:02:21 -05:00
Jonathan Miller bbadbfd2ad Fix: jmiller-moko→jmiller, --jq→pipe jq, github-actions→gitea-actions
Remaining cleanup across 12 workflow templates:
- repo_health, auto-assign, auto-dev-issue, branch-freeze,
  deploy-*, repository-cleanup, terraform templates

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-18 11:39:44 -05:00
Jonathan Miller c3fe454eb6 Fix: remove sha256: prefix from update XML templates (Joomla expects raw hex) 2026-04-18 11:33:30 -05:00
Jonathan Miller 70d93fcfa3 Add ensureReleaseTags: create development/beta/release-candidate tags on sync
Ensures all repos have standard release channel tags pointing to
the default branch. Tags are created if missing, skipped if they exist.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
beta development release-candidate
2026-04-17 05:45:31 -05:00
jmiller 259cd87b74 chore: add mokoconsulting-tech/enterprise dependency 2026-04-17 10:33:26 +00:00
Jonathan Miller 89c7dc0091 Fix bulk_sync: resolve label names to IDs, fix username jmiller-moko → jmiller
- Added resolveLabelIds() helper: looks up label IDs from Gitea API
- All issue creation/update calls now pass integer label IDs (Gitea requirement)
- Replaced hardcoded 'jmiller-moko' (GitHub) with 'jmiller' (Gitea) in
  bulk_sync.php, push_files.php, archive_repo.php

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-17 05:30:59 -05:00
Jonathan Miller ce3d63b4db Fix Python heredoc: use os.environ instead of shell var expansion
Quoted heredoc (<< 'PYEOF') prevents shell expansion of ${VAR}.
Pass values via exported env vars and read with os.environ in Python.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-17 05:16:52 -05:00
Jonathan Miller e43802bcb2 Update default-repository.json: Gitea-primary, required workflows list
- .github description updated: Gitea primary, GitHub backup
- Added requiredFiles list for standard shared workflows
- workflows directory now requirementStatus: required

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-16 23:24:46 -05:00
Jonathan Miller fd66d46da3 Replace shivammathur/setup-php with php -v verification
PHP is pre-installed in custom runner image (moko/runner-image:latest).
shivammathur/setup-php is incompatible with Gitea act_runner DinD.
25 workflow templates updated.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-16 23:19:09 -05:00
Jonathan Miller 551307efed Complete Gitea-primary migration: templates, docs, bot identity
- All remaining github-actions[bot] → gitea-actions[bot]
- All remaining gh api calls in non-mirror steps → Gitea API curl
- COMPOSER_AUTH uses GA_TOKEN for Gitea composer registry
- 7 docs updated with correct bot identity and token refs
- gh release create/edit only remains in GitHub mirror sections

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-16 23:00:59 -05:00
Jonathan Miller db0c7771bc Convert all gh CLI calls to Gitea API curl across workflow templates
- gh release view/create/edit/upload → Gitea API curl
- gh api → Gitea API curl with GA_TOKEN
- Download URLs point to Gitea as primary
- GitHub mirror steps preserved with continue-on-error for stable/rc

Affects: 11 workflow templates

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-16 22:45:09 -05:00
Jonathan Miller 13ef483e11 Gitea-primary tokens: GA_TOKEN for Gitea API, GH_TOKEN for GitHub mirror
- All Gitea API calls use secrets.GA_TOKEN (org-level Gitea PAT)
- secrets.GITHUB_TOKEN → secrets.GA_TOKEN across all templates
- secrets.GH_TOKEN reserved for GitHub mirror operations only
- Bot identity: gitea-actions[bot]@mokoconsulting.tech
- gh CLI commands kept only in GitHub mirror steps (continue-on-error)
- gh api calls in auto-assign/auto-dev-issue converted to curl

Affects: 20 workflow templates + 2 standalone yml files

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-16 22:38:49 -05:00
Jonathan Miller 96c7bd9e46 docs: update all references to MokoConsulting org and Gitea URLs
- mokoconsulting-tech → MokoConsulting across all docs
- github.com → git.mokoconsulting.tech
- CLI examples updated with new org name

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-16 22:21:59 -05:00
Jonathan Miller 661f84b9c7 feat: add all templates from MokoStandards
Templates moved from MokoStandards repo:
- templates/configs/ (editor, linting, composer configs)
- templates/docs/ (required + extra doc templates)
- templates/gitea/ (issue templates, CLAUDE.md, copilot-instructions)
- templates/github/ (legacy, kept for reference)
- templates/joomla/ (Joomla component/module/plugin templates)
- templates/makefiles/ (build automation)
- templates/schemas/ (JSON/XML schemas)
- templates/scripts/ (PHP script templates)
- templates/stubs/ (Dolibarr/Joomla stubs)
- templates/build/, fonts/, images/, licenses/, security/, web/

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-16 19:23:09 -05:00
Jonathan Miller 12382e30cc fix: split repoRoot into apiRoot + standardsRoot
- Definitions load from MokoStandards-API (repoRoot = API repo)
- Template files load from MokoStandards (standardsRoot = sibling dir)
- Set MOKOSTANDARDS_ROOT env var to override template source location

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-16 19:18:44 -05:00
Jonathan Miller 5ddd507f7b Fix autoload paths and workflow templates for standalone repo structure
- All PHP files in cli/, deploy/, maintenance/ had __DIR__ . '/../../vendor/autoload.php'
  (from when they lived at /api/cli/ inside MokoStandards). Fixed to /../vendor/autoload.php
- Workflow templates updated to clone MokoStandards-API.git and reference /cli/, /deploy/,
  /maintenance/ paths instead of /api/cli/, /api/deploy/, /api/maintenance/

Affects: 11 PHP files + 11 workflow templates

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-16 19:18:01 -05:00
Jonathan Miller d690b16741 Merge branch 'main' of https://git.mokoconsulting.tech/MokoConsulting/MokoStandards-API
# Conflicts:
#	composer.json
2026-04-16 19:13:17 -05:00
Jonathan Miller f42791464a Migrate workflow templates to reference MokoStandards-API
All templates now clone MokoStandards-API.git (this repo) instead of
MokoStandards.git for CLI tools. Path mappings:
- /tmp/mokostandards → /tmp/mokostandards-api
- /api/cli/ → /cli/
- /api/deploy/ → /deploy/
- /api/maintenance/ → /maintenance/

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-16 19:12:25 -05:00
Jonathan Miller 4f2d000f16 feat: sync to all branches, add listBranches, add ext-zip
- RepositorySynchronizer now syncs files to ALL branches (main + dev + any others)
- Extract syncFilesToBranch() method for per-branch file operations
- Add GiteaAdapter::listBranches() method
- Add ext-zip to composer.json require
- Fix Guzzle base_uri resolution (trailing slash + strip leading slash)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-16 19:11:47 -05:00
Jonathan Miller 1ea4b4f042 chore: add ext-zip to composer.json require
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-16 19:00:03 -05:00
jmiller d7297c1e35 chore: add mokoconsulting-tech/enterprise dependency 2026-04-16 23:52:46 +00:00
Jonathan Miller ed9313e6cb fix: Guzzle base_uri resolution for Gitea API paths
Strip leading slash from endpoints and ensure base_uri has trailing slash
so Guzzle preserves the /api/v1 path prefix per RFC 3986.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-16 18:52:04 -05:00
Jonathan Miller 8e908266d9 feat: migrate to Gitea-only workflows and API 2026-04-16 17:44:37 -05:00
Jonathan Miller b0cc468155 feat: migrate to Gitea-only workflows and API
- RepositorySynchronizer defaults to GiteaAdapter
- PlatformAdapterFactory points to git.mokoconsulting.tech
- All plugins reference .gitea/workflows instead of .github/workflows
- push_files.php uses Gitea API
- Common.php REPO URLs updated to Gitea
- sync_dolibarr_readmes.php updated to Gitea URLs

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-16 17:40:18 -05:00
Jonathan Miller fa0b5b7865 fix: update all workflow templates for Gitea Actions compatibility
- Add GA_TOKEN to token fallback chain across all 25 workflow templates
  (secrets.GA_TOKEN || secrets.GH_TOKEN || github.token)
- Replace hardcoded MokoStandards clone URLs with platform-detecting
  MOKO_CLONE_TOKEN/MOKO_CLONE_HOST env vars in 11 templates
- Replace actions/github-script@v7 with shell-based API calls in
  repo_health (Joomla + Dolibarr) and validate-joomla-project
- Replace hardcoded ApiClient('api.github.com') with PlatformAdapterFactory
  in health-check.yml and integration-tests.yml
- Add TODO markers for terraform github-script blocks (complex logic)
- Update publish-to-mokodolimods token references

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-15 22:43:31 -05:00
Jonathan Miller e96a851617 fix: replace all hardcoded GitHub API URLs with platform adapter pattern
- cli/create_project.php: use PlatformAdapterFactory, guard GraphQL for GitHub-only
- cli/joomla_release.php: use adapter for API init, platform-aware clone/upload URLs
- release/generate_joomla_update_xml.php: use PlatformAdapterFactory for API init
- release/generate_dolibarr_version_txt.php: same
- validate/scan_drift.php: use PlatformAdapterFactory for API init
- validate/check_repo_health.php: use platform-aware API base URL
- validate/check_composer_deps.php: route through adapter ApiClient
- maintenance/repo_inventory.php: route through adapter ApiClient, guard GraphQL
- maintenance/rotate_secrets.php: route through adapter ApiClient
- maintenance/update_version_from_readme.php: use PlatformAdapterFactory, rename method
- lib/Common.php: set primary REPO_URL to Gitea

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-14 22:12:41 -05:00
jmiller 0b80fec88d feat: add templates, CLI dirs, docs, and Gitea-first platform config 2026-04-15 02:35:30 +00:00
Jonathan Miller bc0bff9022 feat: dual-platform support (Gitea + GitHub) and Joomla template tooling
- Add web URL helpers to GitPlatformAdapter interface (getRepoWebUrl,
  getPullRequestWebUrl, getIssueWebUrl, getBranchWebUrl, getMetadataDir,
  getStepSummaryEnvVar) with implementations in both adapters
- Refactor bulk_sync, push_files, repo_cleanup to use PlatformAdapterFactory
  instead of hardcoded GitHub API URLs and raw curl calls
- Fix RepositorySynchronizer override file and .mokostandards migration to
  use platform-aware metadata directories
- Add joomla-template platform type with full definition and detection
- Add bulk_joomla_template.php CLI tool (scaffold, sync, list, sync-updates)
- Dual update servers in templateDetails.xml (Gitea priority 1, GitHub priority 2)
- Dual download URLs in updates.xml (Gitea primary, GitHub fallback)
- Target Joomla 5.x and 6.x, PHP 8.1 minimum

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-14 20:16:28 -05:00
Claude Code 5e63faf229 Initial: MokoStandards Enterprise API extracted from MokoStandards
Standalone Composer package (mokoconsulting-tech/enterprise).
Source: api/, bin/, lib/ directories from MokoStandards main repo.
Autoload paths updated for standalone layout.
2026-04-13 06:12:04 +00:00
jmiller e60fa539b2 Initial commit 2026-04-13 06:11:22 +00:00