From f5c8f4244066bf79d5d6c1a4d1115b7bb5e8ef27 Mon Sep 17 00:00:00 2001 From: Moko Standards Bot Date: Fri, 30 Jan 2026 04:44:59 +0000 Subject: [PATCH] chore: sync workflows, scripts, and configurations from MokoStandards --- .github/dependabot.yml | 3 -- .github/workflows/ci.yml | 24 +++++----- .github/workflows/release.yml | 10 ++-- .github/workflows/reusable-deploy.yml | 10 ---- scripts/definitions/crm-module.xml | 40 ++++++++-------- scripts/definitions/default-repository.xml | 2 +- scripts/definitions/waas-component.xml | 50 ++++++++++---------- scripts/maintenance/release_version.py | 3 +- scripts/maintenance/update_changelog.py | 2 + scripts/maintenance/validate_file_headers.py | 1 + scripts/validate/auto_detect_platform.py | 8 ++-- scripts/validate/validate_codeql_config.py | 2 +- scripts/validate/validate_structure_v2.py | 5 +- 13 files changed, 75 insertions(+), 85 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 0c75916..b94720f 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -8,9 +8,6 @@ # VERSION: 01.00.00 # BRIEF: Dependabot configuration for automated dependency updates and security patches # NOTE: Monitors GitHub Actions for vulnerabilities and keeps ecosystem secure -# NOTE: Reviewers and assignees are synced from MokoStandards. Repositories must have -# the "mokoconsulting-tech/maintainers" team configured. Individual assignees -# may be customized per repository if needed. version: 2 updates: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e231bb9..3b6419a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -61,7 +61,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v6 + uses: actions/checkout@v4 - name: Detect platform type id: platform @@ -138,7 +138,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v6 + uses: actions/checkout@v4 - name: Setup PHP uses: shivammathur/setup-php@v2 @@ -175,7 +175,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v6 + uses: actions/checkout@v4 - name: Setup PHP uses: shivammathur/setup-php@v2 @@ -213,10 +213,10 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v6 + uses: actions/checkout@v4 - name: Setup Node.js - uses: actions/setup-node@v6 + uses: actions/setup-node@v4 with: node-version: '20' cache: 'npm' @@ -241,10 +241,10 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v6 + uses: actions/checkout@v4 - name: Setup Python - uses: actions/setup-python@v6 + uses: actions/setup-python@v5 with: python-version: '3.11' cache: 'pip' @@ -280,7 +280,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v6 + uses: actions/checkout@v4 - name: Setup PHP uses: shivammathur/setup-php@v2 @@ -309,10 +309,10 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v6 + uses: actions/checkout@v4 - name: Setup Go - uses: actions/setup-go@v6 + uses: actions/setup-go@v5 with: go-version: '1.21' cache: true @@ -331,7 +331,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v6 + uses: actions/checkout@v4 - name: Setup Ruby uses: ruby/setup-ruby@v1 @@ -353,7 +353,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v6 + uses: actions/checkout@v4 - name: Setup Rust uses: actions-rs/toolchain@v1 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c52174c..0dad5e9 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -54,7 +54,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v6 + uses: actions/checkout@v4 with: fetch-depth: 0 @@ -124,7 +124,7 @@ jobs: md5sum "${ZIP_NAME}" > "${ZIP_NAME}.md5" - name: Upload build artifacts - uses: actions/upload-artifact@v6 + uses: actions/upload-artifact@v4 with: name: release-package path: | @@ -139,10 +139,10 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v6 + uses: actions/checkout@v4 - name: Download build artifacts - uses: actions/download-artifact@v7 + uses: actions/download-artifact@v4.1.3 with: name: release-package path: ./artifacts @@ -175,7 +175,7 @@ jobs: fi - name: Create Release - uses: softprops/action-gh-release@v2 + uses: softprops/action-gh-release@v1 with: tag_name: v${{ steps.version.outputs.version }} name: Release ${{ steps.version.outputs.version }} diff --git a/.github/workflows/reusable-deploy.yml b/.github/workflows/reusable-deploy.yml index 731dffe..d8df592 100644 --- a/.github/workflows/reusable-deploy.yml +++ b/.github/workflows/reusable-deploy.yml @@ -139,10 +139,6 @@ jobs: - name: Setup SSH key if: inputs.deployment-method == 'ssh' || inputs.deployment-method == 'rsync' run: | - if [ -z "${{ secrets.DEPLOY_KEY }}" ]; then - echo "Error: DEPLOY_KEY secret is not set" - exit 1 - fi mkdir -p ~/.ssh echo "${{ secrets.DEPLOY_KEY }}" > ~/.ssh/deploy_key chmod 600 ~/.ssh/deploy_key @@ -248,12 +244,6 @@ jobs: echo "❌ Health check failed after ${TIMEOUT}s" >> $GITHUB_STEP_SUMMARY exit 1 - - name: Cleanup SSH key - if: always() && (inputs.deployment-method == 'ssh' || inputs.deployment-method == 'rsync') - run: | - rm -f ~/.ssh/deploy_key - echo "SSH key cleaned up" - - name: Update deployment status (success) if: success() uses: chrnorm/deployment-status@v2 diff --git a/scripts/definitions/crm-module.xml b/scripts/definitions/crm-module.xml index ccf0530..ea8d9bb 100644 --- a/scripts/definitions/crm-module.xml +++ b/scripts/definitions/crm-module.xml @@ -7,7 +7,7 @@ Standard repository structure for MokoCRM (Dolibarr) modules crm-module mokokrm - 2026-01-30T00:00:00Z + 2026-01-07T00:00:00Z Moko Consulting @@ -17,7 +17,7 @@ README.md Developer-focused documentation for contributors and maintainers - required + true developer CONTRIBUTING.md Contribution guidelines - required + true contributor ROADMAP.md Project roadmap with version goals and milestones - optional + false general LICENSE License file (GPL-3.0-or-later) - Default for Dolibarr/CRM modules - required + true general GPL-3.0-or-later @@ -84,14 +84,14 @@ See LICENSE file for details. CHANGELOG.md Version history and changes - required + true general Makefile Build automation using MokoStandards templates - required + true true developer @@ -110,14 +110,14 @@ See LICENSE file for details. .editorconfig Editor configuration for consistent coding style - required + true developer .gitignore Git ignore patterns - preserved during sync operations - required + true false developer @@ -125,7 +125,7 @@ See LICENSE file for details. .gitattributes Git attributes configuration - required + true developer @@ -136,14 +136,14 @@ See LICENSE file for details. src Module source code for deployment - required + true Contains the actual module code that gets deployed to Dolibarr README.md End-user documentation deployed with the module - required + true end-user core/modules/mod{ModuleName}.class.php Main module descriptor file - required + true developer @@ -192,13 +192,13 @@ See CHANGELOG.md for version history. core Core module files - required + true langs Language translation files - required + true @@ -237,14 +237,14 @@ See CHANGELOG.md for version history. docs Developer and technical documentation - required + true Contains technical documentation, API docs, architecture diagrams index.md Documentation index - required + true @@ -253,7 +253,7 @@ See CHANGELOG.md for version history. scripts Build and maintenance scripts - required + true Contains scripts for building, testing, and deploying @@ -290,14 +290,14 @@ See CHANGELOG.md for version history. tests Test files - required + true Contains unit tests, integration tests, and test fixtures unit Unit tests - required + true diff --git a/scripts/definitions/default-repository.xml b/scripts/definitions/default-repository.xml index c2312c0..54614c0 100644 --- a/scripts/definitions/default-repository.xml +++ b/scripts/definitions/default-repository.xml @@ -7,7 +7,7 @@ Default repository structure applicable to all repository types with minimal requirements library multi-platform - 2026-01-30T00:00:00Z + 2026-01-16T00:00:00Z Moko Consulting diff --git a/scripts/definitions/waas-component.xml b/scripts/definitions/waas-component.xml index 2d6dc96..da092fb 100644 --- a/scripts/definitions/waas-component.xml +++ b/scripts/definitions/waas-component.xml @@ -7,7 +7,7 @@ Standard repository structure for MokoWaaS (Joomla) components waas-component mokowaas - 2026-01-30T00:00:00Z + 2026-01-15T00:00:00Z Moko Consulting @@ -17,14 +17,14 @@ README.md Developer-focused documentation for contributors and maintainers - required + true developer LICENSE License file (GPL-3.0-or-later) - Default for Joomla/WaaS components - required + true general GPL-3.0-or-later @@ -33,21 +33,21 @@ CHANGELOG.md Version history and changes - required + true general SECURITY.md Security policy and vulnerability reporting - required + true general CODE_OF_CONDUCT.md Community code of conduct - required + true true contributor @@ -55,21 +55,21 @@ ROADMAP.md Project roadmap with version goals and milestones - optional + false general CONTRIBUTING.md Contribution guidelines - required + true contributor Makefile Build automation using MokoStandards templates - required + true true developer @@ -88,7 +88,7 @@ .gitignore Git ignore patterns for Joomla development - preserved during sync operations - required + true false developer @@ -129,14 +129,14 @@ .gitattributes Git attributes configuration - required + true developer .editorconfig Editor configuration for consistent coding style - preserved during sync - required + true false developer @@ -148,21 +148,21 @@ site Component frontend (site) code - required + true Contains frontend component code deployed to site controller.php Main site controller - required + true developer manifest.xml Component manifest for site - required + true developer @@ -183,7 +183,7 @@ views Site views - required + true @@ -192,14 +192,14 @@ admin Component backend (admin) code - required + true Contains backend component code for administrator controller.php Main admin controller - required + true developer @@ -220,7 +220,7 @@ views Admin views - required + true @@ -263,7 +263,7 @@ language Language translation files - required + true Contains language INI files @@ -271,14 +271,14 @@ docs Developer and technical documentation - required + true Contains technical documentation, API docs, architecture diagrams index.md Documentation index - required + true @@ -287,7 +287,7 @@ scripts Build and maintenance scripts - required + true Contains scripts for building, testing, and deploying @@ -325,14 +325,14 @@ tests Test files - required + true Contains unit tests, integration tests, and test fixtures unit Unit tests - required + true diff --git a/scripts/maintenance/release_version.py b/scripts/maintenance/release_version.py index 34f743e..6473d27 100755 --- a/scripts/maintenance/release_version.py +++ b/scripts/maintenance/release_version.py @@ -27,12 +27,13 @@ NOTE: Updates CHANGELOG.md and optionally updates VERSION in files """ import argparse +import json import re import subprocess import sys from datetime import datetime from pathlib import Path -from typing import List, Optional +from typing import List, Optional, Tuple class VersionReleaser: diff --git a/scripts/maintenance/update_changelog.py b/scripts/maintenance/update_changelog.py index c6177c3..124cf6d 100755 --- a/scripts/maintenance/update_changelog.py +++ b/scripts/maintenance/update_changelog.py @@ -27,8 +27,10 @@ NOTE: Follows Keep a Changelog format, supports Added/Changed/Deprecated/Removed """ import argparse +import os import re import sys +from datetime import datetime from pathlib import Path from typing import List, Optional diff --git a/scripts/maintenance/validate_file_headers.py b/scripts/maintenance/validate_file_headers.py index a4e9f72..a61b142 100755 --- a/scripts/maintenance/validate_file_headers.py +++ b/scripts/maintenance/validate_file_headers.py @@ -28,6 +28,7 @@ VERSION: 05.00.00 BRIEF: Validate copyright headers and file information in repository files """ +import os import sys from pathlib import Path from typing import List, Tuple, Dict diff --git a/scripts/validate/auto_detect_platform.py b/scripts/validate/auto_detect_platform.py index 121cad2..fc1ed32 100755 --- a/scripts/validate/auto_detect_platform.py +++ b/scripts/validate/auto_detect_platform.py @@ -31,13 +31,14 @@ Exit codes: import argparse import hashlib import json +import os import pickle import sys import xml.etree.ElementTree as ET -from dataclasses import dataclass +from dataclasses import dataclass, asdict from enum import Enum from pathlib import Path -from typing import Dict, List, Optional +from typing import Dict, List, Optional, Tuple # Version @@ -145,7 +146,6 @@ class DetectionCache: with open(cache_file, 'wb') as f: pickle.dump(result, f) except (pickle.PickleError, OSError): - # Ignore cache write failures: cache is optional optimization pass def clear(self) -> None: @@ -154,7 +154,6 @@ class DetectionCache: try: cache_file.unlink() except OSError: - # Ignore failures to delete cache files: stale cache entries are non-critical pass @@ -229,6 +228,7 @@ class PlatformDetector: indicators: List[str] = [] metadata: Dict[str, str] = {} + manifest_patterns = ["**/*.xml"] skip_dirs = {".git", "vendor", "node_modules", ".github"} for xml_file in self.repo_path.glob("**/*.xml"): diff --git a/scripts/validate/validate_codeql_config.py b/scripts/validate/validate_codeql_config.py index 2246519..b0f2c91 100755 --- a/scripts/validate/validate_codeql_config.py +++ b/scripts/validate/validate_codeql_config.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 """ -Copyright (C) 2025-2026 Moko Consulting +Copyright (C) 2026 Moko Consulting This file is part of a Moko Consulting project. diff --git a/scripts/validate/validate_structure_v2.py b/scripts/validate/validate_structure_v2.py index 06a901b..1a9daef 100755 --- a/scripts/validate/validate_structure_v2.py +++ b/scripts/validate/validate_structure_v2.py @@ -27,11 +27,12 @@ Exit codes: """ import sys +import os import argparse import xml.etree.ElementTree as ET import json from pathlib import Path -from typing import List, Dict, Optional, Any +from typing import List, Dict, Tuple, Optional, Any from dataclasses import dataclass from enum import Enum @@ -112,8 +113,6 @@ class RepositoryStructureValidator: elif content.startswith('