Skip to content

RHCLOUD-47148: minor bug fix when providing custom schema for full kessel compose#1339

Open
tonytheleg wants to merge 2 commits intoproject-kessel:mainfrom
tonytheleg:compose-bug-fix
Open

RHCLOUD-47148: minor bug fix when providing custom schema for full kessel compose#1339
tonytheleg wants to merge 2 commits intoproject-kessel:mainfrom
tonytheleg:compose-bug-fix

Conversation

@tonytheleg
Copy link
Copy Markdown
Contributor

@tonytheleg tonytheleg commented May 5, 2026

PR Template:

Describe your changes

Found a bug in the full kessel setup when trying to provide a custom schema file during testing for RHCLOUD-47148
The .env file explicitly sets SCHEMA_ZED_FILE="". The script then sources this file and overwrites the environment variable passed in, clobbering it

This fixes the issue by only letting the .env file set defaults, not override explicit environment variables.

Ticket reference (if applicable)

For RHCLOUD-47148

Summary by CodeRabbit

  • Bug Fixes
    • The startup script now treats .env values as defaults and preserves any environment variables already set before launch. This prevents overwriting user-provided configuration when starting the application, so custom settings supplied in the shell are respected and retained during initialization, improving reliability of custom deployments.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 5, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 8d330eb6-aaa7-4e7e-aea9-ece4c16b7387

📥 Commits

Reviewing files that changed from the base of the PR and between e1e185d and 8d4f34c.

📒 Files selected for processing (1)
  • scripts/start-full-kessel.sh

📝 Walkthrough

Walkthrough

The script now preserves caller-set SCHEMA_ZED_FILE and RBAC_CONFIG_FILE when loading ${COMPOSE_DIR}/.env: it records existing values, sources the .env with exported defaults, then restores the saved values if they were non-empty, and cleans up temporary variables.

Changes

Environment Variable Preservation

Layer / File(s) Summary
Variable Save
scripts/start-full-kessel.sh
Record whether SCHEMA_ZED_FILE and RBAC_CONFIG_FILE were set and save their values to temporary variables.
Sourcing Defaults
scripts/start-full-kessel.sh
Source ${COMPOSE_DIR}/.env using set -a so file entries become exported defaults.
Restore Caller Values
scripts/start-full-kessel.sh
If saved values were non-empty, restore them to SCHEMA_ZED_FILE and RBAC_CONFIG_FILE.
Cleanup
scripts/start-full-kessel.sh
Unset the temporary save variables used to hold prior values.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description covers the main sections but is missing several required checklist items from the template, including acceptance criteria confirmation and automated tests verification. Complete the PR template checklist by confirming acceptance criteria fulfillment, 4-eye-principle application, automated tests status, coding practices compliance, and ticket state management.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: a bug fix for custom schema file handling in the full kessel compose setup.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@scripts/start-full-kessel.sh`:
- Around line 11-17: The current restore logic only reinserts non-empty saved
values because the script saves original values with "${SCHEMA_ZED_FILE:-}" and
then tests with [ -n ... ]; instead, record whether the original variable was
set and restore even empty values: when saving, add markers like
_saved_schema_zed_file_set="${SCHEMA_ZED_FILE+x}" and
_saved_rbac_config_file_set="${RBAC_CONFIG_FILE+x}" alongside
_saved_schema_zed_file="${SCHEMA_ZED_FILE:-}" and
_saved_rbac_config_file="${RBAC_CONFIG_FILE:-}", then restore using those
markers (if [ -n "${_saved_schema_zed_file_set}" ] &&
SCHEMA_ZED_FILE="${_saved_schema_zed_file}" and similarly for RBAC_CONFIG_FILE)
so explicit empty values are preserved.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: ec48f43a-800c-49f1-b23b-3eefdfad0f65

📥 Commits

Reviewing files that changed from the base of the PR and between 25c96f0 and e1e185d.

📒 Files selected for processing (1)
  • scripts/start-full-kessel.sh

Comment thread scripts/start-full-kessel.sh Outdated
@codecov
Copy link
Copy Markdown

codecov Bot commented May 5, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

Flag Coverage Δ
main 49.64% <ø> (+0.01%) ⬆️
v1beta2 64.89% <ø> (-0.04%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

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