Skip to content

Validate Trino, auth and query configuration - #431

Queued
Bohreromir wants to merge 4 commits into
mainfrom
fix-402-config-validation
Queued

Bohreromir wants to merge 4 commits into
mainfrom
fix-402-config-validation

Conversation

@Bohreromir

@Bohreromir Bohreromir commented Oct 29, 2026 •

Copy link
Copy Markdown
Member

Description

closes #402

Docs

Release note

Checklist

Author

  • AI review done, findings addressed
  • Tests added or updated
  • Changelog updated (if the repo keeps one)

Reviewer

  • Useful comments and logging
  • Docs added or updated per the style guide

Acceptance

  • Check for release notes and docs

Validates an http or https URL from an environment variable, treating a blank value as unset. Used by the Trino and OIDC settings in the following commits (#402).
STACKABLE_COCKPIT_TRINO_AUTH_TYPE, _TRINO_TLS_INSECURE, _TRINO_USER_IMPERSONATION, _QUERY_TTL and the Trino URLs fell back to defaults on invalid input, so a typo could silently disable TLS verification or impersonation. They are now parsed once at startup, and invalid values stop the server with an error naming each variable.
OIDC was silently disabled when only some of STACKABLE_COCKPIT_OIDC_DISCOVERY_URL, _CLIENT_ID and _CLIENT_SECRET were set. Setting only some of them now stops the server at startup, and the discovery URL must be an http or https URL.
@github-actions

github-actions Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 67.31% 9115 / 13540
🔵 Statements 66.29% 12279 / 18523
🔵 Functions 68.13% 2944 / 4321
🔵 Branches 57.31% 5145 / 8976
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
src/hooks.server.ts 0% 0% 0% 0% 23-147
src/lib/env-schema.ts 100% 100% 100% 100%
src/lib/server/auth.ts 65.78% 33.33% 50% 73.33% 13, 14, 15, 18, 68, 124-149
src/lib/server/trino/client.ts 63.01% 59.67% 53.33% 68.75% 80, 81, 93-94, 114-115, 132-142, 156, 166, 191-197, 229-230, 236, 270-279
src/lib/server/trino/config.ts 100% 100% 100% 100%
src/lib/server/trino/queries.ts 100% 94.33% 100% 100%
Generated in workflow #1222 for commit b7e69dc by the Vitest Coverage Report Action

@Bohreromir Bohreromir self-assigned this Oct 30, 2026
@Bohreromir Bohreromir moved this to Development: Waiting for Review in Stackable Engineering Oct 30, 2026
@Bohreromir
Bohreromir marked this pull request as ready for review October 30, 2026 08:53

@labrenbe labrenbe left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

lgtm

@labrenbe labrenbe moved this from Development: Waiting for Review to Development: In Review in Stackable Engineering Nov 2, 2026
@Bohreromir
Bohreromir added this pull request to the merge queue Nov 2, 2026
Any commits made after this event will not be merged.
@Bohreromir Bohreromir moved this from Development: In Review to Development: Done in Stackable Engineering Nov 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Development: Done

Development

Successfully merging this pull request may close these issues.

Add zod validation for Trino, auth and query settings

2 participants