-
Notifications
You must be signed in to change notification settings - Fork 17
OCPEDGE-2543: add CONTRIBUTING.md #100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
openshift-merge-bot
merged 2 commits into
openshift-eng:main
from
fonta-rh:ocpedge-2543-contributing-md
Aug 3, 2026
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,154 @@ | ||
| # Contributing to Two-Node Toolbox | ||
|
|
||
| Two-Node Toolbox (TNT) is a deployment automation framework for two-node | ||
| OpenShift clusters in development and testing environments. It supports | ||
| arbiter and fencing topologies via dev-scripts, kcli, and assisted installer | ||
| deployment methods. Contributions from across Red Hat engineering are welcome. | ||
|
|
||
| ## Getting Started | ||
|
|
||
| 1. Fork `openshift-eng/two-node-toolbox` on GitHub. | ||
| 2. Clone your fork: | ||
|
|
||
| ```bash | ||
| git clone git@github.com:<your-username>/two-node-toolbox.git | ||
| cd two-node-toolbox | ||
| ``` | ||
|
|
||
| 3. Set up commit signing (GPG or SSH). The repo enforces signature | ||
| verification — unsigned commits are rejected. See [GitHub's signing | ||
| docs](https://docs.github.com/en/authentication/managing-commit-signature-verification) | ||
| for setup instructions. | ||
| 4. Ensure a container engine is available. All linters run in containers, | ||
| so no local tool installation is needed beyond the engine itself. | ||
| `CONTAINER_ENGINE` defaults to `podman`; override with | ||
| `CONTAINER_ENGINE=docker` if needed. | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
| 5. Install the pre-commit hook: | ||
|
|
||
| ```bash | ||
| make install-pre-commit | ||
| ``` | ||
|
|
||
| The hook runs `make verify` automatically on every commit, catching | ||
| lint issues before they reach CI. | ||
|
|
||
| ## What You Can Contribute | ||
|
|
||
| | Type | Location | Guidance | | ||
| |------|----------|---------| | ||
| | New deployment method | `deploy/openshift-clusters/roles/` | Add an Ansible role, wire into the Makefile | | ||
| | New topology | `deploy/openshift-clusters/` | Add config template and playbook support | | ||
| | Bug fix / enhancement | Relevant component directory | Follow existing patterns in that area | | ||
| | Helper script | `helpers/` | Standalone utility for cluster operations | | ||
| | Documentation | `docs/`, component READMEs | See the [Documentation](#documentation) section | | ||
| | CI / Prow job | External: `openshift/release` repo | CI configuration lives outside this repo | | ||
|
|
||
| ## Development Workflow | ||
|
|
||
| Create a branch from `main` using the appropriate naming convention: | ||
|
|
||
| - Features: `OCPEDGE-XXXX-short-slug` | ||
| - Bug fixes: `fix/OCPBUGS-XXXX-slug` | ||
|
|
||
| Run all checks before committing: | ||
|
|
||
| ```bash | ||
| make verify | ||
| ``` | ||
|
|
||
| For targeted checks, run individual linters: | ||
|
|
||
| ```bash | ||
| make shellcheck # Shell script linting | ||
| make yamlfmt # YAML formatting (auto-formats by default) | ||
| make ansible-lint # Ansible linting + playbook syntax check | ||
| ``` | ||
|
|
||
| `make yamlfmt` auto-formats files by default. `make verify` runs it in | ||
| validate-only mode (no modifications). `make shellcheck` is read-only. | ||
|
|
||
| ## Code Standards | ||
|
|
||
| All linters run inside containers via `hack/` scripts — no local tool | ||
| installation is required beyond a container engine. | ||
|
|
||
| ### Shell Scripts | ||
|
|
||
| - `#!/usr/bin/bash` shebang | ||
| - `set -euo pipefail` at the top | ||
| - Quote all variables to prevent word splitting | ||
| - UPPER_CASE for variable names | ||
| - Must pass shellcheck | ||
|
|
||
| ### YAML | ||
|
|
||
| - 2-space indentation | ||
| - Quote strings containing special characters | ||
| - Must pass yamlfmt | ||
|
|
||
| ### Ansible | ||
|
|
||
| - Follow existing role patterns in `deploy/openshift-clusters/roles/` | ||
| - Must pass ansible-lint (`.ansible-lint` defines the baseline) | ||
| - Do not add new entries to the `.ansible-lint` skip list — fix violations | ||
| instead | ||
| - Playbooks must pass `ansible-playbook --syntax-check` (run automatically | ||
| by `make ansible-lint`) | ||
|
|
||
| ### Python (when applicable) | ||
|
|
||
| - PEP 8 compliance, must pass ruff (checked by CodeRabbit on PRs) | ||
| - Use f-strings for formatting | ||
|
|
||
| ## Testing | ||
|
|
||
| - **Local:** `make verify` runs all linters (shellcheck, yamlfmt, | ||
| ansible-lint). | ||
| - **Pre-commit:** The hook runs `make verify` automatically on every commit. | ||
| - **End-to-end:** Deployment changes require testing on an actual cluster | ||
| (AWS hypervisor or Bring Your Own Server). Not everything in deployment | ||
| automation is unit-testable — integration testing against real | ||
| infrastructure is expected. | ||
| - **CI:** Prow jobs and CodeRabbit run on PRs. Both must pass before | ||
| requesting human review. | ||
|
|
||
| ## Security | ||
|
|
||
| - Never hardcode credentials, tokens, or secrets in code or commits. | ||
| - Use environment variables for sensitive data (`CI_TOKEN`, pull secrets). | ||
| - Pull secrets belong in `config/pull-secret.json` (gitignored). | ||
| - Verify that logs and command output do not leak credentials before | ||
| committing. | ||
| - `.gitignore` already excludes sensitive config files — do not circumvent | ||
| it. | ||
|
|
||
| ## Documentation | ||
|
|
||
| - Update relevant READMEs when changing behavior. | ||
| - Professional, terse, customer-centric style — no emojis or marketing | ||
| language. | ||
| - When adding new Make targets, update the Makefile help text. | ||
| - **CLAUDE.md maintenance:** If a change adds new paths, commands, roles, | ||
| or configuration options, update `CLAUDE.md` at the repo root. | ||
| AI-assisted contributors rely on it for accurate context. Treat it like | ||
| any other documentation — it must reflect the current state of the repo. | ||
|
|
||
| ## Commit Conventions | ||
|
|
||
| - **With Jira ticket:** `OCPEDGE-XXXX: description` (primary format) | ||
| - **Without ticket:** `type: description` where type is one of: feat, fix, | ||
| docs, chore | ||
| - All commits **must be signed** (GPG or SSH). The repo has signature | ||
| verification enabled — unsigned commits are rejected. | ||
| - Keep commits focused and atomic. | ||
|
|
||
| ## Pull Requests | ||
|
|
||
| - Open PRs from your fork against `main`. | ||
| - PR title follows the same convention as commit messages. | ||
| - **CodeRabbit** runs automated review on all PRs. | ||
| - **Prow** jobs run additional CI checks. | ||
| - Review is handled by teams in OWNERS: **edge-enablement** and | ||
| **team-dragonfly**. | ||
| - Address CodeRabbit feedback before requesting human review. | ||
| - Run `make verify` locally before pushing. | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔒 Security & Privacy | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
Repository: openshift-eng/two-node-toolbox
Length of output: 399
🏁 Script executed:
Repository: openshift-eng/two-node-toolbox
Length of output: 2489
🏁 Script executed:
Repository: openshift-eng/two-node-toolbox
Length of output: 219
🌐 Web query:
openshift-eng/two-node-toolbox main branch signed commits required signatures ruleset💡 Result:
As of July 31, 2026, the openshift-eng/two-node-toolbox repository does not have a publicly visible GitHub ruleset enforced that mandates signed commits [1]. While commit signature verification is a common practice for security in OpenShift-related repositories, commit history in this repository shows that both signed and unsigned commits have been accepted [2][3][4][5][6]. Specifically, while many recent commits are marked as "Verified" (often associated with automated processes or contributors with configured GPG/SSH signing keys) [2][3][5][6], there is no indication from the repository's configuration that signed commits are a mandatory requirement enforced via a GitHub ruleset. You can verify the active rulesets for any public GitHub repository by navigating to the "Rulesets" tab in the repository settings (if you have appropriate permissions) or by appending /rules to the repository URL (e.g., https://github.com/openshift-eng/two-node-toolbox/rules) [7]. GitHub rulesets, when configured, can mandate signed commits for all pushes to target branches [8][9][10].
Citations:
Correct the commit-signing guidance.
The repository does not publicly enforce signed commits on
main, so unsigned commits are not guaranteed to be rejected. Recommend GPG or SSH signing without claiming repository enforcement.🤖 Prompt for AI Agents
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Won't fix — commit signature verification was recently enabled on this repo. The enforcement claim is accurate.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Length of output: 693
@fonta-rh, verification failed because the GitHub integration cannot read the branch-protection endpoint. It returned HTTP 403:Resource not accessible by integration.Please retry with credentials that can read
mainbranch protection, or provide the enabled setting from the repository configuration. I will leave the finding unresolved until the setting is verifiable.✏️ Learnings added
You are interacting with an AI system.