Skip to content

Commit 5ccdd46

Browse files
Merge pull request #383 from geowa4/markdownlint
style: fix markdownlint violations in all markdown files
2 parents 3ddadb3 + 958b3c9 commit 5ccdd46

File tree

3 files changed

+94
-42
lines changed

3 files changed

+94
-42
lines changed

CLAUDE.md

Lines changed: 33 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
# CLAUDE.md
22

3-
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
3+
This file provides guidance to Claude Code (claude.ai/code) when working
4+
with code in this repository.
45

56
## Essential Commands
67

78
**Validation:**
9+
810
```bash
911
# Validate all notification descriptions end with a period
1012
make validate
@@ -17,6 +19,7 @@ make checkseverity
1719
```
1820

1921
**MCP Server (semantic search over notifications):**
22+
2023
```bash
2124
# Build MCP server container
2225
make build-container
@@ -26,15 +29,17 @@ make build-container
2629

2730
## Repository Architecture
2831

29-
This repository contains OpenShift Managed Services notification templates organized by service type:
32+
This repository contains OpenShift Managed Services notification templates
33+
organized by service type:
3034

3135
- **osd/** - OpenShift Dedicated notifications (150+ templates)
3236
- **osd/aws/** - AWS-specific OSD notifications
3337
- **rosa/** - Red Hat OpenShift Service on AWS notifications
3438
- **hcp/** - Hosted Control Plane notifications
3539
- **cluster/** - General cluster notifications
3640
- **ocm/** - OpenShift Cluster Manager notifications
37-
- **mcp/** - MCP server for semantic search over notification templates (separate subproject with own CLAUDE.md)
41+
- **mcp/** - MCP server for semantic search over notification templates
42+
(separate subproject with own CLAUDE.md)
3843
- **scripts/** - Validation scripts
3944

4045
### Notification Template Structure
@@ -54,43 +59,58 @@ Each notification is a JSON file with required fields:
5459
```
5560

5661
**Key constraints:**
62+
5763
- `description` field MUST end with a period (enforced by `make validate`)
58-
- `severity` must be one of: Debug, Info, Warning, Major, Critical (enforced by `scripts/checkseverity.sh`)
59-
- Templates may contain variable placeholders like `${TIME}`, `${CLUSTER_ID}`, `${NAMESPACE}`
64+
- `severity` must be one of: Debug, Info, Warning, Major, Critical
65+
(enforced by `scripts/checkseverity.sh`)
66+
- Templates may contain variable placeholders like `${TIME}`, `${CLUSTER_ID}`,
67+
`${NAMESPACE}`
6068

6169
### Posting Notifications
6270

63-
Notifications are posted via the [OpenShift Service Logs API](https://api.openshift.com/?urls.primaryName=Service%20logs#/default/post_api_service_logs_v1_cluster_logs) using `osdctl`:
71+
Notifications are posted via the
72+
[OpenShift Service Logs API](https://api.openshift.com/?urls.primaryName=Service%20logs#/default/post_api_service_logs_v1_cluster_logs)
73+
using `osdctl`:
6474

6575
```bash
6676
osdctl servicelog post <cluster-uuid> -t <template-url>
6777
```
6878

6979
Example:
80+
7081
```bash
7182
osdctl servicelog post aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee \
72-
-t https://raw.githubusercontent.com/openshift/managed-notifications/master/osd/aws/InstallFailed_TooManyBuckets.json
83+
-t https://raw.githubusercontent.com/openshift/managed-notifications/\
84+
master/osd/aws/InstallFailed_TooManyBuckets.json
7385
```
7486

7587
### Tag System
7688

77-
Some templates include a `_tag` field for categorization (e.g., `t_network` for network-related issues). Search GitHub with these tags to find related templates.
89+
Some templates include a `_tag` field for categorization (e.g., `t_network`
90+
for network-related issues). Search GitHub with these tags to find related
91+
templates.
7892

7993
## MCP Server Subproject
8094

81-
The `mcp/` directory contains a standalone MCP (Model Context Protocol) server that provides semantic search over these notification templates using vector embeddings. This subproject:
95+
The `mcp/` directory contains a standalone MCP (Model Context Protocol) server
96+
that provides semantic search over these notification templates using vector
97+
embeddings. This subproject:
8298

83-
- Has its own `mcp/CLAUDE.md` with detailed architecture and development instructions
99+
- Has its own `mcp/CLAUDE.md` with detailed architecture and development
100+
instructions
84101
- Uses Python + uv for dependency management
85102
- Builds ChromaDB vector database from notification templates
86103
- Exposes MCP tools for AI-powered notification search
87104

88-
When working on the MCP server, refer to `mcp/CLAUDE.md` for specific guidance.
105+
When working on the MCP server, refer to `mcp/CLAUDE.md` for specific
106+
guidance.
89107

90108
## Validation Scripts
91109

92-
**scripts/checklinks.sh** - Validates all HTTP/HTTPS URLs in templates return 200 (not 404)
110+
**scripts/checklinks.sh** - Validates all HTTP/HTTPS URLs in templates return
111+
200 (not 404)
93112

94-
**scripts/checkseverity.sh** - Ensures all templates have valid severity values
113+
**scripts/checkseverity.sh** - Ensures all templates have valid severity
114+
values
95115

96116
These run in CI and should pass before merging changes.

README.md

Lines changed: 25 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,38 +7,48 @@ Notification templates for OpenShift Managed services
77
Select the corresponding message and send it as a `POST` to
88
[api.openshift.com servicelog](https://api.openshift.com/?urls.primaryName=Service%20logs#/default/post_api_service_logs_v1_cluster_logs).
99

10-
> :warning: Please review each template before post to make sure all the parameters are passed with -p
11-
12-
> :books: If you are not sure which servicelog to send, you can use the generic one [here](./osd/unknown_failure.json)
10+
> :warning: Please review each template before post to make sure all the
11+
> parameters are passed with -p
12+
>
13+
> :books: If you are not sure which servicelog to send, you can use the
14+
> generic one in [osd/unknown_failure.json](./osd/unknown_failure.json)
1315
1416
### Examples
1517

1618
Using [osdctl](https://github.com/openshift/osdctl)
1719

18-
1. Authenticate at https://cloud.redhat.com/openshift/token
20+
1. Authenticate at <https://cloud.redhat.com/openshift/token>
1921
2. Post servicelog
2022

21-
```
22-
osdctl servicelog post <cluster UUID> -t <notificationTemplateUrl>
23-
```
23+
```bash
24+
osdctl servicelog post <cluster UUID> -t <notificationTemplateUrl>
25+
```
2426

25-
Example:
27+
Example:
2628

27-
```
28-
osdctl servicelog post aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee -t https://raw.githubusercontent.com/openshift/managed-notifications/master/osd/aws/InstallFailed_TooManyBuckets.json
29-
```
29+
```bash
30+
osdctl servicelog post aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee \
31+
-t https://raw.githubusercontent.com/openshift/managed-notifications/\
32+
master/osd/aws/InstallFailed_TooManyBuckets.json
33+
```
3034

31-
Note: `Osdctl` supports the usage of the unique cluster name, or the internal- and external ID as clusterID.
35+
Note: `Osdctl` supports the usage of the unique cluster name, or the
36+
internal- and external ID as clusterID.
3237

3338
### Tags
39+
3440
Some template files have a `_tag` field for easier searching.
3541

36-
For example, in GitHub, searching `t_network` will show you all the network related template files.
42+
For example, in GitHub, searching `t_network` will show you all the network
43+
related template files.
3744

3845
## MCP Search Server
3946

40-
This repository includes an MCP (Model Context Protocol) server that provides semantic search capabilities over the notification templates. See [mcp/README.md](mcp/README.md) for setup and usage instructions.
47+
This repository includes an MCP (Model Context Protocol) server that provides
48+
semantic search capabilities over the notification templates. See
49+
[mcp/README.md](mcp/README.md) for setup and usage instructions.
4150

4251
## Validating Managed Notifications
4352

44-
Run `make validate` to perform basic validations against the notifications configured in this repo.
53+
Run `make validate` to perform basic validations against the notifications
54+
configured in this repo.

mcp/CLAUDE.md

Lines changed: 36 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
# CLAUDE.md
22

3-
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
3+
This file provides guidance to Claude Code (claude.ai/code) when working with
4+
code in this repository.
45

56
## Essential Commands
67

78
**Development:**
9+
810
```bash
911
# Install dependencies
1012
uv sync
@@ -30,44 +32,64 @@ podman run -p 8000:8000 managed-notifications-search
3032

3133
## Architecture Overview
3234

33-
This is an MCP (Model Context Protocol) server that provides semantic search over OpenShift service notification logs using vector embeddings. The system has two main phases:
35+
This is an MCP (Model Context Protocol) server that provides semantic search
36+
over OpenShift service notification logs using vector embeddings. The system
37+
has two main phases:
3438

3539
### Build Phase (Offline)
40+
3641
- **Input**: JSON notification files from `managed-notifications/` directory
37-
- **Processing**: `scripts/build_embeddings.py` extracts searchable text, creates embeddings via sentence-transformers, stores in ChromaDB
42+
- **Processing**: `scripts/build_embeddings.py` extracts searchable text,
43+
creates embeddings via sentence-transformers, stores in ChromaDB
3844
- **Output**: Persistent vector database in `chroma_db/` directory
39-
- **Key Feature**: Extracts variable placeholders (e.g., `${TIME}`, `${POD}`) from notification templates
45+
- **Key Feature**: Extracts variable placeholders (e.g., `${TIME}`, `${POD}`)
46+
from notification templates
47+
48+
### Runtime Phase (Online)
4049

41-
### Runtime Phase (Online)
4250
- **Server**: `main.py` implements FastMCP server with HTTP transport
43-
- **Search**: Uses same embedding model to vectorize queries, performs similarity search in ChromaDB
51+
- **Search**: Uses same embedding model to vectorize queries, performs
52+
similarity search in ChromaDB
4453
- **Tools**: Exposes `search_service_logs` and `get_database_stats` MCP tools
4554

4655
### Data Flow
47-
1. Problem statement → Query embedding → Vector similarity search → Ranked results
48-
2. Results include notification JSON, metadata (folder, severity, variables), and similarity scores
56+
57+
1. Problem statement → Query embedding → Vector similarity search →
58+
Ranked results
59+
2. Results include notification JSON, metadata (folder, severity, variables),
60+
and similarity scores
4961

5062
## Critical Implementation Details
5163

52-
**Variable Handling**: Service notifications contain template variables like `${NAMESPACE}`, `${REASON}` that must be interpolated. The system:
64+
**Variable Handling**: Service notifications contain template variables like
65+
`${NAMESPACE}`, `${REASON}` that must be interpolated. The system:
66+
5367
- Extracts variables using regex during embedding creation
5468
- Stores them as JSON strings in ChromaDB metadata (scalar value requirement)
5569
- Returns parsed variable lists to guide LLM interpolation workflow
5670

57-
**Container Architecture**: Multi-stage build separates embedding creation (expensive, cached) from runtime (lightweight). Only rebuilds embeddings when notification files or embedding script change.
71+
**Container Architecture**: Multi-stage build separates embedding creation
72+
(expensive, cached) from runtime (lightweight). Only rebuilds embeddings when
73+
notification files or embedding script change.
5874

5975
**Project Scripts**: Uses uv project scripts defined in `pyproject.toml`:
60-
- `serve = "main:main"`
76+
77+
- `serve = "main:main"`
6178
- `build-embeddings = "scripts.build_embeddings:main"`
6279

63-
**MCP Configuration**: `mcp-config.json` provides ready-to-use HTTP transport config for MCP clients connecting to `localhost:8000/mcp`.
80+
**MCP Configuration**: `mcp-config.json` provides ready-to-use HTTP transport
81+
config for MCP clients connecting to `localhost:8000/mcp`.
6482

6583
## Environment Variables
6684

67-
- `EMBEDDING_MODEL`: Override default sentence transformer model (default: "all-MiniLM-L6-v2")
85+
- `EMBEDDING_MODEL`: Override default sentence transformer model
86+
(default: "all-MiniLM-L6-v2")
6887
- `HOST`: Server bind address (default: "127.0.0.1", container uses "0.0.0.0")
6988
- `PORT`: Server port (default: "8000")
7089

7190
## Database Dependencies
7291

73-
The MCP server requires the ChromaDB database to exist before startup. Always run `uv run build-embeddings` before `uv run serve` in fresh environments. The embeddings script includes a test search for "missing or insufficient permissions" to validate the database.
92+
The MCP server requires the ChromaDB database to exist before startup. Always
93+
run `uv run build-embeddings` before `uv run serve` in fresh environments. The
94+
embeddings script includes a test search for "missing or insufficient
95+
permissions" to validate the database.

0 commit comments

Comments
 (0)