Thank you for your interest in contributing to the RHDH Testbed project! This guide will help you get started.
- Getting Started
- Development Setup
- Adding New Plugins
- Code Conventions
- Submitting Changes
- Documentation
Before contributing, please:
- Familiarize yourself with the README to understand the project's purpose
- Review existing issues to avoid duplicating work
- Check the
docs/folder for plugin-specific documentation
- Access to an OpenShift cluster (disposable/non-production recommended)
ocCLI installed and configuredhelmCLI installed- Bash shell
-
Clone the repository:
git clone https://github.com/PatAKnight/rhdh-testbed.git cd rhdh-testbed -
Copy the sample environment file:
cp .env.sample .env
-
Edit
.envwith your cluster credentials and configuration -
Run the setup:
./start.sh
- Test your changes against a disposable OpenShift cluster
- Run
./teardown.shto clean up resources after testing - Verify that both setup and teardown complete without errors
When adding support for a new RHDH plugin, you'll need to create several components. You can use the Cursor IDE with our scaffolding rule for guided assistance, or follow the manual checklist below.
If you're using Cursor IDE, this repository includes a scaffolding rule that provides guided assistance when adding new plugins.
The rule at .cursor/rules/plugin-scaffolding.mdc automatically activates when you're working with:
scripts/config-*-plugin*.shfilesresources/**/directoriesdocs/*.mdfilesconfig-plugins.sh
-
Open the repository in Cursor IDE
-
Start a new chat and ask Cursor to help add a plugin:
I want to add support for the <plugin-name> plugin. Can you help me scaffold the necessary files? -
Cursor will guide you through creating:
- Documentation file
- Configuration script with proper functions
- Resource manifests (if needed)
- Updates to
config-plugins.sh - Secret template updates
- "Add support for the Ansible plugin to this project"
- "Create scaffolding for integrating the Quay plugin"
- "Help me add the SonarQube plugin with operator deployment"
The rule includes templates, checklists, and examples to ensure consistency with existing plugins.
If you're not using Cursor, follow this checklist:
| File | Purpose |
|---|---|
docs/<plugin-name>.md |
Documentation for the plugin |
scripts/config-<plugin-name>-plugin.sh |
Configuration script |
resources/<plugin-name>/ |
Resource manifests (if needed) |
-
config-plugins.sh- Add entries to:PACKAGE_TO_CATEGORY- Map package names to categoriesCATEGORY_SETUP_FUNCTIONS- Define setup functionsCATEGORY_TEARDOWN_FUNCTIONS- Define teardown functions
-
resources/rhdh/rhdh-secrets.yaml- Add secret placeholders -
deploy/secret-template.yaml- Add secret placeholders -
.env.sample- Add any user-provided variables
Your configuration script should follow this structure:
#!/bin/bash
deploy_<plugin>() {
# Deploy operators/prerequisites
}
deploy_<plugin>_resources() {
# Deploy plugin-specific resources
}
config_secrets_for_<plugin>_plugins() {
# Configure secrets in rhdh-secrets.local.yaml
}
apply_<plugin>_labels() {
# Apply backstage.io/kubernetes-id labels
}
uninstall_<plugin>() {
# Cleanup for teardown
}
main() {
source "${PWD}/env_variables.sh"
source "${PWD}/.env"
deploy_<plugin>
deploy_<plugin>_resources
config_secrets_for_<plugin>_plugins
apply_<plugin>_labels
}
if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
main
fi- License-free: Only include resources for services that can run without commercial licenses
- Self-contained: Plugins should work within a single cluster without external dependencies
- Demo-ready: Focus on demo/testing use cases, not production deployments
- Use
#!/bin/bashshebang - Include a header comment describing the script's purpose
- Use meaningful function names:
deploy_*,config_*,uninstall_* - Source
env_variables.shand.envin themain()function - Use
${VARIABLE}syntax for variable expansion - Quote variables to prevent word splitting:
"${NAMESPACE}"
- Use 2-space indentation
- Include comments explaining non-obvious configurations
- Use
---to separate multiple documents in a single file
| Type | Convention | Example |
|---|---|---|
| Scripts | config-<plugin>-plugin.sh |
config-tekton-plugin.sh |
| Docs | <plugin>.md |
tekton.md |
| Resources | resources/<plugin>/ |
resources/tekton/ |
| Categories | UPPERCASE |
TEKTON, KEYCLOAK |
-
Create a feature branch from
main:git checkout -b feature/add-<plugin>-support
-
Make your changes following the conventions above
-
Test your changes thoroughly
-
Commit with a descriptive message:
git commit -m "Add support for <plugin> plugin" -
Push and create a pull request
- All new scripts are executable (
chmod +x) - Documentation is included for new plugins
-
config-plugins.shis updated with new mappings - Secret templates are updated if needed
- Changes tested against a real cluster
- No secrets or credentials committed
- Do not commit secrets - Use
.env(gitignored) for credentials - Do not edit
dynamic-plugins.default.yaml- This file is synced from upstream - Do not hardcode cluster URLs - Use environment variables
Each plugin should have documentation in docs/<plugin-name>.md covering:
- Description - What the plugin does
- Manual Setup - Step-by-step manual configuration
- Automatic Setup - How to use the scripts
- Demo - Verification steps
- Related Files - Links to scripts and resources
See existing docs in the docs/ folder for examples.
If your contribution adds significant new functionality, update the README:
- Add to the features list if applicable
- Update the plugin configuration section if adding new plugins
- Add any new prerequisites
If you have questions or need help:
- Check existing documentation in
docs/ - Review similar plugins for patterns to follow
- Open an issue for discussion before starting large changes
Thank you for contributing!