Skip to content

Commit

Permalink
Create CONTRIBUTING.md (#92)
Browse files Browse the repository at this point in the history
* Create CONTRIBUTING.md

* Create pull_request_template.md

* Create requirements-dev.txt

* Update CONTRIBUTING.md

* Update pull_request_template.md

* Update CONTRIBUTING.md

Co-authored-by: Shawn Wells <[email protected]>

* Update requirements-dev.txt

Co-authored-by: Shawn Wells <[email protected]>

* Update .github/pull_request_template.md

Co-authored-by: Shawn Wells <[email protected]>

* Update .github/pull_request_template.md

Co-authored-by: Shawn Wells <[email protected]>

* Update .github/pull_request_template.md

Co-authored-by: Shawn Wells <[email protected]>

* Update .github/pull_request_template.md

Co-authored-by: Shawn Wells <[email protected]>

* Update CONTRIBUTING.md

Co-authored-by: Shawn Wells <[email protected]>

* Update CONTRIBUTING.md

Co-authored-by: Shawn Wells <[email protected]>

* Update CONTRIBUTING.md

Co-authored-by: Shawn Wells <[email protected]>

* Typo fix - CONTRIBUTING.md

* Update CONTRIBUTING.md

* Update pull_request_template.md

* Update pull_request_template.md

* Update pull_request_template.md

* Update pull_request_template.md

Co-authored-by: Shawn Wells <[email protected]>
  • Loading branch information
jshcodes and shawndwells authored Mar 25, 2021
1 parent 8c4e4c9 commit 2bf4197
Show file tree
Hide file tree
Showing 3 changed files with 179 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
> Please review our [Code of Conduct](https://github.com/CrowdStrike/falconpy/CODE_OF_CONDUCT.md)
> and our [Contribution Guidelines](https://github.com/CrowdStrike/falconpy/CONTRIBUTING.md) before submitting a Pull Request.
> REMOVE ALL PULL REQUEST HINTS BEFORE SUBMITTING
## PULL REQUEST TITLE
Pull Request general description should go here.
> Please fill out all values and then remove any help text before submitting your PR.
> Refer to [this PR](https://github.com/CrowdStrike/falconpy/pull/67) as a reference example!
- [ ] Enhancement
- [ ] Major Feature update
- [ ] Bug fixes
- [ ] Breaking Change
- [ ] Updated unit tests
- [ ] Documentation

> Check the values above that match your PR and remove the remaining.
```shell
COVERAGE RESULTS SHOULD BE POSTED HERE
PLEASE REVIEW CONTRIBUTING.md FOR MORE
DETAILS ON GENERATING COVERAGE RESULTS
```

## Added features and functionality
+ If your PR adds features or functionality, what should be included in the next release notes?

## Issues resolved
+ Bug fix: Please list related bugs individually. Identifying the ticket or bug report in the PR description auto-updates the affected ticket and helps the community with ticket triage. For example:

* Fixes https://github.com/CrowdStrike/falconpy/issues/1234 by doing foo
* Mitigates https://github.com/CrowdStrike/falconpy/issues/5678 by updating bar.
+ BE EXPLICIT in what you are resolving

## Other
+ List any other details here
+ Documentation regarding your changes can also be listed here
123 changes: 123 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
# Contributing to this repository <!-- omit in toc -->

## Getting started <!-- omit in toc -->
_Welcome!_ We're excited you want to take part in the FalconPy community!

Please review this document for details regarding getting started with your first contribution, packages you'll need to install as a developer, and our pull request process. If you have any questions, please let us know by
posting your question in the [discussion board](https://github.com/CrowdStrike/falconpy/discussions).

### Before you begin
- Have you read the [Code of Conduct](CODE_OF_CONDUCT.md)? The Code of Conduct helps us establish community norms and how they'll be enforced.

### Table of Contents
- [How you can contribute](#how-you-can-contribute)
- [Pull Requests](#pull-requests)
- [Suggestions](#suggestions)

## How you can contribute
- See something? Say something! Submit a [bug report](https://github.com/CrowdStrike/falconpy/issues) to let the community know what you've experienced or found. Bonus points if you suggest possible fixes or what you feel may resolve the issue. For example: "_Attempted to use the XZY API class but it errored out. Could a more descriptive error code be returned?_"
- Join the [discussion board](https://github.com/CrowdStrike/falconpy/discussions) where you can:
- [Interact](https://github.com/CrowdStrike/falconpy/discussions/categories/general) with other members of the community
- Suggest [new functionality](https://github.com/CrowdStrike/falconpy/discussions/categories/ideas)
- Provide [feedback](https://github.com/CrowdStrike/falconpy/discussions/categories/q-a)
- [Show others](https://github.com/CrowdStrike/falconpy/discussions/categories/show-and-tell) how you are using FalconPy today
- Submit a [Pull Request](#pull-requests)

### Bug reporting is handled using GitHub's issues
We use GitHub issues to track bugs. Report a bug by opening a [new issue](https://github.com/CrowdStrike/falconpy/issues).

### GitHub's discussion board is used for questions, suggestions and feedback.
We use GitHub's discussion board functionality to handling community discussions related to
[questions](https://github.com/CrowdStrike/falconpy/discussions/categories/q-a),
[feedback](https://github.com/CrowdStrike/falconpy/discussions/categories/general)
or [functionality enhancements](https://github.com/CrowdStrike/falconpy/discussions/categories/ideas).

## Pull Requests

### All contributions will be submitted under the Unlicense license
When you submit code changes, your submissions are understood to be under the same Unlicense [license](LICENSE) that covers the project.
If this is a concern, contact the maintainers before contributing.

### Additional contributor package requirements
`requirements-dev.txt` contains Python modules required for unit test development and for accessing the integrated debugger within FalconShell. Review this file's contents and install missing requirements as needed.

### Unit testing & Code coverage
+ All submitted code must also have an associated unit test that tests __all__ code paths within this new segment. (:100: percent coverage)
- If the code submission is already covered by an existing unit test, additional unit tests are not required.
- Please include coverage testing results in your Pull Request. (Example: [PR #67](https://github.com/CrowdStrike/falconpy/pull/67))
+ Unit testing is intended to prove out code formatting and functionality, not necessarily API functionality. Unit testing does not need to communicate with the API in order to provide the necessary coverage.
+ All new contributions __must__ pass unit testing before they will be merged.
- For scenarios where unit testing passes in the PR and fails post-merge, a maintainer will address the issue. If the problem is programmatic and related to code within the pull request, the merge may be reverted.
+ The util folder contains BASH scripts for triggering unit tests that match unit testing performed as part of our GitHub workflows.

#### Posting coverage results to Pull Requests
Our Pull Request template provides an area for you to post the coverage results from your local unit tests. This table is generated by the command `coverage report` and is executed when you use the "run-tests.sh" BASH script found in the util folder. This table is output only when all unit tests have passed successfully, and is a required element for Pull Request approval.

##### Example coverage results
```shell
Name Stmts Miss Cover
---------------------------------------------------------------
src/falconpy/__init__.py 10 0 100%
src/falconpy/_endpoint.py 1 0 100%
src/falconpy/_result.py 8 0 100%
src/falconpy/_service_class.py 31 0 100%
src/falconpy/_util.py 80 0 100%
src/falconpy/_version.py 8 0 100%
src/falconpy/api_complete.py 77 0 100%
src/falconpy/cloud_connect_aws.py 66 0 100%
src/falconpy/cspm_registration.py 114 0 100%
src/falconpy/detects.py 34 0 100%
src/falconpy/device_control_policies.py 67 0 100%
src/falconpy/event_streams.py 15 0 100%
src/falconpy/falconx_sandbox.py 78 0 100%
src/falconpy/firewall_management.py 130 0 100%
src/falconpy/firewall_policies.py 68 0 100%
src/falconpy/host_group.py 61 0 100%
src/falconpy/hosts.py 37 0 100%
src/falconpy/incidents.py 39 0 100%
src/falconpy/intel.py 89 0 100%
src/falconpy/iocs.py 58 0 100%
src/falconpy/oauth2.py 30 0 100%
src/falconpy/prevention_policy.py 67 0 100%
src/falconpy/real_time_response.py 135 0 100%
src/falconpy/real_time_response_admin.py 82 0 100%
src/falconpy/sensor_update_policy.py 103 0 100%
src/falconpy/spotlight_vulnerabilities.py 15 0 100%
src/falconpy/user_management.py 75 0 100%
---------------------------------------------------------------
TOTAL 1578 0 100%
```

#### More details regarding PyTest and Coverage
For more information regarding PyTest, and how we leverage it to perform unit testing, refer to the [PyTest documentation](https://docs.pytest.org/en/stable/contents.html#toc).

To find out more above Coverage, review their [website](https://coverage.readthedocs.io/en/coverage-5.5/).

### Linting
All submitted code must meet minimum linting requirements. We use `flake8` for linting. Refer to the "lint.sh" script within the util folder to review our standard linting parameters.

More information about flake8 can be found [here](https://flake8.pycqa.org/en/latest/).

### Branch targeting
_Please do not target the `main` branch with your Pull Request unless directed to do so by a maintainer_. Instead, target your PR at the most recent development branch.

We use [SemVer](https://semver.org/) as our versioning scheme. (Example branch name: _ver_0.4.3_)

If you are unable to identify the current development branch, please reach out to the maintainers or post a message to the general discussion board.

### Pull Request template
Please use the pull request template provided, making sure the following details are included in your request:
+ Is this a breaking change?
+ Are all new or changed code paths covered by unit testing?
+ A complete listing of issues addressed or closed with this change.
+ A complete listing of any enhancements provided by this change.
+ Any usage details developers may need to make use of this new functionality.
- Does additional documentation need to be developed beyond what is listed in your pull request?
+ Any other salient points of interest.

### Approval / Merging
All Pull Requests must be approved by at least one maintainer. Once approved, a maintainer will perform the merge and execute any backend
processes related to package deployment. At this time, contributors _do not_ have the ability to merge to the `main` branch.

## Suggestions
If you have suggestions on how this process could be improved, please let us know by [starting a new discussion](https://github.com/CrowdStrike/falconpy/discussions).
18 changes: 18 additions & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#
# This file is autogenerated by pip-compile
# To update, run:
#
# pip-compile requirements-dev.in
#
# These packages are not necessary in order to
# communicate with the CrowdStrike Falcon OAuth2 API.
#
# These packages are only required if you intend
# on using FalconShell, or are a contributor and are
# developing unit tests for the project.
#
coverage>=5.5 # via -r requirements-dev.in
flake8>=3.9.0 # via -r requirements-dev.in
ipython>=7.21.0 # via -r requirements-dev.in
pytest-cov>=2.11.1 # via -r requirements-dev.in
pytest>=6.2.2 # via -r requirements-dev.in

0 comments on commit 2bf4197

Please sign in to comment.