Compare commits
18
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0afe2a231f | ||
|
|
65265e48a4 | ||
|
|
49399deb3d | ||
|
|
9fe4257490 | ||
|
|
0965a45653 | ||
|
|
bfd41c8e0d | ||
|
|
9c30a30754 | ||
|
|
ee8953bd93 | ||
|
|
5bc3167286 | ||
|
|
1a3368e119 | ||
|
|
1ddba883c9 | ||
|
|
da8044d6f2 | ||
|
|
67ba48da1f | ||
|
|
5196609974 | ||
|
|
49e09a6776 | ||
|
|
748016f105 | ||
|
|
6514aaa688 | ||
|
|
3ac47adc21 |
No files matched your search
@@ -1,38 +0,0 @@
|
||||
name: GitOps validation
|
||||
'on':
|
||||
workflow_call:
|
||||
permissions:
|
||||
contents: read
|
||||
jobs:
|
||||
validate:
|
||||
runs-on: ubuntu-24.04
|
||||
timeout-minutes: 5
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Install verified Kustomize
|
||||
shell: bash
|
||||
run: |
|
||||
set -euo pipefail
|
||||
tool_dir="$RUNNER_TEMP/qqq-kustomize"
|
||||
mkdir -p "$tool_dir"
|
||||
curl --fail --silent --show-error --location --retry 2 --max-time 60 \
|
||||
https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize/v5.7.1/kustomize_v5.7.1_linux_amd64.tar.gz \
|
||||
--output "$tool_dir/kustomize.tar.gz"
|
||||
echo "ea375e7372f9aa029129d4b2d16c66b7750b7f1213c4f66f910d981c895818d8 $tool_dir/kustomize.tar.gz" | sha256sum --check --status
|
||||
tar -xzf "$tool_dir/kustomize.tar.gz" -C "$tool_dir" kustomize
|
||||
echo "$tool_dir" >> "$GITHUB_PATH"
|
||||
- name: Render every Kustomization
|
||||
shell: bash
|
||||
run: |
|
||||
set -euo pipefail
|
||||
mapfile -d '' manifests < <(find . -path './.git' -prune -o -type f \( -name kustomization.yaml -o -name kustomization.yml -o -name Kustomization \) -print0)
|
||||
if (( ${#manifests[@]} == 0 )); then
|
||||
echo 'No Kustomization found' >&2
|
||||
exit 1
|
||||
fi
|
||||
for manifest in "${manifests[@]}"; do
|
||||
directory=$(dirname "$manifest")
|
||||
# Rendered Secrets must never enter logs or uploaded artifacts.
|
||||
kustomize build "$directory" >/dev/null
|
||||
printf 'Validated %s\n' "$directory"
|
||||
done
|
||||
@@ -1,9 +0,0 @@
|
||||
# GitOps validation
|
||||
|
||||
The orb owns `.github/workflows/gitops.yml`. The consumer keeps only the immutable caller generated by `generate_auxiliary_workflow.py gitops --ref <orb-commit>` at `.github/workflows/validate.yml`.
|
||||
|
||||
One native job downloads Kustomize 5.7.1 with its pinned official SHA-256 and renders every Kustomization, including bases, overlays and proxy declarations. Missing configurations or a failed render fail the job. Rendered resources are discarded rather than logged or uploaded because they may contain Secrets. This checks rendering, not Kubernetes schema compatibility or cluster health. No cluster access or publication credentials are required.
|
||||
|
||||
The caller runs on main pushes and pull requests without path filters, so a required check always reports. Superseded PR runs are canceled. Feature pushes do not create duplicate jobs. Remove the old Circle pipeline only after the native job passes on the consumer, then disable obsolete Circle build requests and require the observed native check with no human review.
|
||||
|
||||
For marketing-website-cd, the prior Circle job only printed Hello World. Its former production role moved to KofTwentyTwo/cluster-gitops; validation does not re-enable that retired deployment path.
|
||||
@@ -407,36 +407,5 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"gitops": {
|
||||
"repository": "QRun-IO/marketing-website-cd",
|
||||
"path": ".github/workflows/validate.yml",
|
||||
"caller": {
|
||||
"name": "GitOps validation",
|
||||
"on": {
|
||||
"push": {
|
||||
"branches": [
|
||||
"main"
|
||||
]
|
||||
},
|
||||
"pull_request": {
|
||||
"branches": [
|
||||
"main"
|
||||
]
|
||||
}
|
||||
},
|
||||
"permissions": {
|
||||
"contents": "read"
|
||||
},
|
||||
"concurrency": {
|
||||
"group": "gitops-${{ github.ref }}",
|
||||
"cancel-in-progress": "${{ github.event_name == 'pull_request' }}"
|
||||
},
|
||||
"jobs": {
|
||||
"gitops": {
|
||||
"uses": "QRun-IO/qqq-orb/.github/workflows/gitops.yml@WORKER_SHA"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -151,7 +151,7 @@ class AuditTests(unittest.TestCase):
|
||||
self.assertIn('profile_not_assigned', [f['code'] for f in report['findings']])
|
||||
|
||||
def test_native_specialists_require_bridges_and_report_remaining_workflows(self):
|
||||
for name, kind in [('qqq-mcp-rag', 'mcp-rag'), ('qqq-business-platform', 'business-db'), ('.github', 'github-workflow-lint'), ('marketing-website-cd', 'gitops')]:
|
||||
for name, kind in [('qqq-mcp-rag', 'mcp-rag'), ('qqq-business-platform', 'business-db'), ('.github', 'github-workflow-lint')]:
|
||||
entry = dict(ENTRY, name=name, nameWithOwner='QRun-IO/' + name)
|
||||
definition = audit.auxiliary.BRIDGES[kind]
|
||||
missing = audit.audit(entry, Snapshot({}), VERSION, SHA, {})
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
import copy
|
||||
import os
|
||||
import subprocess
|
||||
import tempfile
|
||||
import importlib.util
|
||||
import json
|
||||
from pathlib import Path
|
||||
@@ -17,40 +14,6 @@ ORIGINALS = json.loads((ROOT / 'tests/fixtures/auxiliary-original-workflows.json
|
||||
SHA = 'a' * 40
|
||||
|
||||
|
||||
class GitOpsTests(unittest.TestCase):
|
||||
def test_render_all_directories_and_fail_on_invalid_or_missing_configuration(self):
|
||||
worker = yaml.safe_load((ROOT / '.github/workflows/gitops.yml').read_text())
|
||||
command = worker['jobs']['validate']['steps'][-1]['run']
|
||||
with tempfile.TemporaryDirectory() as directory:
|
||||
root = Path(directory)
|
||||
binary = root / 'bin'
|
||||
binary.mkdir()
|
||||
tool = binary / 'kustomize'
|
||||
tool.write_text("#!/bin/bash\n[[ $1 == build ]] || exit 2\n[[ ! -f \"$2/invalid\" ]] || exit 1\necho sensitive-rendered-fixture\n")
|
||||
tool.chmod(0o755)
|
||||
env = {**os.environ, 'PATH': str(binary) + os.pathsep + os.environ['PATH']}
|
||||
def run():
|
||||
return subprocess.run(['bash', '-c', command], cwd=root, env=env, text=True, capture_output=True)
|
||||
self.assertNotEqual(0, run().returncode)
|
||||
for name in ('base', 'overlays/dev', 'overlays/with space', 'proxy'):
|
||||
folder = root / name
|
||||
folder.mkdir(parents=True)
|
||||
(folder / 'kustomization.yaml').write_text('resources: []')
|
||||
result = run()
|
||||
self.assertEqual(0, result.returncode, result.stderr)
|
||||
self.assertEqual(4, result.stdout.count('Validated '))
|
||||
self.assertNotIn('sensitive-rendered-fixture', result.stdout)
|
||||
(root / 'proxy/invalid').touch()
|
||||
self.assertNotEqual(0, run().returncode)
|
||||
|
||||
def test_gitops_caller_is_read_only_and_has_no_duplicate_feature_push_build(self):
|
||||
caller = bridge.canonical('gitops', SHA)
|
||||
self.assertEqual({'contents': 'read'}, caller['permissions'])
|
||||
self.assertEqual(['main'], caller['on']['push']['branches'])
|
||||
self.assertNotIn('paths', caller['on']['pull_request'])
|
||||
self.assertNotIn('secrets', caller['jobs']['gitops'])
|
||||
|
||||
|
||||
class SpecialistNativeTests(unittest.TestCase):
|
||||
def setUp(self):
|
||||
self.originals = json.loads((ROOT / 'tests/fixtures/specialist-native-originals.json').read_text(encoding='utf-8'))
|
||||
|
||||
@@ -42,7 +42,7 @@ PROFILES = {'qqq': 'core', 'qqq-frontend-material-dashboard': 'frontend-material
|
||||
'qqq-android': 'android', 'qqq-mcp-rag-standard-policies': 'mcp-policy',
|
||||
'marketing-website': 'marketing', 'qqq-mcp-rag': 'native-mcp',
|
||||
'qqq-business-platform': 'native-business', '.github': 'native-workflow-lint',
|
||||
'qqq-orb': 'owner-bootstrap', 'marketing-website-cd': 'native-gitops'}
|
||||
'qqq-orb': 'owner-bootstrap'}
|
||||
NO_CI = json.loads((ROOT / 'tools/no-ci-policy.json').read_text(encoding='utf-8'))
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user