Thank you for your interest in contributing to the Swarm Agents Cloud Plugin!
- JDK 21 or later
- Maven 3.9.6+
- Docker with Swarm mode enabled (for testing)
- Jenkins 2.528.3 or later
# Clone the repository
git clone https://github.com/jenkinsci/swarm-agents-cloud-plugin.git
cd swarm-agents-cloud-plugin
# Build the plugin
mvn clean package
# Run with embedded Jenkins for testing
mvn hpi:run# Run all tests
mvn verify
# Run only unit tests
mvn test
# Run with coverage
mvn verify jacoco:reportsrc/
├── main/
│ ├── java/io/jenkins/plugins/swarmcloud/
│ │ ├── api/ # Docker Swarm API client
│ │ ├── config/ # Docker credentials helper
│ │ ├── gc/ # Orphan service cleanup
│ │ ├── monitoring/ # Prometheus metrics & audit logging
│ │ ├── pipeline/ # Pipeline step support
│ │ ├── ratelimit/ # Rate limiting
│ │ ├── rest/ # REST API endpoints
│ │ ├── security/ # Input validation
│ │ └── ... # Core plugin classes
│ └── resources/
│ └── io/jenkins/plugins/swarmcloud/
│ └── */ # Jelly views and configs
└── test/
└── java/ # Unit and integration tests
- Follow Jenkins coding conventions
- Use meaningful variable and method names
- Add Javadoc for public APIs
- Keep methods focused and small
Use Jenkins Design Library components instead of custom CSS:
- Buttons:
jenkins-button,jenkins-button--primary,jenkins-!-destructive-color - Alerts:
jenkins-alert,jenkins-alert-danger - Tables:
jenkins-table - Empty state:
<l:notice title="..." icon="..."> - Dialogs: Use
dialog.confirm().then()promise pattern - Enums in forms: Use
<f:select/>withdoFillXxxItems()method in Descriptor for custom/nested enums. Standard Jenkins enums (likeNode.Mode) can use<f:enum>
Reference: Jenkins Design Library
- Write unit tests for new functionality
- Use JUnit 5 for tests
- Mock external dependencies (Docker API)
- Test both success and failure scenarios
- Fork the repository
- Create a feature branch (
git checkout -b feature/my-feature) - Make your changes
- Run tests (
mvn verify) - Commit with clear message
- Push to your fork
- Open a Pull Request
Follow conventional commits:
feat: Add support for Docker configs
fix: Correct memory calculation in dashboard
docs: Update README with new features
test: Add tests for orphan service cleanup
- Keep changes focused and atomic
- Update documentation if needed
- Add tests for new features
- Ensure CI passes
- Use GitHub Issues for bug reports and feature requests
- Include Jenkins version, plugin version, and Docker Swarm version
- Provide steps to reproduce for bugs
- Include relevant logs (sanitize secrets!)
If you discover a security vulnerability, please report it privately:
- Do NOT open a public issue
- Email the maintainer or use GitHub's security advisory feature
By contributing, you agree that your contributions will be licensed under the MIT License.
- Open an issue for questions
- Check existing issues and PRs
- Review Jenkins Plugin Development docs
Thank you for contributing!