Skip to content

HYPERFLEET-839 - fix: update additional docs/scripts to explicitly se…#93

Merged
openshift-merge-bot[bot] merged 1 commit into
openshift-hyperfleet:mainfrom
ma-hill:HYPERFLEET-839
May 12, 2026
Merged

HYPERFLEET-839 - fix: update additional docs/scripts to explicitly se…#93
openshift-merge-bot[bot] merged 1 commit into
openshift-hyperfleet:mainfrom
ma-hill:HYPERFLEET-839

Conversation

@ma-hill
Copy link
Copy Markdown
Contributor

@ma-hill ma-hill commented May 11, 2026

Summary

Follow up PR to: #86

Update runbook.md and gcp.sh to clearly indicate that unique namespaces must be provided when using the deploy scripts to avoid Pub Sub collisions.

Jira Issue

HYPERFLEET-839

Test Plan

  • Unit tests added/updated
  • Deploy scripts passed
  • E2E tests passed (if cross-component or major changes)

@openshift-ci openshift-ci Bot requested review from kuudori and tirthct May 11, 2026 21:43
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 11, 2026

📝 Walkthrough

Summary by CodeRabbit

  • Documentation
    • Enhanced deployment guidance with clearer namespace configuration requirements and DNS compliance documentation.
    • Improved runbook with updated local setup instructions, environment variable templates, and parameterized troubleshooting examples for increased clarity and flexibility.

Walkthrough

This pull request updates documentation and comments across two files to clarify Pub/Sub namespace configuration requirements. In deploy-scripts/lib/gcp.sh, comments for discover_pubsub_topics and discover_pubsub_subscriptions functions were expanded to document DNS-1123 compliance requirements and provide explicit examples of topic and subscription naming patterns. In docs/runbook.md, guidance was added for setting a unique NAMESPACE environment variable, and hardcoded namespace references in example commands were replaced with ${NAMESPACE} placeholders for consistency. No executable logic or function signatures were modified.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title is partially related to the changeset—it refers to updating docs/scripts for namespace documentation, which matches the PR's core intent, but is truncated and incomplete, making it vague. Complete the title to fully describe the change, e.g., 'Update runbook.md and gcp.sh to document unique namespace requirements for Pub/Sub safety.'
✅ Passed checks (3 passed)
Check name Status Explanation
Description check ✅ Passed The description clearly relates to the changeset—it explains the purpose of updating runbook.md and gcp.sh to document unique namespace requirements to avoid Pub/Sub collisions.
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

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

Copy link
Copy Markdown

@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 `@docs/runbook.md`:
- Around line 158-162: Update the NAMESPACE example to produce DNS-1123
compliant names by normalizing the USER-derived portion: convert to lowercase,
replace any non-alphanumeric characters with hyphens, collapse repeated hyphens,
trim leading/trailing non-alphanumeric/hyphen characters and optionally limit
the length; update the .env.example export of NAMESPACE to describe this
sanitization and provide an example command that uses USER-derived input and
these normalization steps so generated namespaces are valid for GCP Pub/Sub;
reference the NAMESPACE variable and the .env.example export line in the change.
🪄 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: Central YAML (base), Organization UI (inherited)

Review profile: ASSERTIVE

Plan: Enterprise

Run ID: dde21e62-7243-44b7-a169-9295903eed82

📥 Commits

Reviewing files that changed from the base of the PR and between 3f47690 and 7ac161e.

📒 Files selected for processing (2)
  • deploy-scripts/lib/gcp.sh
  • docs/runbook.md

Comment thread docs/runbook.md
Comment on lines +158 to +162
# NAMESPACE must be unique to prevent GCP Pub/Sub topic/subscription collisions.
# Set in the .env.example file as:
export NAMESPACE="${NAMESPACE:-hyperfleet-e2e-$(echo ${USER:-default} | tr '[:upper:]' '[:lower:]')}"
# Or can manually set it with as the namespace is DNS-1123 compliant
export NAMESPACE=<unique_namespace>
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

DNS-1123 guidance is incomplete; current example can still generate invalid namespaces.

$(echo ${USER:-default} | tr '[:upper:]' '[:lower:]') only lowercases; it does not remove/normalize invalid DNS-1123 chars (e.g., _, .). That can still produce invalid namespace/topic/subscription names and break deploy flows.

Proposed doc fix
 # NAMESPACE must be unique to prevent GCP Pub/Sub topic/subscription collisions.
 # Set in the .env.example file as:
-export NAMESPACE="${NAMESPACE:-hyperfleet-e2e-$(echo ${USER:-default} | tr '[:upper:]' '[:lower:]')}"
-# Or can manually set it with as the namespace is DNS-1123 compliant
-export NAMESPACE=<unique_namespace>
+export NAMESPACE="${NAMESPACE:-hyperfleet-e2e-$(echo "${USER:-default}" | tr '[:upper:]' '[:lower:]' | sed -E 's/[^a-z0-9-]+/-/g; s/^-+//; s/-+$//')}"
+# Or set it manually to a unique DNS-1123 value (example):
+export NAMESPACE="hyperfleet-e2e-jdoe"

As per coding guidelines, “Focus on major issues impacting performance, readability, maintainability and security… Validate changes against HyperFleet architecture standards,” and the referenced runbook content requires NAMESPACE to be unique and DNS-1123 compliant.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
# NAMESPACE must be unique to prevent GCP Pub/Sub topic/subscription collisions.
# Set in the .env.example file as:
export NAMESPACE="${NAMESPACE:-hyperfleet-e2e-$(echo ${USER:-default} | tr '[:upper:]' '[:lower:]')}"
# Or can manually set it with as the namespace is DNS-1123 compliant
export NAMESPACE=<unique_namespace>
# NAMESPACE must be unique to prevent GCP Pub/Sub topic/subscription collisions.
# Set in the .env.example file as:
export NAMESPACE="${NAMESPACE:-hyperfleet-e2e-$(echo "${USER:-default}" | tr '[:upper:]' '[:lower:]' | sed -E 's/[^a-z0-9-]+/-/g; s/^-+//; s/-+$//')}"
# Or set it manually to a unique DNS-1123 value (example):
export NAMESPACE="hyperfleet-e2e-jdoe"
🤖 Prompt for 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.

In `@docs/runbook.md` around lines 158 - 162, Update the NAMESPACE example to
produce DNS-1123 compliant names by normalizing the USER-derived portion:
convert to lowercase, replace any non-alphanumeric characters with hyphens,
collapse repeated hyphens, trim leading/trailing non-alphanumeric/hyphen
characters and optionally limit the length; update the .env.example export of
NAMESPACE to describe this sanitization and provide an example command that uses
USER-derived input and these normalization steps so generated namespaces are
valid for GCP Pub/Sub; reference the NAMESPACE variable and the .env.example
export line in the change.

@rh-amarin
Copy link
Copy Markdown
Contributor

/lgtm

@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented May 12, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: rh-amarin

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-bot openshift-merge-bot Bot merged commit d3a9552 into openshift-hyperfleet:main May 12, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants