ci: agent skills add chart#3443
Open
j-zimnowoda wants to merge 15 commits into
Open
Conversation
j-zimnowoda
requested review from
Ani1357,
CasLubbers,
ferruhcihan and
merll
as code owners
July 14, 2026 14:21
|
|
||
| function findHelmfileForRelease(helmfileDir: string, releaseName: string): string { | ||
| const files = fs.readdirSync(helmfileDir).filter((f) => f.endsWith('.yaml') || f.endsWith('.gotmpl')) | ||
| const rx = new RegExp(`^\\s*-\\s+name:\\s+${releaseName}\\s*$`, 'm') |
| } | ||
|
|
||
| const defaultRunCommand: CommandRunner = (command, options = {}) => { | ||
| const result = execSync(command, options) |
Contributor
|
Comparison of Helm chart templating output: # apl-operator/templates/deployment.yaml
# apl-operator/templates/rbac.yaml
# oauth2-proxy/templates/httproute.yaml
@@ spec.rules.0 @@
! - one map entry removed:
- filters:
- - type: CORS
- cors:
- allowMethods:
- - GET
- - OPTIONS
- allowOrigins:
- - "https://cloud.linode.com"
- - "https://cloud.staging.linode.com"
- - "https://cloud.dev.linode.com"
# rabbitmq-cluster-operator/templates/messaging-topology-operator/validating-webhook-configuration.yaml
# values-repo.yaml
@@ otomi.isPreInstalled @@
! ± value change
- true
+ false
|
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR extends the repo’s CI and agent tooling around adding Helm charts/apps and validating templating changes. It introduces two new CI helper scripts (with Jest tests), adds a new headlamp Helmfile release stub + defaults entry, and updates documentation/workflows to enforce rendered template diff checks.
Changes:
- Add CI scripts for (1) vendoring/wiring a new Helm chart into APL Core and (2) configuring public exposure scaffolding, both with unit tests.
- Add a
headlampHelmfile release stub and defaultapps.headlampentry. - Enforce/encourage template diff checks via docs, skills, workflow updates, and improved
dyff.shoutput for new/deleted directories.
Reviewed changes
Copilot reviewed 14 out of 15 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
jest.config.ts |
Expands Jest roots to include ci/src so CI helper tests run under the main Jest config. |
helmfile.d/snippets/defaults.yaml |
Adds default apps.headlamp toggle. |
helmfile.d/helmfile-92.headlamp.yaml.gotmpl |
Introduces a new headlamp Helmfile release definition using the *default template. |
ci/src/configure-public-exposure.ts |
Adds helper script to modify core.yaml, add *-artifacts release, scaffold HTTPRoute/auth resources, and ensure auth pod labels. |
ci/src/configure-public-exposure.test.ts |
Adds unit tests for configure-public-exposure helpers. |
ci/src/add-app-helm-chart.ts |
Adds helper script to vendor/wire a new Helm chart (resolve stable semver, update chart index, scaffold Helmfile/defaults/values/fixtures). |
ci/src/add-app-helm-chart.test.ts |
Adds unit tests for semver/version resolution logic. |
ci/package.json |
Adds a tests script to run CI script tests via the root Jest runner. |
bin/dyff.sh |
Enhances dyff output to recursively show new/deleted directory contents. |
AGENTS.md |
Adds a short “mandatory template diff check” note using bin/compare.sh. |
.vscode/settings.json |
Adds chat.tools.terminal.autoApprove entries for common repo commands. |
.github/workflows/ci-helm-chart.yml |
Switches to npm ci and runs CI script unit tests in the workflow. |
.github/skills/test-gotemplate-renders/SKILL.md |
Adds a reusable skill doc for running bin/compare.sh on templating-related changes. |
.github/skills/add-app-ingress/SKILL.md |
Adds a reusable skill doc to configure public app exposure via the new CI script. |
.github/skills/add-app-helm-chart/SKILL.md |
Adds a reusable skill doc to add a Helm chart via the new CI script. |
.github/copilot-instructions.md |
Updates Copilot guidance to emphasize mandatory template diff checks and trims older CLI command listings. |
Comment on lines
+228
to
+245
| const parts: string[] = [ | ||
| 'bases:', | ||
| ' - snippets/defaults.yaml', | ||
| '---', | ||
| ' - snippets/defaults.gotmpl', | ||
| '---', | ||
| 'bases:', | ||
| ' - snippets/env.gotmpl', | ||
| '---', | ||
| 'bases:', | ||
| ' - snippets/derived.gotmpl', | ||
| '---', | ||
| '{{ readFile "snippets/templates.gotmpl" }}', | ||
| '{{- $v := .Values }}', | ||
| '{{- $a := $v.apps }}', | ||
| '', | ||
| 'releases:', | ||
| ] |
| } | ||
|
|
||
| const content = fs.readFileSync(valuesFile, 'utf8') | ||
| if (content.includes('otomi.io/auth:') && content.includes('otomi.io/auth-policy:')) { |
Comment on lines
+344
to
+345
| const hasAuth = lines.slice(podLabelsIdx + 1, insertAt).some((line) => line.trim().startsWith('otomi.io/auth:')) | ||
| const hasAuthPolicy = lines.slice(podLabelsIdx + 1, insertAt).some((line) => line.trim().startsWith('otomi.io/auth-policy:')) |
Comment on lines
61
to
72
| "[dockerfile]": { | ||
| "editor.defaultFormatter": "ms-azuretools.vscode-docker" | ||
| }, | ||
| "chat.tools.terminal.autoApprove": { | ||
| "npx tsx ci/src/configure-public-exposure.ts headlamp": true, | ||
| "npx tsx ci/src/add-app-helm-chart.ts headlamp": true, | ||
| "export ENV_DIR=$PWD/tests/fixtures": true, | ||
| "bin/compare.sh": true, | ||
| "npm run validate-values": true, | ||
| "npm run validate-templates": true | ||
| } | ||
| } |
Comment on lines
+229
to
+246
| const parts: string[] = [ | ||
| 'bases:', | ||
| ' - snippets/defaults.yaml', | ||
| '---', | ||
| ' - snippets/defaults.gotmpl', | ||
| '---', | ||
| 'bases:', | ||
| ' - snippets/env.gotmpl', | ||
| '---', | ||
| 'bases:', | ||
| ' - snippets/derived.gotmpl', | ||
| '---', | ||
| '{{ readFile "snippets/templates.gotmpl" }}', | ||
| '{{- $v := .Values }}', | ||
| '{{- $a := $v.apps }}', | ||
| '', | ||
| 'releases:', | ||
| ] |
Comment on lines
+112
to
+114
| const files = fs.readdirSync(helmfileDir).filter((f) => f.endsWith('.yaml') || f.endsWith('.gotmpl')) | ||
| const rx = new RegExp(`^\\s*-\\s+name:\\s+${releaseName}\\s*$`, 'm') | ||
| const matches = files.filter((file) => rx.test(fs.readFileSync(path.join(helmfileDir, file), 'utf8'))) |
Comment on lines
+5
to
+13
| When code changes any file under `charts/`, `values/`, or `helmfile.d/`, run: | ||
|
|
||
| if no ENV_DIR is set then | ||
|
|
||
| ```bash | ||
|
|
||
| export ENV_DIR=$PWD/tests/fixtures | ||
| bin/compare.sh | ||
| ``` |
| - [ ] Create values/<name>/<name>.gotmpl. | ||
| - [ ] Add tests fixture app file in tests/fixtures/env/apps/<name>.yaml. | ||
| - [ ] Add corresponding app entries in tests/integration/\*.yaml. | ||
| - [ ] If public exposure is needed, run the configure-public-app-exposure skill afterward. |
| - Chart version is auto-selected as latest stable semver; pre-release versions are ignored. | ||
| - Main implementation is in ci/src/add-app-helm-chart.ts. | ||
| - .github/skills/add-app-helm-chart/scripts/add-app-helm-chart.sh is a compatibility wrapper. | ||
| - Script confirms rendering path by running bin/compare.sh. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📌 Summary
This pull request introduces several improvements to the developer workflow, documentation, and test coverage for adding and exposing Helm charts and apps. The main focus is on enforcing template diff checks, adding reusable skills for common tasks, and improving testability and automation in the CI process.
🔍 Reviewer Notes
🧹 Checklist