diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 68570ae..9866575 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -35,3 +35,47 @@ Remove this section if this change applies to all flows or to the documentation If there are no setup requirements, you can remove this section. Thank you for your contribution. ❤️ --> + +### Contributor Checklist ✅ + +- [ ] PR Title and commits follows [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/) +- [ ] Add a `closes #ISSUE_ID` or `fixes #ISSUE_ID` in the description if the PR relates to an opened issue. +- [ ] Documentation updated (plugin docs from `@Schema` for properties and outputs, `@Plugin` with examples, `README.md` file with basic knowledge and specifics). +- [ ] Setup instructions included if needed (API keys, accounts, etc.). +- [ ] Prefix all rendered properties by `r` not `rendered` (eg: `rHost`). +- [ ] Use `runContext.logger()` to log enough important infos where it's needed and with the best level (DEBUG, INFO, WARN or ERROR). + +⚙️ **Properties** +- [ ] Properties are declared with `Property` carrier type, do **not** use `@PluginProperty`. +- [ ] Mandatory properties must be annotated with `@NotNull` and checked during the rendering. +- [ ] You can model a JSON thanks to a simple `Property>`. + +🌐 **HTTP** +- [ ] Must use Kestra’s internal HTTP client from `io.kestra.core.http.client` + +📦 **JSON** +- [ ] If you are serializing response from an external API, you may have to add a `@JsonIgnoreProperties(ignoreUnknown = true)` at the mapped class level. So that we will avoid to crash the plugin if the provider add a new field suddenly. +- [ ] Must use Jackson mappers provided by core (`io.kestra.core.serializers`) + +✨ **New plugins / subplugins** +- [ ] Make sure your new plugin is configured like mentioned [here](https://kestra.io/docs/plugin-developer-guide/gradle#mandatory-configuration). +- [ ] Add a `package-info.java` under each sub package respecting [this format](https://github.com/kestra-io/plugin-odoo/blob/main/src/main/java/io/kestra/plugin/odoo/package-info.java) and choosing the right category. +- [ ] Icons added in `src/main/resources/icons` in SVG format and not in thumbnail (keep it big): + - `plugin-icon.svg` + - One icon per package, e.g. `io.kestra.plugin.aws.svg` + - For subpackages, e.g. `io.kestra.plugin.aws.s3`, add `io.kestra.plugin.aws.s3.svg` + See example [here](https://github.com/kestra-io/plugin-elasticsearch/blob/master/src/main/java/io/kestra/plugin/elasticsearch/Search.java#L76). +- [ ] Use `"{{ secret('YOUR_SECRET') }}"` in the examples for sensible infos such as an API KEY. +- [ ] If you are fetching data (one, many or too many), you must add a `Property fetchType` to be able to use `FETCH_ONE`, `FETCH` and even `STORE` to store big amount of data in the internal storage. +- [ ] Align the `"""` to close examples blocks with the flow id. + +🧪 **Tests** +- [ ] Unit Tests added or updated to cover the change (using the `RunContext` to actually run tasks). +- [ ] Add sanity checks if possible with a YAML flow inside `src/test/resources/flows`. +- [ ] Avoid disabling tests for CI. Instead, configure a local environment whenever it's possible with `.github/setup-unit.sh` (which can be executed locally and in the CI) all along with a new `docker-compose-ci.yml` file (do **not** edit the existing `docker-compose.yml`). +- [ ] Provide screenshots from your QA / tests locally in the PR description. The goal here is to use the JAR of the plugin and directly test it locally in Kestra UI to ensure it integrates well. + +📤 **Outputs** +- [ ] Do not send back as outputs the same infos you already have in your properties. +- [ ] If you do not have any output use `VoidOutput`. +- [ ] Do not output twice the same infos (eg: a status code, an error code saying the same thing...). \ No newline at end of file diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5672ab9..715c175 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -27,7 +27,35 @@ on: - "false" jobs: + checklist: + runs-on: ubuntu-latest + if: github.event_name == 'pull_request' && github.repository != 'kestra-io/plugin-template' + steps: + - name: Verify PR checklist + uses: actions/github-script@v7 + with: + script: | + const org = "kestra-io"; + const username = context.payload.pull_request.user.login; + + try { + await github.rest.orgs.checkMembershipForUser({ org, username }); + core.info(`User ${username} is a member of ${org}, skipping checklist validation.`); + return; + } catch (e) { + core.info(`User ${username} is not in ${org}, checklist validation required.`); + } + + const body = context.payload.pull_request.body || ""; + const unchecked = body.match(/- +\[ +\]/g); + if (unchecked) { + core.setFailed("Some checklist items are still unchecked. Please complete them."); + } else { + core.info("All checklist items are checked."); + } + check: + needs: checklist uses: kestra-io/actions/.github/workflows/plugins.yml@main with: skip-test: ${{ github.event.inputs.skip-test == 'true' }}