Skip to content

chore: sync development to main#3047

Merged
maintainerr-automation[bot] merged 7 commits into
mainfrom
development
Jun 5, 2026
Merged

chore: sync development to main#3047
maintainerr-automation[bot] merged 7 commits into
mainfrom
development

Conversation

@maintainerr-automation

@maintainerr-automation maintainerr-automation Bot commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Summary

Promotes development to main for release. Squash-merge when approved; release automation continues on approval.

Changes

enoch85 and others added 6 commits June 5, 2026 12:12
…L import errors (#3045)

- Default keepLogsForMonths to 6 when omitted instead of binding NaN (create and update)
- Return a structured {code:0} error instead of a silent empty 201 when a save fails
- Guard updateRules against a missing collection block (no throw, no spurious media wipe)
- Clearer message for invalid YAML; log real server-side faults instead of mislabeling them as syntax errors

Refs #3044
* feat(server): add /api/health endpoints with DB liveness check

The application has no /health endpoint today, which makes it
awkward to wire up Kubernetes livenessProbe / readinessProbe or
Docker HEALTHCHECK directives. /api/app/status is not a substitute
because it also exercises the GitHub releases API.

Add three endpoints under /api/health:

  - GET /api/health       — combined: 200 with database=ok, or 503
                            with database=unreachable.
  - GET /api/health/live  — liveness: 200 as long as the process is
                            up, no DB call. Use for Kubernetes
                            livenessProbe (no restarts on transient
                            DB blips).
  - GET /api/health/ready — readiness: SELECT 1 against the
                            configured TypeORM datasource; returns
                            503 if the query fails. Use for
                            Kubernetes readinessProbe (stop
                            sending traffic until the DB is back).

The DB check uses the same TypeORM datasource the rest of the app
uses, so a misconfigured connection string or a full disk surfaces
as a clear 503 rather than a silent 200.

* refactor(server): move health DB check to a service; add tests and Docker HEALTHCHECK

- Extract the SELECT 1 ping into HealthService so the controller only shapes the
  response, matching the controllers-delegate-to-services pattern.
- Log the caught DB error via MaintainerrLogger (warn + debug) instead of
  swallowing it.
- Use process.uptime(); drop the instantiation-time uptime helper.
- Move the response shapes to @maintainerr/contracts (LivenessResponse,
  HealthResponse); live() returns the shared envelope; root route uses @get().
- Add HealthService and HealthController specs.
- Wire the Dockerfile HEALTHCHECK to /api/health/ready via a BASE_PATH-aware
  probe script.

---------

Co-authored-by: enoch85 <mailto@danielhansson.nu>
#3046)

When the collection block is omitted from PUT /api/rules, fall back to the
saved values for manualCollection, manualCollectionName, visibleOnHome and
visibleOnRecommended instead of forwarding undefined. This stops
updateCollection from silently unlinking a manual collection (mediaServerId
cleared) or switching off Plex Home/Recommended visibility.

Follow-up to #3045.
Operators can override the persisted log level for a single container by
setting LOG_LEVEL=debug|verbose|info|warn|error|fatal in the environment.
The persisted setting (the value the UI shows) is left untouched, so the
override is never baked into the database. An unrecognised value logs a
single warning at startup and falls back to the persisted level; with the
env var unset, behaviour is unchanged.

The winston factory now also tolerates a missing log_settings row during
first boot, falling back to the shared DEFAULT_LOG_* constants for level,
max size, and max files instead of dereferencing a null row.

Co-authored-by: enoch85 <mailto@danielhansson.nu>
User-configured notification URLs were passed straight to axios.post, so a
misconfigured value pointing at file://, gopher://, or any other non-http(s)
scheme would be turned into an outbound request. These URLs have no validation
at the settings layer, so this is the only guard.

Add a shared validateWebhookUrl helper and apply it in every agent that posts
to an operator-supplied URL: the webhookUrl agents (webhook, slack, lunasea,
discord) and ntfy's server url. Unparseable URLs and non-http(s) schemes are
rejected before sending and the normalised URL is posted; the agent returns a
clear Failure result.

Also replace ntfy's regex slash-trimming with the codebase's char-based idiom,
per the no-regex convention.

Co-authored-by: enoch85 <mailto@danielhansson.nu>
@maintainerr-automation maintainerr-automation Bot requested a review from enoch85 as a code owner June 5, 2026 11:44
@maintainerr-automation maintainerr-automation Bot added the release:docker-build Build release candidate Docker image label Jun 5, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approved by release automation (CODEOWNER approval was verified by Release 2).

@maintainerr-automation maintainerr-automation Bot merged commit c73a3ea into main Jun 5, 2026
25 checks passed
@maintainerr-automation

Copy link
Copy Markdown
Contributor Author

📚 Docs drift report

Comparing origin/mainHEAD against Maintainerr_docs. Informational only — maintainers decide what needs doc updates before release.

Rule glossary parity

  • Code rule keys (rules.constants.ts): 163
  • Documented keys (docs/Glossary.md): 163

Glossary is in sync with the code.

New migrations on this branch

No new migrations.

Rule constants

No changes to rules.constants.ts.

Public contracts (@maintainerr/contracts)

  • Added (1):
    • packages/contracts/src/app/healthResponse.dto.ts
  • Modified (1):
    • packages/contracts/src/app/index.ts

Public DTO changes may affect docs/API.md and the OpenAPI spec in static/openapi-spec/maintainerr_api_specs.yaml.

New HTTP controllers

No new controllers.

feat: commits on this branch

Behavioral fixes worth reviewing

  • 195a912 fix(notifications): validate webhook URL scheme before posting (fix(notifications): validate webhook URL scheme before posting #3031)
    • touched: apps/server/src/modules/notifications/agents/discord.spec.ts, apps/server/src/modules/notifications/agents/discord.ts, apps/server/src/modules/notifications/agents/lunasea.spec.ts, apps/server/src/modules/notifications/agents/lunasea.ts, apps/server/src/modules/notifications/agents/ntfy.spec.ts, apps/server/src/modules/notifications/agents/ntfy.ts, apps/server/src/modules/notifications/agents/slack.spec.ts, apps/server/src/modules/notifications/agents/slack.ts, apps/server/src/modules/notifications/agents/webhook.spec.ts, apps/server/src/modules/notifications/agents/webhook.ts, apps/server/src/modules/notifications/agents/webhookUrl.spec.ts, apps/server/src/modules/notifications/agents/webhookUrl.ts
  • 0436342 fix(rules): preserve collection link and visibility on partial updates (fix(rules): preserve collection link and visibility on partial updates #3046)
    • touched: apps/server/src/modules/rules/rules.service.ts, apps/server/src/modules/rules/rules.service.updateRules.spec.ts
  • 1db69f3 fix(rules): save rule groups from incomplete payloads and clarify YAML import errors (fix(rules): save rule groups from incomplete payloads and clarify YAML import errors #3045)
    • touched: apps/server/src/modules/rules/helpers/yaml.service.spec.ts, apps/server/src/modules/rules/helpers/yaml.service.ts, apps/server/src/modules/rules/rules.controller.ts, apps/server/src/modules/rules/rules.service.setRules.spec.ts, apps/server/src/modules/rules/rules.service.ts, apps/server/src/modules/rules/rules.service.updateRules.spec.ts

fix: commits that touched a doc-worthy surface — the UI, any server module except internal-only events/logging, any controller, or the README. Worth scanning to decide whether observable behavior changed enough to warrant a docs note.

Documentation-labeled issues & PRs

No open issues or in-range merged PRs carry the documentation label.

@github-actions

github-actions Bot commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

🚀 Release 2.5 - Execute Push PR To Main completed after approval.

  • PR squash-merged into main
  • Sync back: success
  • Build Main: success

@maintainerr-automation

Copy link
Copy Markdown
Contributor Author

🎉 This PR is included in version 3.14.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release:docker-build Build release candidate Docker image released

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants