Contributing to Train-Juniper¶
Thank you for your interest in contributing to the Train-Juniper plugin! We welcome contributions from the community.
Quick Start for Contributors
New to the project? Start with our development workflow below.
Development Workflow ¶
We use a standard GitFlow workflow:
- Commit your changes with clear, descriptive messages
- Push to your fork and create a Pull Request
Code Requirements ¶
Quality Standards
All contributions must meet our quality standards before merging.
Testing ¶
- All new functionality must include tests
- Tests must pass:
bundle exec rake test
- Maintain or improve code coverage (currently 74%+)
Code Style ¶
- Follow existing Ruby style conventions
- Run linting:
bundle exec rubocop
- No RuboCop violations
Documentation ¶
- Update README.md for user-facing changes
- Add inline documentation for new methods
- Update relevant documentation in the Train Plugin Development Guide
Types of Contributions¶
Bug Reports ¶
Reporting Issues
Help us fix problems by providing detailed bug reports.
Requirements:
- Use GitHub Issues with the "bug" label
- Include steps to reproduce
- Provide InSpec and Ruby version information
- Include relevant log output with -l debug
Feature Requests ¶
Suggesting Features
We love new ideas! Please discuss before implementing.
Process: - Open a GitHub Issue with the "enhancement" label - Describe the use case and expected behavior - Discuss implementation approach before coding
Code Contributions¶
- Bug fixes
- New features
- Documentation improvements
- Test coverage improvements
Development Setup¶
# Clone your fork
git clone https://github.com/YOUR-USERNAME/train-juniper.git
cd train-juniper
# Install dependencies
bundle install
# Run tests
bundle exec rake test
# Build and test plugin locally
gem build train-juniper.gemspec
inspec plugin install ./train-juniper-0.1.0.gem
Testing Guidelines¶
Unit Tests¶
- Test all public methods
- Mock external dependencies
- Fast execution (< 5 seconds total)
Integration Tests¶
- Test real SSH connectivity patterns
- Use containerized environments when possible
- Document any manual testing requirements
Security Testing¶
- Run security tests:
bundle exec ruby test/security/security_test.rb
- Check for credential exposure
- Validate input sanitization
Pull Request Process¶
- Update Documentation: Ensure README and relevant docs are updated
- Test Coverage: Maintain or improve test coverage percentage
- Security Review: Run security tests and audit dependencies
- Code Review: Address feedback from maintainers
- Merge: Maintainers will merge approved PRs
Release Process¶
Releases are managed by project maintainers:
- Version bump in
lib/train-juniper/version.rb
- Update
CHANGELOG.md
- Create release tag
- Publish to RubyGems.org
- Update GitHub Pages documentation
Getting Help¶
- Questions: Open a GitHub Discussion or Issue
- Real-time help: Email saf@mitre.org
- Security issues: Email saf-security@mitre.org
Community¶
- Follow our Code of Conduct
- Be respectful and collaborative
- Help others learn and contribute
License¶
By contributing, you agree that your contributions will be licensed under the same Apache-2.0 license that covers the project.