Skip to content

Latest commit

 

History

History
114 lines (82 loc) · 5.7 KB

CONTRIBUTING.md

File metadata and controls

114 lines (82 loc) · 5.7 KB

Guidelines for Contributing Code

New Relic welcomes code contributions by the Node community to this module, and have taken effort to make this process easy for both contributors and our development team.

Process

Feature Requests

Feature requests should be submitted in the Issue tracker, with a description of the expected behavior & use case. Before submitting an Issue, please search for similar ones in the closed issues.

Pull Requests

We can only accept PRs for version v4.0.0 or greater due to open source licensing restrictions.

Code of Conduct

Before contributing please read the code of conduct

Note that our code of conduct applies to all platforms and venues related to this project; please follow it in all your interactions with the project and its participants.

Contributor License Agreement

Keep in mind that when you submit your Pull Request, you'll need to sign the CLA via the click-through using CLA-Assistant. If you'd like to execute our corporate CLA, or if you have any questions, please drop us an email at [email protected].

For more information about CLAs, please check out Alex Russell’s excellent post, “Why Do I Need to Sign This?”.

Slack

We host a public Slack with a dedicated channel for contributors and maintainers of open source projects hosted by New Relic. If you are contributing to this project, you're welcome to request access to the #oss-contributors channel in the newrelicusers.slack.com workspace. To request access, see https://newrelicusers-signup.herokuapp.com/.

PR Guidelines

Version Support

When contributing, keep in mind that New Relic customers (that's you!) are running many different versions of Node, some of them pretty old. Changes that depend on the newest version of Node but do not maintain backwards compatibility, will probably be rejected.

If you’re planning on contributing a new feature or an otherwise complex contribution, we kindly ask you to start a conversation with the maintainer team by opening up an Github issue first.

Commit Guidelines

We use Conventional Commits to format commit messages for this repository. Conventional Commits provide a standardized format for commit messages that allows for automatic generation of changelogs and easy tracking of changes.

When contributing to this repository, please ensure that your commit messages adhere to the Conventional Commit guidelines. Specifically, your commit messages should:

  • Start with a type, indicating the kind of change being made (e.g. feat for a new feature, fix for a bugfix, etc.). The types we support are:
    • build: changes that affect the build system or external dependencies
    • chore: changes that do not modify source or test files
    • ci: changes to our CI configuration files and scripts
    • docs: documentation additions or updates
    • feat: new features or capabilities added to the agent
    • fix: bugfixes or corrections to existing functionality
    • perf: performance improvements
    • refactor: changes that do not add new feature or fix bugs, but improve code structure or readability
    • revert: revert a previous commit
    • security: changes related to the security of the agent, including the updating of dependencies due to CVE
    • style - changes that do not affect the meaning of the code (e.g. formatting, white-space, etc.)
    • test - adding new tests or modifying existing tests
  • Use the imperative, present tense (e.g. "add feature" instead of "added feature")
  • Optionally, include a scope in parantheses after the type to indicate which part of the repository is affected (e.g. feat(instrumentation): add support for Prisma Client)

Please note that we use the Squash and Merge method when merging Pull Requests into the main branch. We do not use the original commit messages from each individual commit. Instead, we use the Pull Request title as the commit message for the squashed commit, and as such, require that the Pull Request title adheres to our Conventional Commit standards. Any additional documentation or information relevant to the release notes should be added to the "optional extended description" section of the squash commit on merge.

Testing

The module includes a suite of unit and functional tests which should be used to verify that your changes don't break existing functionality.

All tests are stored in tests/ and are written using Node-Tap with the extension .tap.js.

To run the full suite, run: npm test.

Individual test scripts include:

npm run lint
npm run unit

Writing tests

For most contributions it is strongly recommended to add additional tests which exercise your changes. This helps us efficiently incorporate your changes into our mainline codebase and provides a safeguard that your change won't be broken by future development. Because of this, we require that all changes come with tests. You are welcome to submit pull requests with untested changes, but they won't be merged until you or the development team have an opportunity to write tests for them.

There are some rare cases where code changes do not result in changed functionality (e.g. a performance optimization) and new tests are not required. In general, including tests with your pull request dramatically increases the chances it will be accepted.