|
| 1 | +# Contributing |
| 2 | + |
| 3 | +Thank you for your interest in contributing to the Apache Cassandra Node.js Driver! This repository is now part of the Apache Software Foundation (ASF) and follows Apache contribution practices. |
| 4 | + |
| 5 | +## Ways to Contribute |
| 6 | + |
| 7 | +There are many ways to contribute, including: |
| 8 | + |
| 9 | +- **Bug Reports**: Identify incorrect behavior, inconsistencies, or regressions in the driver. Provide reproduction steps when possible. |
| 10 | +- **Feature Requests**: Propose improvements or new functionality. Please describe the use case (not just a proposed API). |
| 11 | +- **Documentation Improvements**: Enhance guides, examples, javadocs, or configuration explanations. |
| 12 | +- **Pull Requests**: Submit fixes, enhancements, performance improvements, or refactorings. |
| 13 | +- **Testing Contributions**: Add missing tests, improve coverage, or enhance test infrastructure. |
| 14 | +- **Support & Triage**: Help evaluate reported issues or contribute to discussions. |
| 15 | +- **Verify Releases**: Verify the release artifacts work correctly in your environment, when a release is proposed in the mailing list. |
| 16 | + |
| 17 | +### Communication |
| 18 | +1. **Mailing List**: |
| 19 | + - https://lists.apache.org/list.html?dev@cassandra.apache.org |
| 20 | +2. **JIRA**: |
| 21 | + - https://issues.apache.org/jira/projects/CASSNODEJS |
| 22 | + - Older issues before the donation can be found at: |
| 23 | + - https://datastax-oss.atlassian.net/projects/NODEJS |
| 24 | +3. **GitHub Repository**: https://github.com/apache/cassandra-nodejs-driver |
| 25 | +4. **Slack**: #cassandar-drivers channel, in the Apache Software Foundation [Slack](https://infra.apache.org/slack.html). |
| 26 | +Ask in the mailing list for an invite to the Slack workspace. |
| 27 | + |
| 28 | +## Submitting changes |
| 29 | + |
| 30 | +### Submitting Changes (Pull Requests) |
| 31 | + |
| 32 | +All code changes require: |
| 33 | + |
| 34 | +1. **A corresponding JIRA ticket** |
| 35 | + Include the JIRA key in the PR title, e.g.: |
| 36 | + `NODEJS-696: Migrate Travis CI to Github Action` |
| 37 | + |
| 38 | +2. **A pull request on GitHub** |
| 39 | + Repository: <https://github.com/apache/cassandra-nodejs-driver> |
| 40 | + |
| 41 | +3. **Tests** |
| 42 | + Every fix or feature should include or update tests. PRs without tests are rarely accepted. |
| 43 | + |
| 44 | +4. **Documentation updates** |
| 45 | + Update manual, javadocs, examples, or reference docs when applicable. |
| 46 | + |
| 47 | +5. **Passing CI** |
| 48 | + PRs must pass all CI jobs unless reviewers explicitly allow exceptions. |
| 49 | + |
| 50 | +6. **Code Review** |
| 51 | + All PRs require at least two approvals from Apache committers before merging. |
| 52 | + |
| 53 | +7. **Squash after review** |
| 54 | + After committers' approvals and before merging, please squash commits into one, with a commit message in the following format: |
| 55 | + ``` |
| 56 | + NODEJS-696: Migrate Travis CI to Github Action |
| 57 | + patch by Jane He; reviewed by Abe Ratnofsky and Bret McGuire for NODEJS-696 |
| 58 | + ``` |
| 59 | + |
| 60 | +## Development Setup |
| 61 | + |
| 62 | +### Prerequisites |
| 63 | +- Node.js v20 or later |
| 64 | +- npm |
| 65 | + |
| 66 | +### Running Tests Locally |
| 67 | +1. Install Cassandra Cluster Manager (CCM) following its [README](https://github.com/apache/cassandra-ccm). |
| 68 | +2. On MacOS only, enable loopback aliases: |
| 69 | + |
| 70 | +```shell |
| 71 | +for i in {2..255}; do sudo ifconfig lo0 alias 127.0.0.$i up; done |
| 72 | +``` |
| 73 | +Note: This may slow down networking. To remove the aliases after testing: |
| 74 | +```shell |
| 75 | +for i in {2..255}; do sudo ifconfig lo0 -alias 127.0.0.$i up; done |
| 76 | +``` |
| 77 | + |
| 78 | +3. Install project dependencies: `npm install` |
| 79 | +4. Run the tests: `npx mocha test/unit test/integration/short --recursive --exit`. |
| 80 | +You can specify the Cassandra version by the `CCM_VERSION` environment variable, e.g.: |
| 81 | +`CCM_VERSION=5.0.2 npx mocha test/unit test/integration/short --recursive --exit`. |
| 82 | + |
| 83 | +## License and CLA |
| 84 | + |
| 85 | +All contributions are made under the Apache License, Version 2.0. The ASF requires a signed Contributor License Agreement (CLA) for non-trivial contributions. |
0 commit comments