Contributing to nf-slack¶
Thank you for your interest in contributing to nf-slack! This document provides guidelines and instructions for contributing to the project.
Getting Started¶
Prerequisites¶
- Java 11 or higher
- Gradle (wrapper included)
- Nextflow 25.04.0 or higher
- A Slack workspace with admin access for testing
Development Setup¶
- Clone the repository
- Build the plugin
- Run tests
- Install locally
- Test with Nextflow
Development Workflow¶
Making Changes¶
- Create a feature branch
-
Make your changes
-
Write clean, well-documented code
- Follow existing code style and conventions
-
Add tests for new functionality
-
Test your changes
- Commit your changes
Follow Conventional Commits for commit messages:
feat:- New featuresfix:- Bug fixesdocs:- Documentation changestest:- Test updatesrefactor:- Code refactoring-
chore:- Maintenance tasks -
Push and create a pull request
Code Style¶
- Follow standard Groovy conventions
- Use meaningful variable and method names
- Add comments for complex logic
- Keep methods focused and concise
- Ensure all tests pass before submitting
Testing¶
All contributions should include appropriate tests:
- Unit tests for new classes and methods
- Integration tests for workflow features
- Configuration tests for new config options
Run the test suite:
Run specific tests:
Pull Request Guidelines¶
When submitting a pull request:
- Provide a clear description of the changes and their purpose
- Reference any related issues using
Fixes #123orCloses #123 - Ensure all tests pass - CI will verify this
- Update documentation - README, examples, and inline comments
- Keep changes focused - one feature or fix per PR
- Respond to feedback - address reviewer comments promptly
PR Checklist¶
- Tests added/updated and passing
- Documentation updated (README, examples, inline comments)
- Commit messages follow conventional commits format
- Code follows project style guidelines
- No breaking changes (or clearly documented if unavoidable)
Project Structure¶
nf-slack/
├── src/
│ ├── main/
│ │ ├── groovy/
│ │ │ └── nextflow/
│ │ │ └── slack/ # Plugin source code
│ │ └── resources/
│ │ └── META-INF/
│ │ └── MANIFEST.MF # Plugin metadata
│ └── test/
│ └── groovy/
│ └── nextflow/
│ └── slack/ # Test files
├── example/
│ ├── configs/ # Configuration examples
│ ├── main.nf # Example workflow
│ └── nextflow.config # Example config
├── plugins/ # Built plugin files
└── build.gradle # Build configuration
Adding New Features¶
Adding a New Configuration Option¶
- Update configuration class (e.g.,
SlackConfig.groovy) - Add getter/setter methods with appropriate defaults
- Update message builder (if applicable)
- Add tests in corresponding test file
- Update documentation (README and example configs)
- Add example in
example/configs/if appropriate
Adding a New Notification Type¶
- Create config class (e.g.,
OnNewEventConfig.groovy) - Update
SlackConfig.groovyto include new config block - Update
SlackObserver.groovyto handle new event - Update
SlackMessageBuilder.groovyfor message formatting - Add tests for all new components
- Update documentation and examples
Publishing¶
Prerequisites for Publishing¶
To publish the plugin to the Nextflow Plugin Registry:
- Create
$HOME/.gradle/gradle.propertieswith your API key:
- Ensure version is updated in
build.gradle
Creating a Release¶
Releases are fully automated via GitHub Actions when you merge a PR that updates the version:
- Create a release PR
- Update version number in
build.gradle
- Update CHANGELOG.md with release notes
- Commit and push
git add build.gradle CHANGELOG.md
git commit -m "chore: release v0.2.1"
git push origin release/v0.2.1
- Create and merge PR
Open a pull request to main branch. Once merged, the automation will:
- ✅ Publish plugin to Nextflow Plugin Registry
- ✅ Create git tag (e.g.,
v0.2.1) - ✅ Create GitHub release with changelog
That's it! No manual steps required after merging the PR.
Manual Release (if needed)¶
If you need to manually trigger a release, use the GitHub Actions workflow:
- Go to Actions → Publish Plugin
- Click "Run workflow"
- Select the
mainbranch - Click "Run workflow"
Or publish locally (requires npr.apiKey in ~/.gradle/gradle.properties):
Note: The Nextflow Plugin Registry is currently available as preview technology. Contact info@nextflow.io to learn how to get access.
Versioning¶
This project follows Semantic Versioning:
- MAJOR version for incompatible API changes
- MINOR version for new functionality in a backwards-compatible manner
- PATCH version for backwards-compatible bug fixes
Reporting Issues¶
Bug Reports¶
When reporting bugs, please include:
- Clear title and description
- Steps to reproduce the issue
- Expected vs actual behavior
- Environment details (Nextflow version, Java version, OS)
- Configuration used (sanitize webhook URLs)
- Relevant logs or error messages
Feature Requests¶
For feature requests, please describe:
- The problem you're trying to solve
- Proposed solution (if you have one)
- Alternative solutions considered
- Use cases and examples
Code of Conduct¶
Our Standards¶
- Be respectful and inclusive
- Welcome newcomers
- Accept constructive criticism gracefully
- Focus on what's best for the community
- Show empathy towards others
Unacceptable Behavior¶
- Harassment or discriminatory language
- Personal attacks
- Publishing others' private information
- Other conduct inappropriate in a professional setting
Getting Help¶
If you need help:
- 📖 Check the documentation and examples
- 🐛 Search existing issues
- 💬 Open a new issue with the
questionlabel - 📧 Contact the maintainers
Recognition¶
Contributors will be recognized in:
- GitHub contributors list
- Release notes for significant contributions
- CONTRIBUTORS file (if we create one)
Thank you for contributing to nf-slack! 🎉