Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DevEx]: Move all testing-specific endpoints into the TestController #425

Open
itsalaidbacklife opened this issue May 28, 2023 · 0 comments
Labels
dev experience Improvements to the code base that make it easier/better/more enjoyable to contribute to Cuttle good first issue Good for newcomers version-patch An update that warrants a bumping the project's patch version (e.g. 4.0.0 => 4.0.1)

Comments

@itsalaidbacklife
Copy link
Contributor

Improvement Summary

Currently some of the testing-specific endpoints (the ones only allowed during development or staging) are in the TestController, and some are in the api/controllers/game folder. We should consolidate all of them into the TestController for consistency and simplicity.

Detailed Description

We should take all of the backend actions/endpoints which have the 'developmentOrStagingOnly' policy applied to them in config/policies.js and move them into api/controllers/TestController. While we are at it, we should update the urls to be more consistent and remove unnecessary testing-specific endpoints. For the unnecessary endpoints we should delete the files in api/controllers/game/<unnecessary_endpoint_name>.js, the policy mapping in config/policies.js, and the route mapping in config/routes.js

In particular:

  1. game/stackDeck is no longer used and can be deleted
  2. game/clear is no longer used and can be deleted
  3. /game/loadGameFixture should be remapped to /test/loadGameFixture in config/routes.js and the corresponding endpoint file should be moved from api/controllers/game/load-fixturetoapi/test/load-game-fixture.js`
@itsalaidbacklife itsalaidbacklife added good first issue Good for newcomers dev experience Improvements to the code base that make it easier/better/more enjoyable to contribute to Cuttle version-patch An update that warrants a bumping the project's patch version (e.g. 4.0.0 => 4.0.1) labels May 28, 2023
BrandonCarp added a commit to BrandonCarp/cuttle that referenced this issue Sep 1, 2023
BrandonCarp added a commit to BrandonCarp/cuttle that referenced this issue Sep 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dev experience Improvements to the code base that make it easier/better/more enjoyable to contribute to Cuttle good first issue Good for newcomers version-patch An update that warrants a bumping the project's patch version (e.g. 4.0.0 => 4.0.1)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant