Skip to content

Naming conventions#47

Open
rh-amarin wants to merge 1 commit into
openshift-hyperfleet:mainfrom
rh-amarin:naming-conventions
Open

Naming conventions#47
rh-amarin wants to merge 1 commit into
openshift-hyperfleet:mainfrom
rh-amarin:naming-conventions

Conversation

@rh-amarin

@rh-amarin rh-amarin commented Dec 9, 2025

Copy link
Copy Markdown
Collaborator

This PR documents how to name different concerns for the different Hyperfleet components.

  • Domain Concepts
  • Architecture Patterns
  • Infrastructure Components
  • Configuration & Secrets
  • Observability
  • API & HTTP Conventions
  • Database Schema
  • Kubernetes Resources
  • Messaging & Events
  • Repository Naming
  • Binary Naming
  • Makefile Conventions
  • Package & Module Naming

@coderabbitai

coderabbitai Bot commented Dec 9, 2025

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Central YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: 7988d731-07ac-41a1-a2cd-ef2a36965523

📥 Commits

Reviewing files that changed from the base of the PR and between ba5d7c9 and e3bb7e7.

📒 Files selected for processing (1)
  • hyperfleet/docs/naming-conventions.md
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • openshift-hyperfleet/architecture (manual)
  • openshift-hyperfleet/hyperfleet-api (manual)
  • openshift-hyperfleet/hyperfleet-sentinel (manual)
  • openshift-hyperfleet/hyperfleet-adapter (manual)
  • openshift-hyperfleet/hyperfleet-broker (manual)

📝 Walkthrough

Summary by CodeRabbit

Release Notes

  • Documentation
    • Added a comprehensive HyperFleet Naming Conventions Guide, defining standardized naming across domain concepts, architecture patterns, infrastructure, configuration, observability, API/HTTP conventions, database schemas, Kubernetes resources, messaging, repositories, binaries, and Go module/package organization, including examples and templates.

Walkthrough

This pull request adds hyperfleet/docs/naming-conventions.md, a comprehensive 872-line documentation file specifying standardized naming rules across domain concepts, architecture patterns, infrastructure components, configuration, observability instrumentation, API contracts, database schemas, Kubernetes resources, messaging systems, repository and binary organization, Makefile targets, and Go module/package structure. The guide includes SQL, YAML, JSON, and Go code examples. No code logic, behavioral changes, or public API declarations are modified.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

🚥 Pre-merge checks | ✅ 11
✅ Passed checks (11 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Naming conventions' directly and clearly summarizes the main change—adding comprehensive naming convention documentation for HyperFleet components.
Description check ✅ Passed The description is directly related to the changeset, listing the thirteen documentation areas covered in the naming conventions guide.
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.
Sec-02: Secrets In Log Output ✅ Passed Documentation-only file. No logging statements present. No actual secrets, tokens, or credentials found in log output or code—only naming convention documentation with placeholder examples (e.g., "...
No Hardcoded Secrets ✅ Passed The documentation file contains one URL with embedded credentials (amqp://guest:guest@localhost:5672/) in a clearly marked "Broker Configuration Example" code block. The guest:guest credentials are...
No Weak Cryptography ✅ Passed PR adds 158 documentation files (markdown, YAML, shell scripts) with no code implementing cryptographic primitives or unsafe secret comparisons. Comprehensive regex scan found no usage of banned cr...
No Injection Vectors ✅ Passed Documentation-only PR. No executable code added. Go code examples contain only type definitions and hardcoded constants; zero injection vectors detected across CWE-89, CWE-78, CWE-79, CWE-502.
No Privileged Containers ✅ Passed PR adds documentation only (naming-conventions.md); no Kubernetes manifests, Helm templates, Dockerfiles, or privileged container configs introduced.
No Pii Or Sensitive Data In Logs ✅ Passed Documentation file contains zero logging API calls (slog/logr/zap/fmt.Print). Table mentioning "request/response bodies" at V(3) trace level is descriptive guidance, not actual code exposing PII.

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

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

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


| Concept | Code (Type) | URL/Config | Plural | Database Table |
|---------|-------------|------------|--------|----------------|
| Cluster | `Cluster` | `cluster` | `clusters` | `clusters` |

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.

I really feel, we should be calling it a hosted cluster, following what we are actually provisioning. I really dont like cluster as it leaves too much room for interpretation

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I can see that for us (dev teams, BU) it may have more meaning using HostedCluster, but..
What would make the most sense to customers?
Does it bring value for them to name it HostedCluster instead of Cluster?

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.

We are just an API, how it gets wrapped and presented by the client is up to the users. I really worry that if we are not strongly locked to what a hosted cluster is we will fall into the same trap as OCM did


| Component Type | Suffix | Interface Name | Implementation | Package |
|----------------|--------|----------------|----------------|---------|
| Service layer | `Service` | `ClusterService` | `sqlClusterService` | `pkg/services/` |

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.

Same as above, really feel we need to be pushing on HostedClusterService

<summary>Complete Table Schema Example</summary>

```sql
CREATE TABLE clusters (

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.

Off topic, but I noticed in the API we are not using Gorm conventions for creating tables and instead using tx.Exec for raw sql, is there are reason for this?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

IIRC it was because raw SQL will make migrations easier/more controlled than letting gorm doing the updates

@rafabene

rafabene commented Dec 9, 2025

Copy link
Copy Markdown
Contributor

Nice work @rh-amarin . Although it's a draft, besides the comments from @ciaranRoche regarding using HostedCluster fo examples, this LTGM.

@coderabbitai coderabbitai 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.

Actionable comments posted: 7

🤖 Fix all issues with AI agents
In `@hyperfleet/docs/naming-conventions.md`:
- Around line 233-234: The broker topic examples use PascalCase (`Cluster`,
`NodePool`) but section 1.1 mandates lowercase in URLs/config; update
naming-conventions.md to remove ambiguity by either (a) changing the example
resource_type values to lowercase (`cluster`, `nodepool`) and updating
`BROKER_TOPIC`/`BROKER_SUBSCRIPTION_ID` examples accordingly, or (b) adding one
clear sentence stating that broker topic names are an explicit exception and
must use PascalCase, referencing the table examples (`Cluster`, `NodePool`,
`BROKER_TOPIC`, `BROKER_SUBSCRIPTION_ID`) so readers know which rule applies;
implement one of these fixes so examples and the "lowercase in config" rule are
consistent.
- Line 148: Update the typo in the sentence "We should standarize in:" by
replacing "standarize" with "standardize" so the line reads "We should
standardize in:"; locate the phrase in the naming-conventions.md content (the
exact text "We should standarize in:") and correct the spelling.
- Around line 354-367: The fenced code block showing the secrets directory tree
lacks a language tag (Markdown lint), so update the triple-backtick fence
surrounding the directory tree to include the text language specifier (i.e.,
change ``` to ```text) so the block is typed; locate the directory-tree fenced
block in naming-conventions.md (the secrets/ tree) and add the language
identifier `text` immediately after the opening backticks.
- Around line 743-747: The fenced code block showing the directory tree (the
block containing "cmd/ └── <service-name>/ └── main.go") lacks a language tag;
update the opening fence to use ```text so the tree is rendered as plain text
(replace the current ``` with ```text for that directory-tree code block).
- Line 739: Change the phrase "Full stack services keep the `hyperfleet-` prefix
(e.g., `hyperfleet-api`)" to use the hyphenated compound adjective "Full-stack
services keep the `hyperfleet-` prefix (e.g., `hyperfleet-api`)" so the compound
modifier is correctly hyphenated; locate the sentence containing "Full stack
services" in the naming-conventions.md content and replace it with "Full-stack
services".
- Around line 665-701: The docs state "use lower case for the CloudEvent type"
but the Field Standards and example show PascalCase
("com.redhat.hyperfleet.Cluster.reconcile"); change the type pattern to use
lowercase resource and action (e.g.,
`com.redhat.hyperfleet.<resource>.<action>`), update the Field Standards entry
for `type` and the CloudEvents JSON example accordingly (replace
`com.redhat.hyperfleet.Cluster.reconcile` with
`com.redhat.hyperfleet.cluster.reconcile`), and ensure the prose and examples
consistently reference the `type` field as lowercase.
- Around line 833-862: The fenced code block displaying the repository directory
tree in naming-conventions.md is missing a language tag; update the
triple-backtick fence that wraps the directory listing to use the text language
(i.e., change ``` to ```text) so the tree is rendered with the correct syntax
highlighting and formatting.
🧹 Nitpick comments (1)
hyperfleet/docs/naming-conventions.md (1)

144-144: Avoid bare URL; use a Markdown link.
Bare URL violates markdownlint and reduces readability.

♻️ Suggested edit
-TBC in https://issues.redhat.com/browse/HYPERFLEET-323
+TBC in [HYPERFLEET-323](https://issues.redhat.com/browse/HYPERFLEET-323)

Comment thread hyperfleet/docs/naming-conventions.md Outdated
Comment on lines +233 to +234
| Topic name | `<resource_type>` | `Cluster`, `NodePool` | `BROKER_TOPIC` |
| Queue/Subscription | `<service>-<resource>-sub` | `adapter-cluster-sub`, `sentinel-cluster-sub` | `BROKER_SUBSCRIPTION_ID` |

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.

⚠️ Potential issue | 🟡 Minor

Clarify topic casing vs “lowercase in config” rule.
Section 1.1 says lowercase in URLs/config, but broker topic examples use Cluster/NodePool (PascalCase). Please state explicitly whether broker topic names are an exception or align them to lowercase to avoid divergent implementations.

🤖 Prompt for AI Agents
In `@hyperfleet/docs/naming-conventions.md` around lines 233 - 234, The broker
topic examples use PascalCase (`Cluster`, `NodePool`) but section 1.1 mandates
lowercase in URLs/config; update naming-conventions.md to remove ambiguity by
either (a) changing the example resource_type values to lowercase (`cluster`,
`nodepool`) and updating `BROKER_TOPIC`/`BROKER_SUBSCRIPTION_ID` examples
accordingly, or (b) adding one clear sentence stating that broker topic names
are an explicit exception and must use PascalCase, referencing the table
examples (`Cluster`, `NodePool`, `BROKER_TOPIC`, `BROKER_SUBSCRIPTION_ID`) so
readers know which rule applies; implement one of these fixes so examples and
the "lowercase in config" rule are consistent.

Comment on lines +354 to +367
```
secrets/
├── db.host
├── db.name
├── db.user
├── db.password
├── db.port
├── hyperfleet-api-token
├── ocm.client-id
├── ocm.client-secret
├── tls.crt
├── tls.key
└── ca.crt
```

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.

⚠️ Potential issue | 🟡 Minor

Add a language to fenced code block.
Markdownlint flags untyped fences; use text for directory trees.

♻️ Suggested edit
-```
+```text
 secrets/
 ├── db.host
 ├── db.name
 ├── db.user
 ├── db.password
 ├── db.port
 ├── hyperfleet-api-token
 ├── ocm.client-id
 ├── ocm.client-secret
 ├── tls.crt
 ├── tls.key
 └── ca.crt
</details>

<!-- suggestion_start -->

<details>
<summary>📝 Committable suggestion</summary>

> ‼️ **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.

```suggestion

🧰 Tools
🪛 markdownlint-cli2 (0.18.1)

354-354: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

🤖 Prompt for AI Agents
In `@hyperfleet/docs/naming-conventions.md` around lines 354 - 367, The fenced
code block showing the secrets directory tree lacks a language tag (Markdown
lint), so update the triple-backtick fence surrounding the directory tree to
include the text language specifier (i.e., change ``` to ```text) so the block
is typed; locate the directory-tree fenced block in naming-conventions.md (the
secrets/ tree) and add the language identifier `text` immediately after the
opening backticks.

Comment thread hyperfleet/docs/naming-conventions.md

**Pattern**:
- Service-level tools use short names (e.g., `sentinel`)
- Full stack services keep the `hyperfleet-` prefix (e.g., `hyperfleet-api`)

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.

⚠️ Potential issue | 🟡 Minor

Hyphenate compound adjective: “full-stack”.
Use “full-stack services” when modifying a noun.

✏️ Suggested edit
-- Full stack services keep the `hyperfleet-` prefix (e.g., `hyperfleet-api`)
+- Full-stack services keep the `hyperfleet-` prefix (e.g., `hyperfleet-api`)
🧰 Tools
🪛 LanguageTool

[uncategorized] ~739-~739: If this is a compound adjective that modifies the following noun, use a hyphen.
Context: ...ls use short names (e.g., sentinel) - Full stack services keep the hyperfleet- prefix ...

(EN_COMPOUND_ADJECTIVE_INTERNAL)

🤖 Prompt for AI Agents
In `@hyperfleet/docs/naming-conventions.md` at line 739, Change the phrase "Full
stack services keep the `hyperfleet-` prefix (e.g., `hyperfleet-api`)" to use
the hyphenated compound adjective "Full-stack services keep the `hyperfleet-`
prefix (e.g., `hyperfleet-api`)" so the compound modifier is correctly
hyphenated; locate the sentence containing "Full stack services" in the
naming-conventions.md content and replace it with "Full-stack services".

Comment on lines +743 to +747
```
cmd/
└── <service-name>/ # e.g., sentinel, adapter, hyperfleet-api
└── main.go
```

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.

⚠️ Potential issue | 🟡 Minor

Add a language to fenced code block.
Use text for directory trees.

♻️ Suggested edit
-```
+```text
 cmd/
 └── <service-name>/    # e.g., sentinel, adapter, hyperfleet-api
     └── main.go
</details>

<!-- suggestion_start -->

<details>
<summary>📝 Committable suggestion</summary>

> ‼️ **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.

```suggestion

🧰 Tools
🪛 markdownlint-cli2 (0.18.1)

743-743: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

🤖 Prompt for AI Agents
In `@hyperfleet/docs/naming-conventions.md` around lines 743 - 747, The fenced
code block showing the directory tree (the block containing "cmd/ └──
<service-name>/ └── main.go") lacks a language tag; update the opening fence to
use ```text so the tree is rendered as plain text (replace the current ``` with
```text for that directory-tree code block).

Comment on lines +833 to +862
```
<repository>/
├── cmd/ # Application entry points
│ └── <service>/
│ └── main.go
├── pkg/ # Public packages (importable)
│ ├── api/ # API models
│ ├── logger/ # Logging
│ ├── errors/ # Error types
│ └── ...
├── internal/ # Private packages (not importable)
│ ├── <component>/
│ └── ...
├── test/ # Integration tests
│ └── integration/
├── configs/ # Configuration examples
├── charts/ # Helm charts
│ └── <service>/
├── deployments/ # Deployment artifacts (optional)
│ ├── helm/
│ └── dashboards/
├── docs/ # Documentation
├── scripts/ # Build/deployment scripts
├── .github/ # GitHub Actions workflows
├── Dockerfile
├── Makefile
├── go.mod
├── go.sum
└── README.md
```

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.

⚠️ Potential issue | 🟡 Minor

Add a language to fenced code block.
Use text for directory layout trees.

♻️ Suggested edit
-```
+```text
 <repository>/
 ├── cmd/                      # Application entry points
 │   └── <service>/
 │       └── main.go
 ├── pkg/                      # Public packages (importable)
 │   ├── api/                  # API models
 │   ├── logger/               # Logging
 │   ├── errors/               # Error types
 │   └── ...
 ├── internal/                 # Private packages (not importable)
 │   ├── <component>/
 │   └── ...
 ├── test/                     # Integration tests
 │   └── integration/
 ├── configs/                  # Configuration examples
 ├── charts/                   # Helm charts
 │   └── <service>/
 ├── deployments/              # Deployment artifacts (optional)
 │   ├── helm/
 │   └── dashboards/
 ├── docs/                     # Documentation
 ├── scripts/                  # Build/deployment scripts
 ├── .github/                  # GitHub Actions workflows
 ├── Dockerfile
 ├── Makefile
 ├── go.mod
 ├── go.sum
 └── README.md
</details>

<details>
<summary>🧰 Tools</summary>

<details>
<summary>🪛 markdownlint-cli2 (0.18.1)</summary>

833-833: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

</details>

</details>

<details>
<summary>🤖 Prompt for AI Agents</summary>

In @hyperfleet/docs/naming-conventions.md around lines 833 - 862, The fenced
code block displaying the repository directory tree in naming-conventions.md is
missing a language tag; update the triple-backtick fence that wraps the
directory listing to use the text language (i.e., change totext) so the
tree is rendered with the correct syntax highlighting and formatting.


</details>

<!-- fingerprinting:phantom:triton:eagle -->

<!-- This is an auto-generated comment by CodeRabbit -->

@rafabene

Copy link
Copy Markdown
Contributor

/retest

@rh-amarin rh-amarin force-pushed the naming-conventions branch from 396f78e to ba5d7c9 Compare June 22, 2026 14:40
@openshift-ci

openshift-ci Bot commented Jun 22, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign aredenba-rh for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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

@rh-amarin rh-amarin force-pushed the naming-conventions branch from ba5d7c9 to e3bb7e7 Compare June 22, 2026 15:00
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.

3 participants