diff --git a/.github/PULL_REQUEST_TEMPLATE/contrib.md b/.github/PULL_REQUEST_TEMPLATE/contrib.md new file mode 100644 index 0000000000..2f67b460ec --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE/contrib.md @@ -0,0 +1,89 @@ +## ๐Ÿงฉ Type of Change + +- [ ] Feature +- [ ] Bug fix +- [ ] Other + +## ๐Ÿง  Background & Motivation + + + + +## โœจ What Changed + + + + +## ๐Ÿงช Testing + + + +### โœ… Checklist +- [ ] Unit tests added/updated ([generation guide](https://docs.rapid7.com/insightconnect/unit-test-generation) | [writing guide](https://docs.rapid7.com/insightconnect/unit-test-primer)) +- [ ] Manually tested in InsightConnect (if applicable) + +### ๐Ÿ” Plugin Validation + +Please run the following commands and provide the output. **For action/trigger tests and runs, include outputs for all actions/triggers that were created or modified in this PR.** + +
+Plugin Validation Output (insight-plugin validate) + +``` +# Paste output here +``` + +
+ +
+Connection Test Results (insight-plugin run -T tests/example.json --debug --jq) + +``` +# Paste output here for the connection test of the plugin +# It doesn't matter which action/trigger you use, as long as -T flag is specified +``` + +
+ +
+Action/Trigger Test Results (insight-plugin run -R tests/example.json --debug --jq) + +``` +# Paste output here for all created/modified actions/triggers +``` + +
+ +### ๐Ÿ–ผ๏ธ In-Product Verification (if applicable) + +If you have access to an InsightConnect instance, please provide: +- [ ] Screenshot of job output with the plugin changes +- [ ] Screenshot of the changed connection, actions, or triggers input within the InsightConnect workflow builder + +## โœ… Code Quality Checklist + +Please review our [style guide](https://docs.rapid7.com/insightconnect/style-guide/) and check all that apply: +- [ ] Dependencies pinned in `Dockerfile` ([OS packages](https://docs.rapid7.com/insightconnect/style-guide/#dockerfile)) and `requirements.txt` ([Python packages](https://docs.rapid7.com/insightconnect/style-guide/#requirements.txt)) +- [ ] `USER nobody` set in `Dockerfile` for least privileged account +- [ ] Uses [slim SDK images](https://docs.rapid7.com/insightconnect/sdk-guide/#sdk-guide) when possible (e.g., `rapid7/insightconnect-python-3-slim-plugin:{sdk-version-num}`) +- [ ] Uses [PluginException](https://docs.rapid7.com/insightconnect/error-handling-in-integrations/#plugin-exceptions) / [ConnectionTestException](https://docs.rapid7.com/insightconnect/error-handling-in-integrations#connection-exceptions) for errors +- [ ] Uses `self.logger` for [logging](https://docs.rapid7.com/insightconnect/sdk-guide/#logging) +- [ ] Changelog updated ([style guide](https://docs.rapid7.com/insightconnect/style-guide/#changelog)) +- [ ] Work fully completed and functional + +## ๐Ÿ’ฌ Additional Notes + + +--- + +**Thanks for contributing! ๐ŸŽ‰** diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index b2511973a5..21a804cef2 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -1,60 +1,34 @@ -## Proposed Changes - -### Description - -Describe the proposed changes: - - - - -## PR Requirements - -Developers, verify you have completed the following items by checking them off: - -### Testing - -#### Unit Tests - -Review our documentation on [generating](https://docs.rapid7.com/insightconnect/unit-test-generation) and [writing](https://docs.rapid7.com/insightconnect/unit-test-primer) plugin unit tests - -- [ ] Unit tests written for any new or updated code - -#### In-Product Tests - -If you are an InsightConnect customer or have access to an InsightConnect instance, the following in-product tests should be done: - -- [ ] Screenshot of job output with the plugin changes -- [ ] Screenshot of the changed connection, actions, or triggers input within the InsightConnect workflow builder - -### Style - -Review the [style guide](https://docs.rapid7.com/insightconnect/style-guide/) - -- [ ] For dependencies, pin [OS package](https://docs.rapid7.com/insightconnect/style-guide/#dockerfile) and [Python package](https://docs.rapid7.com/insightconnect/style-guide/#requirements.txt) versions -- [ ] For security, set least privileged account with ``USER nobody`` in the ``Dockerfile`` when possible -- [ ] For size, use the [slim SDK images](https://docs.rapid7.com/insightconnect/sdk-guide/#sdk-guide) when possible: ``rapid7/insightconnect-python-3-38-slim-plugin:{sdk-version-num}`` and ``rapid7/insightconnect-python-3-38-plugin:{sdk-version-num}`` -- [ ] For error handling, use of [PluginException](https://docs.rapid7.com/insightconnect/error-handling-in-integrations/#plugin-exceptions) and [ConnectionTestException](https://docs.rapid7.com/insightconnect/error-handling-in-integrations#connection-exceptions) -- [ ] For logging, use [self.logger](https://docs.rapid7.com/insightconnect/sdk-guide/#logging) -- [ ] For docs, use [changelog style](https://docs.rapid7.com/insightconnect/style-guide/#changelog) -- [ ] For docs, validate markdown with ``insight-plugin validate`` which calls ``icon_validate`` to lint ``help.md`` - -### Functional Checklist -- [ ] Work fully completed -- [ ] Functional - - [ ] Any new actions/triggers include JSON [test files](https://docs.rapid7.com/insightconnect/style-guide/#tests) in the `tests/` directory created with `insight-plugin samples` - - [ ] Tests should all pass unless it's a negative test. Negative tests have a naming convention of `tests/$action_bad.json` - - [ ] Unsuccessful tests should fail by raising an exception causing the plugin to die and an object should be returned on successful test - - [ ] Add functioning test results to PR, sanitize any output if necessary - * Single action/trigger `insight-plugin run -T tests/example.json --debug --jq` - * All actions/triggers shortcut `insight-plugin run -T all --debug --jq` (use PR format at end) - - [ ] Add functioning run results to PR, sanitize any output if necessary - * Single action/trigger `insight-plugin run -R tests/example.json --debug --jq` - * All actions/triggers shortcut `insight-plugin run --debug --jq` (use PR format at end) - -### Assessment - -You must validate your work to reviewers: - -1. Run `insight-plugin validate` and make sure everything passes -2. Run the assessment tool: `insight-plugin run -A`. For single action validation: `insight-plugin run tests/{file}.json -A` -3. Copy (`insight-plugin ... | pbcopy`) and paste the output in **a new post** on this PR -4. Add required screenshots from the In-Product Tests section +## ๐ŸŽซ Ticket + + + + +## ๐Ÿงฉ Type of Change + +- [ ] Feature +- [ ] Bug fix +- [ ] Other + +## ๐Ÿง  Background & Motivation + + + + +## โœจ What Changed + + + + +## ๐Ÿงช Testing + + diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e9bb9d6f85..461b57c7e9 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -33,6 +33,24 @@ it into production. If you do not care to follow these rules, your contribution - **Don't** leave your pull request description blank. - **Don't** abandon your pull request. Being responsive helps us land your code faster. +#### Using the Contributor PR Template (External Contributors) + +**If you're contributing from a fork**, please use our specialized contributor template that includes additional validation sections. Here's how: + +1. When you click "Compare & Pull request" on GitHub after pushing your changes, you'll see a URL like: + ``` + https://github.com/rapid7/insightconnect-plugins/compare/master...your-username:your-branch + ``` + +2. Before clicking "Create pull request", add `?template=contrib.md` to the end of the URL: + ``` + https://github.com/rapid7/insightconnect-plugins/compare/master...your-username:your-branch?template=contrib.md + ``` + +3. Press Enter to reload the page with the contributor template pre-filled. + +This template includes sections for plugin validation outputs, connection tests, and code quality checklists that help us review external contributions more efficiently. + #### New Features - **Do** install validator dependencies necessary to run `make validate` to find and fix any errors or warnings that come up.