Skip to content

fix(sentinel): apply certificate config changes by certificate type - #297

Closed
thiagoesteves wants to merge 2 commits into
mainfrom
thiagoesteves/fix-certificate-config-apply
Closed

fix(sentinel): apply certificate config changes by certificate type#297
thiagoesteves wants to merge 2 commits into
mainfrom
thiagoesteves/fix-certificate-config-apply

Conversation

@thiagoesteves

@thiagoesteves thiagoesteves commented Aug 13, 2026

Copy link
Copy Markdown
Owner

Summary

  • The config watcher pattern-matched on details: %{domains: ...} but diff_certificates builds the details map keyed by certificate type (:acme, :importer, ...), never :domains. The pattern never matched, so certificate managers were never stopped or started when certificates changed in the YAML.
  • Iterate over the actual certificate type keys in the details map instead of hardcoding :domains. Stop the manager once for any removed or modified type, and start it for each added or modified type.
  • Fix the test fixture that used a non-existent :domains type, masking the bug, and add apply tests that verify the stop/start calls.

Test plan

  • mix test apps/sentinel/test/config/ --warnings-as-errors (53 tests)
  • mix test apps/deployex_web/test/deployex_web/live/applications/watcher_test.exs --warnings-as-errors (7 tests)
  • mix format --check-formatted
  • mix credo --strict apps/sentinel/lib/sentinel/config/watcher.ex

Risk assessment

  • Impact: Certificate changes in deployex.yaml now correctly stop and restart the certificate manager, as the UI has been showing they would.
  • Blast radius: Sentinel config watcher only; certificate manager start/stop calls are the only behavior change.
  • Regression risk: Low - the old code never matched, so no working behavior is replaced; the new code follows the same stop-then-start sequence used for added/removed applications.
  • Rollback: Plain commit revert.

Generated with Devin powered by GLM-5.2 High

The config watcher pattern-matched on `details: %{domains: ...}` but
`diff_certificates` builds the details map keyed by certificate type
(:acme, :importer, ...), never :domains. The pattern never matched, so
certificate managers were never stopped or started when certificates
changed in the YAML.

Iterate over the actual certificate type keys in the details map
instead of hardcoding :domains. Stop the manager once for any removed
or modified type, and start it for each added or modified type.

Also fix the test fixture that used a non-existent `:domains` type,
masking the bug, and add apply tests that verify the stop/start calls.

Risk assessment:
- Impact: Certificate changes in deployex.yaml now correctly stop and
  restart the certificate manager, as the UI has been showing they would
- Blast radius: sentinel config watcher only; certificate manager
  start/stop calls are the only behavior change
- Regression risk: low - the old code never matched, so no working
  behavior is replaced; the new code follows the same stop-then-start
  sequence used for added/removed applications
- Rollback: plain commit revert
thiagoesteves added a commit that referenced this pull request Aug 13, 2026
The PR guidelines referenced Claude Code by name, which confused agents
running on other models. Generalize the attribution line to credit
Devin with the model name as a parameter (e.g. GLM-5.2 High, Claude
Sonnet 4.5), so any AI agent can fill it in correctly regardless of
which model it runs on.

Impact: agents reading AGENTS.md now know to credit Devin and their own
model rather than copying a Claude Code line that does not apply.

Blast radius: only AGENTS.md. No code or config changes.

Regression risk: none. Documentation-only change.

Rollback: revert this commit.
thiagoesteves added a commit that referenced this pull request Aug 13, 2026
The PR guidelines referenced Claude Code by name, which confused agents
running on other models. Generalize the attribution line to cover both
Devin and Claude Code directly, each with the model name as a parameter
(e.g. GLM-5.2 High, Claude Sonnet 4.5), so any AI agent can fill it in
correctly regardless of which tool or model it runs on.

Impact: agents reading AGENTS.md now know to credit the tool they are
running through (Devin or Claude Code) and their own model, rather than
copying a single hardcoded line that may not apply.

Blast radius: only AGENTS.md. No code or config changes.

Regression risk: none. Documentation-only change.

Rollback: revert this commit.
thiagoesteves added a commit that referenced this pull request Aug 14, 2026
The PR guidelines referenced Claude Code by name, which confused agents
running on other models. Generalize the attribution line to cover both
Devin and Claude Code directly, each with the model name as a parameter
(e.g. GLM-5.2 High, Claude Sonnet 4.5), so any AI agent can fill it in
correctly regardless of which tool or model it runs on.

Impact: agents reading AGENTS.md now know to credit the tool they are
running through (Devin or Claude Code) and their own model, rather than
copying a single hardcoded line that may not apply.

Blast radius: only AGENTS.md. No code or config changes.

Regression risk: none. Documentation-only change.

Rollback: revert this commit.
@thiagoesteves

Copy link
Copy Markdown
Owner Author

Closing this PR - after review with the maintainer, the certificate type in the YAML schema is "domains" (atom :domains), not :acme. The original watcher code correctly matched on :domains. My change was based on a wrong assumption about the certificate type and broke the correct test fixture. There is no bug in the certificate config apply path.

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.

1 participant