Skip to content

feat(chart): support namespaced Issuers - #138

Merged
uniqueg merged 3 commits into
devfrom
feat/136-namespaced-issuer
Nov 23, 2026
Merged

uniqueg merged 3 commits into
devfrom
feat/136-namespaced-issuer

Conversation

@uniqueg

@uniqueg uniqueg commented Nov 23, 2026 •

Copy link
Copy Markdown
Member

Summary

Closes #136.

  • Chart: new value pubgrade.ingress.https.issuerKind, as in FOCA's library chart (feat(chart): support namespaced Issuers foca#820): ClusterIssuer (the default, also when unset or null) or Issuer, which sets cert-manager.io/issuer instead of cert-manager.io/cluster-issuer.
  • pubgrade.ingress.annotations now take precedence over the chart's issuer annotation, and null removes it (before, setting the same key rendered it twice).
  • Rendering fails on other kinds, on an empty issuer while HTTPS is on, and if the annotations name both a ClusterIssuer and an Issuer (cert-manager refuses such Ingresses). The issuer name is always rendered as a string.
  • Docs: new section "Ingress and certificates" in docs/deployment.md, with a namespaced Let's Encrypt Issuer on OpenShift and a second host name via a second Ingress; helm/values.yaml comments.
  • The default renders as before, except that the issuer value is no longer quoted (letsencrypt-prod instead of "letsencrypt-prod"; same YAML string).

Decisions taken

  • extraHosts (optional point 2 of the issue): not added; the docs describe a second Ingress for a second host name, as FOCA's docs do. Moving the chart onto FOCA's library chart stays a separate issue if wanted.
  • Changelog: this repo has no changelog file; release notes are curated in the release-prep PR (docs/development.md). Suggested bullet for the next notes, under Features: "Chart: pubgrade.ingress.https.issuerKind selects a namespaced cert-manager Issuer, and configured Ingress annotations override or remove (null) the chart's (feat(chart): support namespaced cert-manager Issuers #136, #)".
  • An empty pubgrade.ingress.https.issuer with HTTPS on now fails (it rendered an empty annotation before), as in FOCA's chart; use null in annotations or https.enabled: false instead.

Verification

  • tests/chart.sh (Helm 3.22.1): passed; new checks for both kinds, null kind, HTTPS off, overrides and null removal for both kinds (values file and --set), a numeric issuer name, and the failure cases with their messages (other, empty and numeric kinds, empty issuer, both annotations). Written before the template change; they failed on dev.
  • helm lint helm --strict: passed.
  • pre-commit run --all-files (ruff, mypy, gitleaks, actionlint, file checks), shellcheck tests/chart.sh, mkdocs build --strict: passed.
  • Not run locally: the kind-based upgrade test, deployment check and smoke tests (need Docker/kind). CI: all jobs passed (run 45100687004), incl. Chart, Upgrade test, Deployment check, Smoke test, scans; "CI passed" green.

Reviews

Full lane (Helm chart). Round 1: adversarial (no high/medium; two lows fixed: issuer quoting, failure messages checked) and quality (two mediums fixed: header comment, missing Issuer-kind and message tests; low fixed: docs clause on empty issuer). Round 2: both no high/medium; one low (long digit-only issuer names from a values file become floats) handled by a note in helm/values.yaml to quote such names.

Declined review findings

  • Trim the OpenShift example and the second-host paragraph from the docs: kept, as this is the use case behind the issue and mirrors FOCA's docs.
  • Sourcery: an unquoted numeric 0 as issuer name fails required: declined; helm/values.yaml says to quote digit-only names, and a quoted "0" renders (thread answered and resolved).

Open questions

None.

🤖 Generated with Claude Code

https://claude.ai/code/session_011FSoqN5w1v5t1QRTKU7ad5

uniqueg and others added 3 commits November 23, 2026 03:05
Add pubgrade.ingress.https.issuerKind (ClusterIssuer by default, also
if null, or Issuer), as in FOCA's library chart. Configured Ingress
annotations now take precedence over the chart's issuer annotation and
null removes it, instead of rendering a duplicate key. Rendering fails
on other kinds, without an issuer, and if the annotations name both
kinds. Chart tests and deployment docs cover both kinds.

Closes #136

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_011FSoqN5w1v5t1QRTKU7ad5
Render the issuer's name as a string, so that names YAML reads as
numbers stay valid annotations, and check the error message of each
failing render. Cover overrides and removal for namespaced Issuers.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_011FSoqN5w1v5t1QRTKU7ad5
@uniqueg uniqueg self-assigned this Nov 23, 2026
@sourcery-ai

sourcery-ai Bot commented Nov 23, 2026

Copy link
Copy Markdown

Reviewer's Guide

Implementation

Build the Ingress issuer annotation from the selected issuer kind, apply user annotations as overrides or removals, and reject invalid kinds or conflicting issuer annotations.

  • helm/templates/pubgrade/ingress.yaml L1-36 (+3 small edits)

Configuration

Expose issuerKind and document how Ingress annotations and issuer selection are configured.

  • helm/values.yaml L87-98

Documentation

Explain certificate and Ingress behavior, including namespaced Issuers and configuring a second hostname.

  • docs/deployment.md L28-29, L34-100

Tests

Verify issuer-kind defaults and validation, HTTPS behavior, annotation overrides and removals, numeric names, and failure messages.

  • tests/chart.sh L63-138

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@read-the-docs-community

Copy link
Copy Markdown

Documentation build overview

📚 Pubgrade | 🛠️ Build #36089117 | 📁 Comparing 091f871 against latest (37a13af)

  🔍 Preview build  

1 file changed
± deployment/index.html

@codecov

codecov Bot commented Nov 23, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (37a13af) to head (091f871).

Additional details and impacted files
@@            Coverage Diff            @@
##               dev      #138   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           19        19           
  Lines         1772      1772           
=========================================
  Hits          1772      1772           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@uniqueg
uniqueg marked this pull request as ready for review November 23, 2026 02:36
@sourcery-ai

sourcery-ai Bot commented Nov 23, 2026

Copy link
Copy Markdown

Linked issues

Checked at commit 091f871

#136 feat(chart): support namespaced cert-manager Issuers · 3 of 4 met

# Requirement Status Notes
1 Add issuerKind with ClusterIssuer as the default, including when unset or null, or Issuer; let configured annotations override or remove the chart's issuer annotation. ✅ Met The Ingress template selects the annotation by issuerKind, defaults to ClusterIssuer, and applies configured annotations afterward; null removes an annotation.
2 Optionally add extraHosts, or document a second Ingress for a second host name. ✅ Met The optional extraHosts value was not added; the deployment docs describe creating a second Ingress for another host.
3 Add chart render tests for both issuer kinds; keep the default rendering as today. ✅ Met The chart tests cover ClusterIssuer, Issuer, and null issuerKind; the default ClusterIssuer annotation remains.
4 Document the chart settings and deployment configuration, and add a changelog entry. 🟡 Partly met The values and deployment docs cover the issuer settings and second-host approach, but this change adds no changelog entry; the PR description defers release notes to a release-prep PR.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hey - I've found 1 issue

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="helm/templates/pubgrade/ingress.yaml" line_range="26" />
<code_context>
+{{- $issuerKind = $https.issuerKind }}
+{{- if not (has $issuerKind (list "ClusterIssuer" "Issuer")) }}
+{{- fail (printf "pubgrade.ingress.https.issuerKind must be ClusterIssuer or Issuer, not %q" (toString $issuerKind)) }}
+{{- end }}
+{{- end }}
+{{- $annotations := dict }}
</code_context>
<issue_to_address>
**Numeric issuer rejected**

When the HTTPS issuer is supplied as numeric zero, `required` checks `$https.issuer` before `toString` and treats `0` as empty, so Helm aborts rendering instead of producing an Ingress with issuer name `"0"`.

Validate the issuer without treating numeric zero as absent, then convert it to a string.
</issue_to_address>

Sourcery assessment

Needs a human reviewer. 1 finding to address first, and with HTTPS enabled, issuerKind determines whether cert-manager uses a namespaced Issuer or a ClusterIssuer to issue and renew the certificate served by the Ingress. If that selection is wrong, reverting may stop future issuance but will not undo a certificate already issued or stored; it would need to be replaced or revoked.

Blocking findings: helm/templates/pubgrade/ingress.yaml:26


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

Comment thread helm/templates/pubgrade/ingress.yaml Resolved
@uniqueg
uniqueg merged commit 3e4013a into dev Nov 23, 2026
97 checks passed
@uniqueg
uniqueg deleted the feat/136-namespaced-issuer branch November 23, 2026 06:34
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.

feat(chart): support namespaced cert-manager Issuers

1 participant