strapi/CONTRIBUTING.md

245 lines
10 KiB
Markdown
Raw Normal View History

# Contribute to Strapi
2016-03-18 11:12:50 +01:00
Strapi is an open-source project administered by [the Strapi team](https://strapi.io/about-us). We appreciate your interest and efforts to contribute to Strapi. See the [LICENSE](https://github.com/strapi/strapi/blob/main/LICENSE) licensing information. All work done is available on GitHub.
2016-03-18 11:12:50 +01:00
We highly appreciate your effort to contribute, but we recommend you talk to a maintainer before spending a lot of time making a pull request that may not align with the project roadmap. Whether it is from Strapi or contributors, every pull request goes through the same process.
2017-12-13 12:21:16 +01:00
2019-05-28 15:33:07 +02:00
## Feature Requests
Feature Requests by the community are highly encouraged. Feel free to submit a new one or upvote an existing feature request on [feedback.strapi.io](https://feedback.strapi.io/).
2017-12-13 12:21:16 +01:00
2022-02-04 11:19:40 +01:00
## Request For Comments (RFC)
Larger chunks of changes to Strapi that might affect many users require a thorough design phase before starting working on a PR. We will do our best to respond as soon as possible, but since we need to discuss these proposals thoroughly, please do not expect them to be merged and accepted immediately.
The Request For Comments process will help us create consensus among the core team and include as much feedback as possible from the community for these upcoming changes.
A Request For Comments has to be created on the [strapi/rfcs](https://github.com/strapi/rfcs) repository.
2019-05-27 18:57:24 +02:00
## Code of Conduct
2017-12-13 12:21:16 +01:00
This project, and everyone participating in it, are governed by the [Strapi Code of Conduct](CODE_OF_CONDUCT.md). By participating, you are expected to uphold it. Make sure to read the [full text](CODE_OF_CONDUCT.md) to understand which type of actions may or may not be tolerated.
2017-12-13 12:21:16 +01:00
## Contributor License Agreement (CLA)
2022-02-04 11:19:40 +01:00
### Individual contribution
You need to sign a Contributor License Agreement (CLA) to accept your pull request. You only need to do this once. If you submit a pull request for the first time, you can complete your CLA [here](https://cla.strapi.io/strapi/strapi), or our CLA bot will automatically ask you to sign before merging the pull request.
2022-02-04 11:19:40 +01:00
### Company contribution
If you make contributions to our repositories on behalf of your company, we will need a Corporate Contributor License Agreement (CLA) signed. To do that, please get in touch with us at [contributions@strapi.io](mailto:contributions@strapi.io).
## Documentation
2022-02-04 11:19:40 +01:00
Pull requests related to fixing documentation for the latest release should be directed towards the [documentation repository](https://github.com/strapi/documentation). Please follow the [documentation contributing guide](https://github.com/strapi/documentation/blob/main/CONTRIBUTING.md) for more information.
2019-05-27 18:57:24 +02:00
## Bugs
2017-12-13 12:21:16 +01:00
Strapi is using [GitHub issues](https://github.com/strapi/strapi/issues) to manage bugs. We keep a close eye on them. Before filing a new issue, try to ensure your problem does not already exist.
2017-12-13 12:21:16 +01:00
2019-05-27 18:57:24 +02:00
---
2019-05-27 18:57:24 +02:00
## Before Submitting a Pull Request
2017-12-13 12:21:16 +01:00
The Strapi core team will review your pull request and either merge it, request changes, or close it.
2022-02-04 11:19:40 +01:00
## Contribution Prerequisites
2024-03-29 18:02:40 +01:00
- You have [Node.js](https://nodejs.org/en/) at version `>= v18 and <= v20` and [Yarn](https://yarnpkg.com/en/) at v1.2.0+ installed.
2022-02-04 11:19:40 +01:00
- You are familiar with [Git](https://git-scm.com).
2017-12-13 12:21:16 +01:00
2019-05-27 20:28:15 +02:00
**Before submitting your pull request** make sure the following requirements are fulfilled:
2017-12-13 12:21:16 +01:00
- Fork the repository and create your new branch from `develop`.
- Run `yarn install` in the root of the repository.
2022-01-31 09:36:03 +01:00
- Run `yarn setup` in the root of the repository.
- If you've fixed a bug or added code that should be tested, please make sure to add tests
2022-02-04 11:19:40 +01:00
- Ensure the following test suites are passing:
2019-05-27 18:57:24 +02:00
- `yarn test:unit`
- `yarn test:front`
- `yarn test:e2e --setup --concurrency=1`
- you **_may_** need to install Playwright browsers first: `yarn playwright install`
2022-02-04 11:19:40 +01:00
- Make sure your code lints by running `yarn lint`.
2022-01-31 09:36:03 +01:00
- If your contribution fixes an existing issue, please make sure to link it in your pull request.
2018-05-04 12:44:15 +02:00
2019-05-27 18:57:24 +02:00
## Development Workflow
2017-12-13 12:21:16 +01:00
2022-02-04 11:19:40 +01:00
### 1. Fork the [repository](https://github.com/strapi/strapi)
2019-05-27 18:57:24 +02:00
2022-01-31 09:36:03 +01:00
[Go to the repository](https://github.com/strapi/strapi) and fork it using your own GitHub account.
2019-05-27 18:57:24 +02:00
2022-02-04 11:19:40 +01:00
### 2. Clone your repository
2018-08-08 14:30:40 +02:00
```bash
2019-05-27 18:57:24 +02:00
git clone git@github.com:YOUR_USERNAME/strapi.git
2018-08-08 14:30:40 +02:00
```
2022-02-04 11:19:40 +01:00
### 3. Install the dependencies
2018-08-08 14:30:40 +02:00
2022-02-04 11:19:40 +01:00
Go to the root of the repository and run the setup:
2018-08-08 14:30:40 +02:00
```bash
2022-01-31 09:36:03 +01:00
cd strapi
2023-04-24 09:11:27 +02:00
yarn install
2022-01-31 09:36:03 +01:00
yarn setup
2018-08-08 14:30:40 +02:00
```
2022-02-04 11:19:40 +01:00
### 4. Start the example application
2018-08-08 14:30:40 +02:00
```bash
2022-01-31 09:36:03 +01:00
cd ./examples/getstarted
yarn develop
```
2022-11-09 09:51:23 +01:00
Make sure to read the [`getstarted` application README](https://github.com/strapi/strapi/blob/main/examples/getstarted/README.md) for more details.
2018-08-08 14:30:40 +02:00
2022-02-04 11:19:40 +01:00
### 5. Running the administration panel in development mode
2018-08-08 14:30:40 +02:00
2022-01-31 09:36:03 +01:00
Start the administration panel server for development:
2019-05-27 18:57:24 +02:00
2018-08-08 14:30:40 +02:00
```bash
2022-01-31 09:36:03 +01:00
cd ./packages/core/admin
2024-03-29 16:51:22 +01:00
yarn watch
2018-08-08 14:30:40 +02:00
```
chore: merge develop into v5 main (#21108) * cron type fix * Fix typo of query key from 'providers' to 'get-providers' * Closing #19644 fix filters type * node-scadule updated + types updated * Fix formating errors * fix formatting * update lock file * fix patreon oauth 400 error from lack of user-agent header * test: backport cli tests (#20433) * fix(chore): increase specificity of the Lightning icon color (#20467) * test: temporarily disable broken edit ctb tests on CI (#20481) * feat(cli): cloud cli commands (v4) (#20119) * feat(cli): add cloud commands Co-authored-by: Gonzalo Garcia <nouvellegon@gmail.com> Co-authored-by: nathan-pichon <nathan.pichon@strapi.io> Co-authored-by: Abdallah M <55534657+abdallahmz@users.noreply.github.com> * v4.25.0 (#20500) * NPS: Update frequency of the NPS (#20492) * enhancement(admin): change postFirstDismissal and display delays * enhancement(admin): change the display delay * fix: prevent use of local ips on webhooks (#20487) * chore: mask error on webhook manual trigger * feat: prevent using local ips * feat: display webhook edit error * chore: pr suggestion * chore: api tests * chore: allow local ips on development * chore: only run check on production * feat: include internationalized urls * fix: prettier * Add: Strapi deploy command to README files * v4.25.1 * Update @aws-sdk/client-s3 package * feat(cli): add browser logout step (#20502) * feat(cli): add browser log out step * handle error whiile fetching the config * Update LICENSE packing for packages for v4 (#20576) * feat(create-strapi-app): remove the cloud project creation part (#20561) * feat(create-strapi-app): remove the cloud project creation part * fix(create-strapi-app): adding new parameter to cloud service instantiation * Update Yarn to 4.3.1 Signed-off-by: Sora Morimoto <sora@morimoto.io> * feat(cli): trigger login sequence when token is missing or invalid (#20572) * feat(cli): launch login when auth fails * fix(cli): abstract create project fn * fix(cli): guidelines * fix(cli): rebase --------- Co-authored-by: Gonzalo Andres Garcia <nouvellegon@gmail.com> * fix clone entity, #20509 (#20531) * chore: bump glob from 7.2.0 to 9.0.0 * chore: bump glob to v10.4.2 in core/strapi * update yarn.lock * removed redundant packages/core/strapi/src/load/glob.ts file * v4.25.2 to main (#20676) * Fix typo of query key from 'providers' to 'get-providers' * Closing #19644 fix filters type * fix patreon oauth 400 error from lack of user-agent header * Add: Strapi deploy command to README files * Update @aws-sdk/client-s3 package * feat(cli): add browser logout step (#20502) * feat(cli): add browser log out step * handle error whiile fetching the config * Update LICENSE packing for packages for v4 (#20576) * feat(create-strapi-app): remove the cloud project creation part (#20561) * feat(create-strapi-app): remove the cloud project creation part * fix(create-strapi-app): adding new parameter to cloud service instantiation * Update Yarn to 4.3.1 Signed-off-by: Sora Morimoto <sora@morimoto.io> * feat(cli): trigger login sequence when token is missing or invalid (#20572) * feat(cli): launch login when auth fails * fix(cli): abstract create project fn * fix(cli): guidelines * fix(cli): rebase --------- Co-authored-by: Gonzalo Andres Garcia <nouvellegon@gmail.com> * fix: support string array * fix clone entity, #20509 (#20531) * v4.25.2 --------- Signed-off-by: Sora Morimoto <sora@morimoto.io> Co-authored-by: smoothdvd <madfxgao@gmail.com> Co-authored-by: Micah Riggan <micahriggan@gmail.com> Co-authored-by: Tewson Seeoun <tewson.seeoun@gmail.com> Co-authored-by: Maxime Castres <mcastres@student.42.fr> Co-authored-by: Alex Supkay <asupkay1124@gmail.com> Co-authored-by: Alexandre BODIN <alexandrebodin@users.noreply.github.com> Co-authored-by: Abdallah M <55534657+abdallahmz@users.noreply.github.com> Co-authored-by: Jean-Sébastien Herbaux <jean-sebastien.herbaux@epitech.eu> Co-authored-by: Nathan Pichon <nathan.pichon@strapi.io> Co-authored-by: Sora Morimoto <sora@morimoto.io> Co-authored-by: Gonzalo Andres Garcia <nouvellegon@gmail.com> Co-authored-by: Alexandre Bodin <bodin.alex@gmail.com> Co-authored-by: Kirill Verevkin <kira795@yandex.ru> * v4.25.2 (#20675) * fix: support string array * v4.25.2 --------- Co-authored-by: Alexandre Bodin <bodin.alex@gmail.com> Co-authored-by: Alexandre BODIN <alexandrebodin@users.noreply.github.com> * feat(cli): use project name from package json by default (#20479) * chore: change cloud message in homepage (#20685) * chore(cloud-cli): migrate to fs-extra (#20695) * feat(cloud-cli): migrate compress-files.ts to fs-extra * feat(cloud-cli): migrate pkg.ts to fs-extra * fix(cloud-cli): update using promises in recursive function * feat(cli): Add projects list command (#20694) * feat(cli): projects list command * fix: updating contributing guide workflow * chore: release v4.25.3 (#20722) * fix: invalid path separator (#20740) * fix: invalid path separator * fix: prettier * v4.25.4 to develop (#20832) * 4.25.4 to main (#20833) * cron type fix * node-scadule updated + types updated * Fix formating errors * fix formatting * update lock file * chore(cloud-cli): migrate to fs-extra (#20695) * feat(cloud-cli): migrate compress-files.ts to fs-extra * feat(cloud-cli): migrate pkg.ts to fs-extra * fix(cloud-cli): update using promises in recursive function * feat(cli): Add projects list command (#20694) * feat(cli): projects list command * fix: invalid path separator (#20740) * fix: invalid path separator * fix: prettier * v4.25.4 --------- Co-authored-by: Boegie19 <34578426+Boegie19@users.noreply.github.com> Co-authored-by: Nathan Pichon <nathan.pichon@strapi.io> Co-authored-by: Gonzalo Andres Garcia <nouvellegon@gmail.com> Co-authored-by: Rémi de Juvigny <8087692+remidej@users.noreply.github.com> Co-authored-by: Alexandre Bodin <bodin.alex@gmail.com> Co-authored-by: Alexandre BODIN <alexandrebodin@users.noreply.github.com> * Chore: Removing some people from the issue auto-assignment Removing Simen and Nick from the array of people issues will be auto-assigned to * fix(cloud-cli): avoid blocking event loop in deploy command (#20850) * chore(cloud-cli): update error handling for config and logs at the ends of function execution * fix(cloud-cli): clear timeout before returning - free the event loop from waiting * feat(cli): add project link command to cloud cli (#20714) * feat(cli): add link command * 4.25.5 to main (#20873) * cron type fix * node-scadule updated + types updated * Fix formating errors * fix formatting * update lock file * chore(cloud-cli): migrate to fs-extra (#20695) * feat(cloud-cli): migrate compress-files.ts to fs-extra * feat(cloud-cli): migrate pkg.ts to fs-extra * fix(cloud-cli): update using promises in recursive function * feat(cli): Add projects list command (#20694) * feat(cli): projects list command * fix: updating contributing guide workflow * fix: invalid path separator (#20740) * fix: invalid path separator * fix: prettier * v4.25.4 to develop (#20832) * Chore: Removing some people from the issue auto-assignment Removing Simen and Nick from the array of people issues will be auto-assigned to * fix(cloud-cli): avoid blocking event loop in deploy command (#20850) * chore(cloud-cli): update error handling for config and logs at the ends of function execution * fix(cloud-cli): clear timeout before returning - free the event loop from waiting * feat(cli): add project link command to cloud cli (#20714) * feat(cli): add link command * v4.25.5 --------- Co-authored-by: Boegie19 <34578426+Boegie19@users.noreply.github.com> Co-authored-by: Nathan Pichon <nathan.pichon@strapi.io> Co-authored-by: Gonzalo Andres Garcia <nouvellegon@gmail.com> Co-authored-by: José Luis <alagunasalahaddin@live.com> Co-authored-by: Rémi de Juvigny <8087692+remidej@users.noreply.github.com> Co-authored-by: Alexandre Bodin <bodin.alex@gmail.com> Co-authored-by: Alexandre BODIN <alexandrebodin@users.noreply.github.com> Co-authored-by: DMehaffy <derrickmehaffy@gmail.com> * v4.25.5 to develop (#20872) * 4.25.4 to main (#20833) * cron type fix * node-scadule updated + types updated * Fix formating errors * fix formatting * update lock file * chore(cloud-cli): migrate to fs-extra (#20695) * feat(cloud-cli): migrate compress-files.ts to fs-extra * feat(cloud-cli): migrate pkg.ts to fs-extra * fix(cloud-cli): update using promises in recursive function * feat(cli): Add projects list command (#20694) * feat(cli): projects list command * fix: invalid path separator (#20740) * fix: invalid path separator * fix: prettier * v4.25.4 --------- Co-authored-by: Boegie19 <34578426+Boegie19@users.noreply.github.com> Co-authored-by: Nathan Pichon <nathan.pichon@strapi.io> Co-authored-by: Gonzalo Andres Garcia <nouvellegon@gmail.com> Co-authored-by: Rémi de Juvigny <8087692+remidej@users.noreply.github.com> Co-authored-by: Alexandre Bodin <bodin.alex@gmail.com> Co-authored-by: Alexandre BODIN <alexandrebodin@users.noreply.github.com> * v4.25.5 --------- Co-authored-by: Rémi de Juvigny <8087692+remidej@users.noreply.github.com> Co-authored-by: Boegie19 <34578426+Boegie19@users.noreply.github.com> Co-authored-by: Nathan Pichon <nathan.pichon@strapi.io> Co-authored-by: Gonzalo Andres Garcia <nouvellegon@gmail.com> Co-authored-by: Alexandre Bodin <bodin.alex@gmail.com> Co-authored-by: Alexandre BODIN <alexandrebodin@users.noreply.github.com> * fix custom email provider test issue #19122 (#19123) * fix custom email provider test issue #19122 * chore(email): prettier clean up --------- Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * Changed Discord username to fit change Discord made. * v4.25.6 * fix(cli): Update 'project not found' error message in deploy command (#20923) * chore: aggregate test result to add a single required status check and make it dynamic * shard ee tests+ fix broken platform (#20914) * v4.25.7 * RBAC Action Aliases - v4 (#20954) * test(cli): add list command tests (#20949) * feat(cloud-cli): preselect node-version based on local node-version (#20959) * [Fix] Validate cloning as entity creation so field validations aren't skipped e.g. unique constraints (#20963) * flatten CI workflow tests (#20969) * v4.25.8 release to develop (#21011) * Removing workflows the support team doesn't need anymore * chore: getstarted schema sync between v4-v5 (#21047) * Chore(CLI): Add validation to prevent deployment of suspended projects (#20976) * chore(cli): check project suspension * Prettier fix * chore(deps): update axios to 1.7.4 (#21014) * fix(cli): Update endpoint path for listLinkProjects (#21052) * chore: update lint-staged to 15.2.9 (#21075) * v4.25.9 * fix: issue 21079 * fix: rich text selection & deletion issues * fix: build * fix: type * fix: skip failing cli tests * chore: fix jest options in ci --------- Signed-off-by: Sora Morimoto <sora@morimoto.io> Co-authored-by: Boegie19 <34578426+Boegie19@users.noreply.github.com> Co-authored-by: smoothdvd <madfxgao@gmail.com> Co-authored-by: Micah Riggan <micahriggan@gmail.com> Co-authored-by: Tewson Seeoun <tewson.seeoun@gmail.com> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> Co-authored-by: Simone <startae14@gmail.com> Co-authored-by: Nathan Pichon <nathan.pichon@strapi.io> Co-authored-by: Gonzalo Garcia <nouvellegon@gmail.com> Co-authored-by: Abdallah M <55534657+abdallahmz@users.noreply.github.com> Co-authored-by: Maxime Castres <mcastres@student.42.fr> Co-authored-by: Convly <jean-sebastien.herbaux@epitech.eu> Co-authored-by: Alex Supkay <asupkay1124@gmail.com> Co-authored-by: Alexandre BODIN <alexandrebodin@users.noreply.github.com> Co-authored-by: Sora Morimoto <sora@morimoto.io> Co-authored-by: Alexandre Bodin <bodin.alex@gmail.com> Co-authored-by: Kirill Verevkin <kira795@yandex.ru> Co-authored-by: chrismuiruriz <chrismuiruri007@gmail.com> Co-authored-by: José Luis <alagunasalahaddin@live.com> Co-authored-by: Rémi de Juvigny <8087692+remidej@users.noreply.github.com> Co-authored-by: Rémi de Juvigny <remi.dejuvigny@strapi.io> Co-authored-by: DMehaffy <derrickmehaffy@gmail.com> Co-authored-by: ahallaha <104538552+ahallaha@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: mallowsc <mallowsc@outlook.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: mallowsc <96073136+mallowsc@users.noreply.github.com> Co-authored-by: Olli Hiekkaranta <Ohiekkar@users.noreply.github.com>
2024-09-02 14:31:01 +02:00
Run the example application but watching the admin panel:
```bash
cd ./examples/getstarted
yarn develop --watch-admin
```
Both commands must be running at same time; now you will be able to see the admin panel changes on the application example.
2018-08-08 14:30:40 +02:00
**Awesome! You are now able to contribute to Strapi.**
2022-02-04 11:19:40 +01:00
### 6. Available commands
2019-05-27 18:57:24 +02:00
- `yarn watch` starts yarn watch in all packages.
- `yarn build` builds the `strapi-helper-plugin` (use this command when you develop in the administration panel).
- `yarn commit` runs an interactive commit CLI to help you write a good commit message inline with our git conventions.
2022-01-31 09:36:03 +01:00
- `yarn setup` installs dependencies.
2019-05-27 18:57:24 +02:00
- `yarn lint` lints the codebase.
2022-01-31 09:36:03 +01:00
- `yarn test:clean` removes the coverage reports.
- `yarn test:front` runs front-end related tests.
2019-05-27 18:57:24 +02:00
- `yarn test:front:watch` runs an interactive test watcher for the front-end.
- `yarn test:unit` runs the back-end unit tests.
2022-11-07 16:30:12 +01:00
- `yarn test:api` runs the api integration tests.
2019-05-27 18:57:24 +02:00
- `yarn test:generate-app` generates a test application.
test: add e2e tooling Remove old cypress related files Update config and reorg tests Run test app before running playwright tests feat: add beginning of authentication test feat: add app template with database dumping ability chore: pr amends Run test app before running playwright tests feat: add beginning of authentication test feat: add app template with database dumping ability chore: pr amends init deits fix: e2e test chore: rename to e2e chore: commit tar for data Init playwright Run test app before running playwright tests feat: add beginning of authentication test feat: add app template with database dumping ability chore: pr amends chore: remove unneeded workflow fix: add private: true to the template so `test-apps` aren't published docs: add docs chore: add warning about DTS caveats chore: tweak docs docs(e2e): add correct route to api example for template chore: fix package.json tests chore: update from feature/DEITS chore: updates from DTS chore: update data-transfer Update yarn.lock fix: remove duplicate type chore(e2e): set up folder structure fix(e2e): avoid clearing 'admin_' DB tables through DTS or DB Dump feat(e2e): DTS scripts and backup files add route to change rate limit fix wront appPath for API test in CI no template by default when creating a test app Fix typo double equal fix template path for e2e tests chore(e2e): fix broken signup spec feat(e2e): basic logout test spec Login e2e tests globalSetup attempt use withAdmin backup cleanup fix playwright config & rate limit test remove example.spec.js refactor and merge some login tests Chore: Cleanup login and signup specs feat(e2e): sign up password error cases feat(e2e): add homepage expectation to signup spec refactor(e2e) refactor(e2e): signUp refactor(e2e): use global login util for logout and logins specs Init playwright fix: remove duplicate type chore: uncomment transfer route registering Update yarn.lock chore: update data-transfer chore: updates from DTS chore: update from feature/DEITS chore: fix package.json tests docs(e2e): add correct route to api example for template chore: tweak docs chore: add warning about DTS caveats docs: add docs fix: add private: true to the template so `test-apps` aren't published chore: remove unneeded workflow chore: pr amends feat: add app template with database dumping ability feat: add beginning of authentication test Run test app before running playwright tests Init playwright chore: commit tar for data chore: rename to e2e fix: e2e test init deits chore: pr amends feat: add app template with database dumping ability feat: add beginning of authentication test Run test app before running playwright tests chore: pr amends feat: add app template with database dumping ability feat: add beginning of authentication test Run test app before running playwright tests Update config and reorg tests Remove old cypress related files chore(e2e): cleanup e2e dir chore(docs): improve e2e testing documentation chore(docs): PR feedback chore: tweak action to run browsers in matrix & build packages chore: fix tests based on merge chore: shuffle e2e tests and add first conent-type fix: tests Make use of yarn linking for api & e2e tests Chore: Fix running backend unit tests Chore: Bring opts.run back Chore: Update playwright Chore: Update Playwright setup fix: workflow chore: fix path to package.json chore: build ts projects before tests chore: update e2e workflow chore: add no-immutable Use simpler transfer token to avoid misinterpretation Remove console.log Ensure that the custom transfer token exists in the e2e test app's database upon startup Use the custom transfer token for transferring data to the e2e test app Fix code analysis warning Define and export a constant for the custom transfer token Allow passing a custom access key for the transfer token service chore: add test-apps to workspace chore: update lockfile Co-Authored-By: Josh <37798644+joshuaellis@users.noreply.github.com> Co-Authored-By: Gustav Hansen <gu@stav.dev> Co-Authored-By: Alexandre BODIN <alexandrebodin@users.noreply.github.com> Co-Authored-By: Jean-Sébastien Herbaux <25851739+Convly@users.noreply.github.com>
2022-10-28 09:35:21 +02:00
- `yarn test:run-app` runs a test application.
2019-05-27 18:57:24 +02:00
- `yarn test:start-app` starts the test application.
2018-08-08 14:30:40 +02:00
---
2017-12-13 12:21:16 +01:00
## Running the API Integration tests
2021-11-29 18:46:14 +01:00
The API integration tests require a Strapi app to be able to run. You can generate a "test app" using `yarn test:generate-app <database>`:
2021-11-29 18:46:14 +01:00
```bash
test: add e2e tooling Remove old cypress related files Update config and reorg tests Run test app before running playwright tests feat: add beginning of authentication test feat: add app template with database dumping ability chore: pr amends Run test app before running playwright tests feat: add beginning of authentication test feat: add app template with database dumping ability chore: pr amends init deits fix: e2e test chore: rename to e2e chore: commit tar for data Init playwright Run test app before running playwright tests feat: add beginning of authentication test feat: add app template with database dumping ability chore: pr amends chore: remove unneeded workflow fix: add private: true to the template so `test-apps` aren't published docs: add docs chore: add warning about DTS caveats chore: tweak docs docs(e2e): add correct route to api example for template chore: fix package.json tests chore: update from feature/DEITS chore: updates from DTS chore: update data-transfer Update yarn.lock fix: remove duplicate type chore(e2e): set up folder structure fix(e2e): avoid clearing 'admin_' DB tables through DTS or DB Dump feat(e2e): DTS scripts and backup files add route to change rate limit fix wront appPath for API test in CI no template by default when creating a test app Fix typo double equal fix template path for e2e tests chore(e2e): fix broken signup spec feat(e2e): basic logout test spec Login e2e tests globalSetup attempt use withAdmin backup cleanup fix playwright config & rate limit test remove example.spec.js refactor and merge some login tests Chore: Cleanup login and signup specs feat(e2e): sign up password error cases feat(e2e): add homepage expectation to signup spec refactor(e2e) refactor(e2e): signUp refactor(e2e): use global login util for logout and logins specs Init playwright fix: remove duplicate type chore: uncomment transfer route registering Update yarn.lock chore: update data-transfer chore: updates from DTS chore: update from feature/DEITS chore: fix package.json tests docs(e2e): add correct route to api example for template chore: tweak docs chore: add warning about DTS caveats docs: add docs fix: add private: true to the template so `test-apps` aren't published chore: remove unneeded workflow chore: pr amends feat: add app template with database dumping ability feat: add beginning of authentication test Run test app before running playwright tests Init playwright chore: commit tar for data chore: rename to e2e fix: e2e test init deits chore: pr amends feat: add app template with database dumping ability feat: add beginning of authentication test Run test app before running playwright tests chore: pr amends feat: add app template with database dumping ability feat: add beginning of authentication test Run test app before running playwright tests Update config and reorg tests Remove old cypress related files chore(e2e): cleanup e2e dir chore(docs): improve e2e testing documentation chore(docs): PR feedback chore: tweak action to run browsers in matrix & build packages chore: fix tests based on merge chore: shuffle e2e tests and add first conent-type fix: tests Make use of yarn linking for api & e2e tests Chore: Fix running backend unit tests Chore: Bring opts.run back Chore: Update playwright Chore: Update Playwright setup fix: workflow chore: fix path to package.json chore: build ts projects before tests chore: update e2e workflow chore: add no-immutable Use simpler transfer token to avoid misinterpretation Remove console.log Ensure that the custom transfer token exists in the e2e test app's database upon startup Use the custom transfer token for transferring data to the e2e test app Fix code analysis warning Define and export a constant for the custom transfer token Allow passing a custom access key for the transfer token service chore: add test-apps to workspace chore: update lockfile Co-Authored-By: Josh <37798644+joshuaellis@users.noreply.github.com> Co-Authored-By: Gustav Hansen <gu@stav.dev> Co-Authored-By: Alexandre BODIN <alexandrebodin@users.noreply.github.com> Co-Authored-By: Jean-Sébastien Herbaux <25851739+Convly@users.noreply.github.com>
2022-10-28 09:35:21 +02:00
$ yarn test:generate-app --db=sqlite
$ yarn test:generate-app --db=postgres
$ yarn test:generate-app --db=mysql
2021-11-29 18:46:14 +01:00
```
2022-11-08 10:11:56 +01:00
A new app is required every time you run the API integration tests, otherwise the test suite will fail. A command is available to make this process easier: `yarn test:api`.
2022-11-08 10:11:56 +01:00
This command runs tests using jest behind the scenes. Options for jest can be passed to the command. (e.g. to update snapshots `yarn test:api -u`).
2022-02-04 11:19:40 +01:00
### Changing the database
2023-07-23 16:59:37 +05:30
By default the script run by `test:api` generates an app that uses `sqlite` as a database. But you can run the test suites using different databases:
2019-05-28 15:33:07 +02:00
```bash
$ yarn test:api --db=sqlite
$ yarn test:api --db=postgres
$ yarn test:api --db=mysql
```
2022-11-25 18:37:53 +08:00
### Running the tests for the Enterprise Edition (EE)
2021-11-29 18:46:14 +01:00
The test suites run the tests for the Community Edition (CE) version of Strapi by default.
In order to run the Enterprise Edition tests you need a valid license. To specify a license, you can use the environment variable `STRAPI_LICENSE`:
2021-11-29 18:46:14 +01:00
```bash
$ STRAPI_LICENSE=<license> yarn test:api
2021-11-29 18:46:14 +01:00
```
2019-05-27 18:57:24 +02:00
---
## Git Conventions
### Commit messages
We use the following convention:
```
type: subject
body
```
The goal of this convention is to help us generate changelogs that can be communicated to our users.
#### Type
The types are based on our GitHub label, here are a subset:
- `fix` When fixing an issue.
- `chore` When doing some cleanup, working on tooling, some refactoring. (usually reserved for **internal** work)
- `doc` When writing documentation.
- `feat` When working on a feature.
You can see the complete list [here](https://github.com/strapi/strapi/blob/1cb6f95889ccaad897759cfa14d2804adeaeb7ee/.commitlintrc.ts#L11).
#### Subject
The subject of a commit should be a summary of what the commit is about. It should not describe what the code is doing:
- `feat: what the feature is`
- `fix: what the problem is`
- `chore: what the PR is about`
- `doc: what is documented`
Examples:
- `feat: introduce document service`
- `fix: unable to publish documents due to missing permissions`
- `chore: refactor data-fetching in EditView to use react-query`
- `doc: document service API reference`
> ⚠️ For a `fix` commit the message should explain what the commit is fixing. Not what the solution is.
---
2019-05-28 15:33:07 +02:00
## Miscellaneous
2019-05-27 18:57:24 +02:00
### Repository Organization
We chose to use a monorepo design using [Yarn Workspaces](https://yarnpkg.com/en/docs/workspaces) in the way [React](https://github.com/facebook/react/tree/master/packages) or [Babel](https://github.com/babel/babel/tree/master/packages) does. This allows us to maintain the whole ecosystem keep it up-to-date and consistent.
We do our best to keep the develop branch as clean as possible, with tests passing at all times. However, the develop branch can move faster than the release cycle. Therefore check the [releases on npm](https://www.npmjs.com/package/@strapi/strapi) so that you are always up-to-date with the latest stable version.
2019-05-27 18:57:24 +02:00
### Reporting an issue
2016-03-18 11:12:50 +01:00
2019-05-28 15:33:07 +02:00
Before submitting an issue you need to make sure:
2019-05-27 18:57:24 +02:00
2022-01-31 09:36:03 +01:00
- You are experiencing a technical issue with Strapi.
- You have already searched for related [issues](https://github.com/strapi/strapi/issues) and found none open (if you found a related _closed_ issue, please link to it from your post).
- You are not asking a question about how to use Strapi or about whether Strapi has a certain feature. For general help using Strapi, you may:
2022-02-04 11:19:40 +01:00
- Refer to the [official Strapi documentation](https://docs.strapi.io).
- Ask a member of the community in the [Strapi Discord Community](https://discord.strapi.io/).
2022-02-04 11:19:40 +01:00
- Ask a question on the [Strapi community forum](https://forum.strapi.io).
- Your issue title is concise, on-topic, and polite.
2022-02-04 11:19:40 +01:00
- You provide steps to reproduce the issue.
- You have tried all the following (if relevant), and your issue remains:
2016-03-18 11:12:50 +01:00
- Make sure you have the right application started.
2022-11-09 09:51:23 +01:00
- Make sure the [issue template] is respected.
- Make sure your issue body is readable and [well formatted](https://guides.github.com/features/mastering-markdown).
2022-02-04 11:19:40 +01:00
- Make sure you've stopped the Strapi server with CTRL+C and restarted it.
- Make sure your application has a clean `node_modules` directory, meaning:
- you didn't link any dependencies (e.g., by running `yarn link`)
2022-02-04 11:19:40 +01:00
- you haven't made any inline changes to files in the `node_modules` directory
- you don't have any global dependency loops. If you aren't sure, the easiest way to double-check any of the above is to run: `$ rm -rf node_modules && yarn cache clean && yarn install && yarn setup`.