Repository navigation
test(chart): render ingress.yaml and the service/serviceaccount/configmap wiring under helm unittest (charts/prow-github-app/tests) - #626
Conversation
…gmap wiring under helm unittest The ingress is the documented webhook entry point yet no suite rendered it and both kind installs leave it disabled; the service port name it targets, the serviceAccount.create false fallback, github.apiUrl, extraEnv, image.tag's appVersion default and fullnameOverride were likewise never asserted. Each case fails when its template arm is removed. Closes #625 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: quality <280983584+hivecommons-hive[bot]@users.noreply.github.com>
|
Important Held for human review by the hive's ACMM level gate. This PR was opened by the "quality" agent while Hive policy required a human checkpoint for that agent. Agent PRs are held at ACMM L3–L5; an Hive will keep the |
fc8ae8e
ℹ️ Sentinel notice — informational; author is trusted (hive agent), merge is not blockedHive flagged this PR (author @hivecommons-hive[bot], head
Hive did not add the |
There was a problem hiding this comment.
Conclusion: the tests are sound, but build-test is red because of this PR's own YAML quoting — seven yaml/quotes lint errors need fixing before this can merge.
The failing check is not infrastructure. npm run lint (run 40970358907, build-test job) fails on the two new files:
charts/prow-github-app/tests/ingress_test.yaml:24,41,59—path: "spec.rules[0].host"etc.charts/prow-github-app/tests/wiring_test.yaml:127,129,138,140—path: "spec.template.spec.containers[0].image"etc.
The repo's eslint yaml/quotes rule requires single quotes. Each of the seven is a bracketed JSONPath that does need quoting inside a flow mapping, so the fix is mechanical: "…" → '…' (e.g. {path: 'spec.rules[0].host', …}). npx eslint --fix charts/prow-github-app/tests/ should do all seven. The jsdoc/check-param-names warning in src/issueComment/cc.ts:78 is pre-existing, not this PR's.
On the substance, I verified the assertions against the templates at this head:
ingress.yaml:24—pathType: {{ .pathType | default "Prefix" }}matches the Prefix-default case;ingress.yaml:29backs theport: {name: http}backend assertion, andservice.yaml:10names the service porthttp, so the wiring_test "port named http" case is asserting the real contract between the two templates.serviceaccount.yaml:1gates on.Values.serviceAccount.create, and_helpers.tpl:30-34falls back to"default"when create is false — the three SA cases match.configmap.yaml:11-13pipesPROW_DRY_RUNthroughtoString | quoteand emitsGITHUB_API_URLonly whengithub.apiUrlis set — the string-typed data assertion is correct.
The PR body's claim that no workflow change is needed is right: the chart job's existing helm unittest charts/prow-github-app step picked the suites up and passed at this head. Once the quoting is fixed this looks correct to me; the coverage gap it closes (ingress rendered by neither test suite nor the ci/*.yaml installs) is real.
— hive: agent=reviewer backend=copilot model=claude-fable-5 copilot=1.0.88
jeefy
left a comment
There was a problem hiding this comment.
Thanks — ingress and the wiring were the two things my 15 specs skipped, so this is welcome. build-test is red on yaml/quotes (the repo's eslint config lints chart test yaml and wants single quotes; see the errors at lines 24, 41, 127-140). Fix those and I will merge.
|
/kind cleanup |
The repo's eslint yaml/quotes rule lints chart test YAML and requires single quotes; the seven bracketed paths inside flow mappings were double-quoted and failed build-test on #626. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: quality <280983584+hivecommons-hive[bot]@users.noreply.github.com>
|
Thanks @jeefy — fixed in a8cb8b4: the seven bracketed JSONPaths ( 🐝 Hive Agent: — hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88 |
a8cb8b4
ℹ️ Sentinel notice — informational; author is trusted (hive agent), merge is not blockedHive flagged this PR (author @hivecommons-hive[bot], head
Hive did not add the |
There was a problem hiding this comment.
Looks correct to me; @jeefy's requested change is addressed at the current head (a8cb8b4).
Both prior reviews were on fc8ae8e, where build-test failed on seven yaml/quotes errors. a8cb8b4 single-quotes the bracketed JSONPaths ('spec.rules[0].host' etc.) and every check on this head is now green, including build-test and chart.
What I verified against the tree at a8cb8b4, not just the diff:
tests/ingress_test.yamlassertions matchtemplates/ingress.yamlexactly:{{- if .Values.ingress.enabled }}gates the whole document (line 1),pathType: {{ .pathType | default "Prefix" }}(line 25), backendport: name: httptoinclude "prow-github-app.fullname" $(lines 27–30), andwith-gatedclassName/tls/annotations. The disabled-by-default case matchesvalues.yaml:56(ingress.enabled: false).tests/wiring_test.yamlmatches the templates and helpers:service.yamlports[{name: http, port: 8080, targetPort: http}](values.yaml:53port: 8080);serviceAccountNamehelper falls back todefaultwhencreate: falseand to the fullname otherwise (_helpers.tpl:30-36);configmap.yamlquotesPROW_DRY_RUNvia| toString | quoteand gatesGITHUB_API_URLon.Values.github.apiUrl;prow-github-app.imageisrepository:(default .Chart.AppVersion .Values.image.tag)(_helpers.tpl:43-45), matching theappVersion: 3.4.0case;fullnameOverrideshort-circuits in_helpers.tpl:6-8, matching the cross-reference assertions.- Tests-only: the diff adds the two suites and touches nothing under
templates/,values*,src/or workflows, matching the PR body's scope claim. Both checkboxes of #625 are covered, andCloses #625is the right link — nothing in the issue is left open.
The hold label is the repo's hold-gated agent-PR policy, so merging remains a maintainer's call — but from a correctness standpoint I found nothing to change.
— hive: agent=reviewer backend=copilot model=claude-fable-5 copilot=1.0.88
The requested yaml/quotes fix landed at a8cb8b4; build-test and chart are green on that head.
Test Improvement
Two helm-unittest suites under
charts/prow-github-app/tests/; nothing undertemplates/,values*,ci/,src/, docs or workflows.tests/ingress_test.yaml— disabled renders no document; the installdocs/github-app.md:79-81documents (className=nginx, one host,/webhookExact) renders anetworking.k8s.io/v1Ingress whose backend is the chart fullname on port namehttp; a path withoutpathTypegetsPrefix;tls/annotationspass through and each host becomes one rule.tests/wiring_test.yaml—service.yamlnames its porthttp(the contract the ingress backend and the probes rely on) and selects the selector labels; the ServiceAccount is token-less and release-named,serviceAccount.name/annotationspass through to the account and both pod specs,create: falserenders no account and the pods usedefault(or the given name); the ConfigMap carries theprow.*inputs as strings, addsGITHUB_API_URLonly whengithub.apiUrlis set, and is what both containersenvFrom;extraEnventries land after the chart's own env in both containers; an emptyimage.tagresolves toChart.AppVersion,image.tag/pullPolicy/imagePullSecretsoverride in both pod specs;fullnameOverridenames every resource and the references between them.Why. The ingress is the webhook's public entry point, yet
schema_test.yamlandtopology_test.yamlrender only deployment/pdb/secret/cronjob, and bothci/*.yamlkind installs leaveingress.enabledfalse — so the template was reached by neither suite (run 40969205788,chartjob green). The service/serviceaccount/configmap templates were reached end to end with default values only; none of their non-default arms was asserted anywhere.Files / cluster claimed —
charts/prow-github-app/tests/{ingress,wiring}_test.yamlonly; disjoint from #621 (__tests__/bundle/,src/issueComment/labelSync.ts).Testing
At the PR head on main@db0322e, helm 3.19.0 + helm-unittest 1.2.1:
helm unittest charts/prow-github-app— 4 suites, 30 tests passed (15 existing + 15 new)pathType | default "Prefix"→"ImplementationSpecific"; backendport: {name: http}→number: 8080; dropping theclassName,tlsorannotationswithblocks; invertingif .Values.ingress.enabled; service portname: http→web;serviceAccountNamefallback"default"→"none";if .Values.serviceAccount.create→if true; dropping the SAannotationsblock; dropping or unconditionalising theGITHUB_API_URLarm; dropping| toString | quoteonPROW_DRY_RUN; dropping theextraEnvrange, or moving it abovePROW_REPLICAS;default .Chart.AppVersion .Values.image.tag→.Values.image.tag;if .Values.fullnameOverride→if false; dropping the CronJobimagePullSecretsblock.github/workflowschange is needed: thechartjob's existinghelm unittest charts/prow-github-appstep picks the new files upRelated Issue
Closes #625 — both boxes of the finding are in this PR.
Filed by quality agent (hold-gated mode). Human review required.
— hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88