@@ -183,3 +183,158 @@ The server is distributed as a binary executable, a Docker image, an npm package
183183- A ** Python** package is available at [ pypi.org] ( https://pypi.org/project/kubernetes-mcp-server/ ) .
184184 It provides a script that downloads the correct platform binary from the GitHub releases page and runs it.
185185 It provides a convenient way to run the server using ` uvx ` or ` python -m kubernetes_mcp_server ` .
186+
187+ ## Contributing to Red Hat OpenShift MCP Server
188+
189+ This is a ** fork** of the official Red Hat openshift-mcp-server repository. When contributing upstream, follow these strict requirements.
190+
191+ ### Git Remote Configuration
192+
193+ This fork has the following remotes configured:
194+
195+ ``` bash
196+ fork: https://github.com/macayaven/openshift-mcp-server.git # Your fork
197+ origin: https://github.com/openshift/openshift-mcp-server.git # Red Hat upstream
198+ upstream: https://github.com/containers/kubernetes-mcp-server.git # Original project
199+ ```
200+
201+ ### Red Hat PR Requirements (from PR #63 feedback)
202+
203+ ** CRITICAL** : Red Hat reviewers require clean, well-organized PRs. Based on PR #63 feedback:
204+
205+ 1 . ** Clean Commit History - MANDATORY**
206+ - ** Rebase before submitting** : Squash WIP commits into logical, reviewable chunks
207+ - ** One feature per commit** (or small number of well-organized commits)
208+ - Reviewers WILL request rebasing if there are too many commits
209+ - Use ` git rebase -i origin/main ` to clean up history before creating PR
210+ - Example: 37 commits → rebased to 3-5 logical commits
211+
212+ 2 . ** Commit Message Format**
213+ - Follow conventional commits style
214+ - Clear, descriptive commit messages
215+ - Reference issues if applicable
216+ - Format: ` type: description ` (e.g., ` feat: add OpenShift AI toolset ` )
217+
218+ 3 . ** Code Quality Requirements**
219+ - Must pass ` make build `
220+ - Must pass ` make lint `
221+ - Must pass ` make test `
222+ - Test with mcp-inspector: ` npx @modelcontextprotocol/inspector@latest $(pwd)/kubernetes-mcp-server `
223+
224+ 4 . ** PR Approval Process**
225+ - PRs require approval from OWNERS file maintainers
226+ - Organization members must verify patches with ` /ok-to-test ` comment
227+ - Need ` lgtm ` label for merge
228+ - First-time contributors receive community support
229+
230+ 5 . ** Architecture Principles**
231+ - Go-based native implementation (NOT kubectl/helm wrappers)
232+ - Direct Kubernetes API interaction via client-go
233+ - Maintain extensive test coverage
234+ - Follow existing package structure (` pkg/ ` , ` cmd/ ` , ` internal/ ` )
235+
236+ ### PR Workflow for Red Hat Upstream
237+
238+ ``` bash
239+ # 1. Ensure you're on your feature branch with changes
240+ git checkout 001-openshift-ai
241+
242+ # 2. Fetch latest from Red Hat upstream
243+ git fetch origin
244+
245+ # 3. Rebase onto latest upstream main
246+ git rebase origin/main
247+
248+ # 4. IMPORTANT: Clean up commit history
249+ git rebase -i origin/main
250+ # In the interactive rebase:
251+ # - Squash WIP commits
252+ # - Combine related changes
253+ # - Keep commits logical and reviewable
254+ # - Aim for 3-5 commits maximum per feature
255+
256+ # 5. Force push to your fork (this updates the PR)
257+ git push fork 001-openshift-ai --force-with-lease
258+
259+ # 6. Verify build and tests pass
260+ make build
261+ make lint
262+ make test
263+
264+ # 7. Test with mcp-inspector
265+ npx @modelcontextprotocol/inspector@latest $( pwd) /kubernetes-mcp-server
266+
267+ # 8. Create PR to Red Hat upstream
268+ # - Title: Clear, descriptive (e.g., "Add OpenShift AI toolset")
269+ # - Description: What, why, how
270+ # - Link to any related issues
271+ # - Include testing notes
272+ ```
273+
274+ ### Example: Cleaning Up Commit History
275+
276+ ``` bash
277+ # Before: 37 commits with WIP, fixes, debugging
278+ git log --oneline | head -40
279+
280+ # Interactive rebase to squash
281+ git rebase -i origin/main
282+
283+ # In editor, change commits like this:
284+ # pick abc1234 feat: add OpenShift AI client package
285+ # squash def5678 wip: update imports
286+ # squash ghi9012 fix: typo in client
287+ # pick jkl3456 feat: implement DataScienceProjects tools
288+ # squash mno7890 fix: linting errors
289+ # pick pqr1234 feat: register OpenShift AI toolset
290+ # squash stu5678 docs: update README
291+
292+ # After: 3 clean commits
293+ # 1. feat: add OpenShift AI client package
294+ # 2. feat: implement DataScienceProjects tools
295+ # 3. feat: register OpenShift AI toolset
296+ ```
297+
298+ ### Common Pitfalls to Avoid
299+
300+ - ❌ Submitting PRs with 30+ commits
301+ - ❌ Commits like "wip", "fix", "debugging", "oops"
302+ - ❌ Not rebasing before submitting
303+ - ❌ Not running ` make build ` and ` make test ` before PR
304+ - ❌ Wrapping kubectl/helm instead of using Go clients
305+ - ❌ Adding features without tests
306+
307+ ### PR Checklist Before Submitting
308+
309+ - [ ] Rebased onto latest ` origin/main `
310+ - [ ] Commit history cleaned up (3-5 logical commits)
311+ - [ ] ` make build ` passes
312+ - [ ] ` make lint ` passes
313+ - [ ] ` make test ` passes
314+ - [ ] Tested with ` mcp-inspector `
315+ - [ ] Commit messages follow conventional format
316+ - [ ] PR description explains what, why, how
317+ - [ ] Tests added for new functionality
318+ - [ ] Documentation updated if needed
319+
320+ ### Local Testing with MCP Inspector
321+
322+ ``` bash
323+ # Build the server
324+ make build
325+
326+ # Test interactively with MCP Inspector
327+ npx @modelcontextprotocol/inspector@latest $( pwd) /kubernetes-mcp-server
328+
329+ # This opens a web UI where you can:
330+ # - Browse available tools
331+ # - Test tool invocations
332+ # - Inspect JSON schemas
333+ # - Verify tool responses
334+ ```
335+
336+ ### Resources
337+
338+ - [ Previous PR example] ( https://github.com/openshift/openshift-mcp-server/pull/63 )
339+ - [ Conventional Commits] ( https://www.conventionalcommits.org/ )
340+ - [ MCP Inspector] ( https://modelcontextprotocol.io/docs/tools/inspector )
0 commit comments