Skip to content

Helm chart structure and templating pack#646

Open
davidgamero wants to merge 2 commits intoAzure:mainfrom
davidgamero:feat/helm-knowledge-pack
Open

Helm chart structure and templating pack#646
davidgamero wants to merge 2 commits intoAzure:mainfrom
davidgamero:feat/helm-knowledge-pack

Conversation

@davidgamero
Copy link
Copy Markdown
Contributor

Add tests for helm packs ensuring helm context is retrieved

Also adds helm-pack.test.ts with schema validation, structural invariant checks, and matcher integration tests to verify entries surface correctly for Helm-related queries.

Add helm-pack.json with 56 Helm best practice entries covering chart
structure, template patterns, security, values conventions, dependencies,
RBAC, networking, and lifecycle hooks. All entries use category=kubernetes
with helm and generate-k8s-manifests tags for proper tool matching.

Also adds helm-pack.test.ts with schema validation, structural invariant
checks, and matcher integration tests to verify entries surface correctly
for Helm-related queries.
Copilot AI review requested due to automatic review settings April 9, 2026 20:13
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new Helm-focused knowledge pack and expands unit tests to ensure Helm-related knowledge is validated, loaded, and discoverable via the matcher—improving Helm chart guidance coverage in the knowledge system.

Changes:

  • Added knowledge/packs/helm-pack.json with Helm chart structure/templating recommendations and tags.
  • Added test/unit/knowledge/helm-pack.test.ts to validate schema/structure and verify matcher behavior for Helm queries.
  • Updated knowledge loader and taxonomy tests/docs to account for the new Helm pack and helm tag.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
test/unit/knowledge/loader.test.ts Updates expectations/formatting for built-in pack list and pack count after adding Helm pack.
test/unit/knowledge/helm-pack.test.ts New targeted unit tests for Helm pack schema/invariants and matcher integration.
knowledge/TAG_TAXONOMY.md Documents new helm tool tag and adds a version-history entry.
knowledge/packs/helm-pack.json New Helm knowledge pack entries (rules) with tags and patterns for matcher-based retrieval.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 206 to +210
console.log(` Total Packs: ${expectedPackCount}`);
console.log(` Total Entries: ${entries.length}`);
console.log(` Avg Entries/Pack: ${Math.round(entries.length / expectedPackCount)}`);

const categoryCounts = entries.reduce((acc, entry) => {
acc[entry.category] = (acc[entry.category] || 0) + 1;
return acc;
}, {} as Record<string, number>);
const categoryCounts = entries.reduce(
Copy link

Copilot AI Apr 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the statistics block, expectedPackCount is still hardcoded to 28, but earlier in this file the built-in pack count was updated to 29 (and the directory listing includes helm-pack.json). This makes the logged pack/avg numbers inconsistent; update the constant (or derive it from expectedPacks.length / directory listing) so it stays in sync.

Copilot uses AI. Check for mistakes.
Comment on lines +313 to +316
### v1.1.0 (2026-04-08)
- Added `helm` tool tag for Helm chart generation knowledge
- Added Helm knowledge pack with 56 entries across 10 categories

Copy link

Copilot AI Apr 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The version history entry claims the Helm knowledge pack has “56 entries across 10 categories”, but the new helm pack entries are all in the kubernetes category (and tests enforce that). Please correct this line to avoid misleading documentation (e.g., “56 entries across 10 topic areas/tags” or “56 entries in the kubernetes category”).

Copilot uses AI. Check for mistakes.
Comment on lines +306 to +310
{
"id": "helm-whitespace-trim-hyphen",
"category": "kubernetes",
"pattern": "helm|template|whitespace|{{-| -}}|yaml",
"recommendation": "Use hyphen trimming markers deliberately in templates to control whitespace. Missing or misplaced `{{-` / `-}}` commonly introduces blank lines or indentation breakage.",
Copy link

Copilot AI Apr 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This pattern contains unescaped { / } (e.g., {{-), which will throw during new RegExp(entry.pattern, ...) in the matcher and cause the entry to be skipped for pattern matching. Escape the braces (or change the pattern to avoid literal Go-template delimiters) so it remains a valid JavaScript RegExp.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants