QPlan issueshttps://code.engineering.queensu.ca/14CDWC/qplan/-/issues2020-12-31T02:54:29Zhttps://code.engineering.queensu.ca/14CDWC/qplan/-/issues/111Enhance mocker2020-12-31T02:54:29ZCarson Cook (14CDWC)carson.cook@queensu.caEnhance mocker- spin off into own npm module
- have a `mock` function that takes a module and returns a mocked version of it
- make `restore` function unneeded by only returning the mocked object and not other parts of it
- have a `mock` function that...- spin off into own npm module
- have a `mock` function that takes a module and returns a mocked version of it
- make `restore` function unneeded by only returning the mocked object and not other parts of it
- have a `mock` function that mocks a module without returning it and affecting all instances of it - may need `restore` for this like current behaviour, but ideally not
- reduce object bloat with the `copy_for_mock` fields, don't have them in the object. These are only needed if `restore` is needed.
- change the `verifyCalled` function to not need a `resetVerifier` call
- introduce spyinghttps://code.engineering.queensu.ca/14CDWC/qplan/-/issues/109Use own db connection and utilities in integration tests2020-12-31T18:34:23ZCarson Cook (14CDWC)carson.cook@queensu.caUse own db connection and utilities in integration testsWrite own db util that gets injected for integration tests. This can have the appropriate db connection set within it. This will remove the need for an exposed raw query in `dbUtil.js` by adding a new database and creating its schema.
T...Write own db util that gets injected for integration tests. This can have the appropriate db connection set within it. This will remove the need for an exposed raw query in `dbUtil.js` by adding a new database and creating its schema.
This should also remove the need for multiple sql statements in the connectionhttps://code.engineering.queensu.ca/14CDWC/qplan/-/issues/104Test for memory leaks2021-01-03T18:13:06ZCarson Cook (14CDWC)carson.cook@queensu.caTest for memory leaksTest memory – gauge memory usage and leaks as part your development flow, tools such as ‘memwatch’ can greatly facilitate this task
Part of performance testing suite would be to use memwatch npm package and watch for stats, failing when...Test memory – gauge memory usage and leaks as part your development flow, tools such as ‘memwatch’ can greatly facilitate this task
Part of performance testing suite would be to use memwatch npm package and watch for stats, failing when necessary. Maybe profile front end as well?https://code.engineering.queensu.ca/14CDWC/qplan/-/issues/102Remove inter-dependency between integration tests2020-12-30T15:31:50ZCarson Cook (14CDWC)carson.cook@queensu.caRemove inter-dependency between integration testsIntegration tests currently rely on previous/later tests to add/remove data. This should be done directly in the dependent test to isolate tests.Integration tests currently rely on previous/later tests to add/remove data. This should be done directly in the dependent test to isolate tests.https://code.engineering.queensu.ca/14CDWC/qplan/-/issues/99Enhance model validation2020-12-30T17:03:29ZCarson Cook (14CDWC)carson.cook@queensu.caEnhance model validationConsider using `Joi` for value validation. Review other options if `Joi` doesn't work.
Consider adding validation as route middleware to fail faster, in addition to within models (for database value validation).
Also consider: https://...Consider using `Joi` for value validation. Review other options if `Joi` doesn't work.
Consider adding validation as route middleware to fail faster, in addition to within models (for database value validation).
Also consider: https://github.com/goldbergyoni/nodebestpractices/blob/master/sections/security/regex.mdhttps://code.engineering.queensu.ca/14CDWC/qplan/-/issues/97Enhance logging2020-12-30T16:38:39ZCarson Cook (14CDWC)carson.cook@queensu.caEnhance logging**What file or files will be changed by the refactor**
`logger.js`
**Describe what changes will be made by the refactor**
Use `log4js` or `pino` instead of `winston`, they are more updated and have better features.
Improve how logs are...**What file or files will be changed by the refactor**
`logger.js`
**Describe what changes will be made by the refactor**
Use `log4js` or `pino` instead of `winston`, they are more updated and have better features.
Improve how logs are done, so that metrics can be scraped more easily. This means adding more info to logs as well as splitting them up more appropriately.
**Describe the benefits of the refactor**
Better crash handling, more performant. Easier to scrape information from.
**Additional context**
*Add any other context or screenshots about the feature request here.*https://code.engineering.queensu.ca/14CDWC/qplan/-/issues/96Document what errors can be thrown by each route2020-12-31T14:37:32ZCarson Cook (14CDWC)carson.cook@queensu.caDocument what errors can be thrown by each route**Is your feature request related to a problem? Please describe.**
Client code should know what errors each route can throw, so they can be handled specifically.
**Describe the solution you'd like**
Have documentation for each route, id...**Is your feature request related to a problem? Please describe.**
Client code should know what errors each route can throw, so they can be handled specifically.
**Describe the solution you'd like**
Have documentation for each route, ideally auto-generated. Could express current doc generator module.
**Describe alternatives you've considered**
Don't document, leave error handling to be general.
**Additional context**
*Add any other context or screenshots about the feature request here.*https://code.engineering.queensu.ca/14CDWC/qplan/-/issues/95Unify configuration2020-12-30T14:42:29ZCarson Cook (14CDWC)carson.cook@queensu.caUnify configuration**What file or files will be changed by the refactor**
Config files not in git
**Describe what changes will be made by the refactor**
Turn them into one `config.json` that has nested objects to separate values out.
Then commit this file...**What file or files will be changed by the refactor**
Config files not in git
**Describe what changes will be made by the refactor**
Turn them into one `config.json` that has nested objects to separate values out.
Then commit this file with dummy values.
In deployment, these values will be overridden by env vars.
**Describe the benefits of the refactor**
One place for config, keeps file and location in git.
**Additional context**
*Add any other context or screenshots about the feature request here.*https://code.engineering.queensu.ca/14CDWC/qplan/-/issues/94Scan dependencies with snyk2020-12-30T14:39:25ZCarson Cook (14CDWC)carson.cook@queensu.caScan dependencies with snyk**Is your feature request related to a problem? Please describe.**
Need to know if dependencies have security problems.
**Describe the solution you'd like**
Scan them with snyk.
**Describe alternatives you've considered**
Use a differe...**Is your feature request related to a problem? Please describe.**
Need to know if dependencies have security problems.
**Describe the solution you'd like**
Scan them with snyk.
**Describe alternatives you've considered**
Use a different tool.
**Additional context**
*Add any other context or screenshots about the feature request here.*https://code.engineering.queensu.ca/14CDWC/qplan/-/issues/93Group back end by components2020-12-31T14:35:37ZCarson Cook (14CDWC)carson.cook@queensu.caGroup back end by components**What file or files will be changed by the refactor**
All Back End files
**Describe what changes will be made by the refactor**
Group files by component rather than type. E.g. make a `courses` directory that has routing, controller and...**What file or files will be changed by the refactor**
All Back End files
**Describe what changes will be made by the refactor**
Group files by component rather than type. E.g. make a `courses` directory that has routing, controller and models, database interaction for courses. With this, only the routing needs to be exposed in `index.js`.
Make a `utility` directory for errors and other utilities.
Keep SQL specific DB handling code in it's own component.
**Describe the benefits of the refactor**
Better architecture, easier to change behaviour as it is all in one place, encapsulates behaviour more, and sets it up for microservices.
**Additional context**
*Add any other context or screenshots about the feature request here.*https://code.engineering.queensu.ca/14CDWC/qplan/-/issues/91Indicate back end errors in UI2020-12-13T20:09:39ZCarson Cook (14CDWC)carson.cook@queensu.caIndicate back end errors in UI**Is your feature request related to a problem? Please describe.**
If a problem in the back end happens that stops data from being returned, the user is given no indication. For example, an error retrieving courses results in no courses ...**Is your feature request related to a problem? Please describe.**
If a problem in the back end happens that stops data from being returned, the user is given no indication. For example, an error retrieving courses results in no courses returned, but it appears there is no visual message telling the user there was a problem.
**Describe the solution you'd like**
A quick pop up saying what happened. This may be implemented in some ways, but doesn't seem to show consistently.
Just need to check the response successful and errors field to send a message.
**Describe alternatives you've considered**
A different kind of message works. Just leaving function as is works, but users may be confused.https://code.engineering.queensu.ca/14CDWC/qplan/-/issues/89Separate all logic from front end2021-01-07T14:36:20ZCarson Cook (14CDWC)carson.cook@queensu.caSeparate all logic from front end**What file or files will be changed by the refactor**
Most front end files, anything that processes data. New API routes will be made.
**Describe what changes will be made by the refactor**
Front end will just output data, anything cur...**What file or files will be changed by the refactor**
Most front end files, anything that processes data. New API routes will be made.
**Describe what changes will be made by the refactor**
Front end will just output data, anything currently processed in front end will be moved to a new back end API.
**Describe the benefits of the refactor**
Separates business logic from front end so its easier to developer and maintain. Should also improve load times.https://code.engineering.queensu.ca/14CDWC/qplan/-/issues/88Improve structure of request bodies2020-11-10T01:03:48ZCarson Cook (14CDWC)carson.cook@queensu.caImprove structure of request bodiesRequest body fields have inconsistent naming conventions. There is overlap in names, for example `engSci` and `engineeringSciences` are used in the same way. Other names aren't clear, such as `classType` or `mondayClass`, which are actua...Request body fields have inconsistent naming conventions. There is overlap in names, for example `engSci` and `engineeringSciences` are used in the same way. Other names aren't clear, such as `classType` or `mondayClass`, which are actually file headings for the columns that contain that information.https://code.engineering.queensu.ca/14CDWC/qplan/-/issues/86Front end dependency cycle2020-12-13T19:51:42ZCarson Cook (14CDWC)carson.cook@queensu.caFront end dependency cycle`store.js` requires `router/index.js` and `router/index.js` requires `store.js`. This dependency cycle should be fixed.`store.js` requires `router/index.js` and `router/index.js` requires `store.js`. This dependency cycle should be fixed.https://code.engineering.queensu.ca/14CDWC/qplan/-/issues/84Determine if PUT requests are 200 or 2012020-11-01T03:27:08ZCarson Cook (14CDWC)carson.cook@queensu.caDetermine if PUT requests are 200 or 201Currently use PUT for set operations, which are either create (if doesn't exist) or update. They all return 200 OK, but if a resource was created they should return 201.
This could be done by making new POST routes specifically for crea...Currently use PUT for set operations, which are either create (if doesn't exist) or update. They all return 200 OK, but if a resource was created they should return 201.
This could be done by making new POST routes specifically for creating, and failing the PUT routes if the resource doesn't exist. Alternatively, just PUT routes could be used, but internal logic determines if it is a create or update and sets the return code accordingly.
Any post routes that exist already should return 201 as well.https://code.engineering.queensu.ca/14CDWC/qplan/-/issues/81Improve unit test coverage2020-12-13T19:49:27ZCarson Cook (14CDWC)carson.cook@queensu.caImprove unit test coverageAdd unit tests so branch coverage by nyc can be raised back to 80%.Add unit tests so branch coverage by nyc can be raised back to 80%.https://code.engineering.queensu.ca/14CDWC/qplan/-/issues/80Enhance e2e tests2020-12-12T17:38:15ZCarson Cook (14CDWC)carson.cook@queensu.caEnhance e2e tests**Is your feature request related to a problem? Please describe.**
There is very limited UI testing done, which leads to risk in QPlan not working properly after code changes.
**Describe the solution you'd like**
- [ ] More e2e tests
...**Is your feature request related to a problem? Please describe.**
There is very limited UI testing done, which leads to risk in QPlan not working properly after code changes.
**Describe the solution you'd like**
- [ ] More e2e tests
- [ ] Add linting to the tests
- [ ] Use `baseUrl` in config rather than framework export
- [ ] Set retries number in config
- [ ] Get vue components (sidebars) working - may be `includeShadowDom` in config
- [ ] Try to reduce timeouts and wait time for login - keep server in mind as it is slower
- [ ] Use test db - spin up and upload files
**Describe alternatives you've considered**
Don't test end to end. Could mock back end and test UI that way.https://code.engineering.queensu.ca/14CDWC/qplan/-/issues/79Fix performance tests2020-10-26T03:46:14ZCarson Cook (14CDWC)carson.cook@queensu.caFix performance testsPerformance test suite currently has many issues detailed in the repository.Performance test suite currently has many issues detailed in the repository.https://code.engineering.queensu.ca/14CDWC/qplan/-/issues/78Use docker for Gitlab CI2020-10-24T16:18:06ZCarson Cook (14CDWC)carson.cook@queensu.caUse docker for Gitlab CIUse docker executor with Gitlab CI to isolate execution into a container. Useful particularly to set the node version rather than relying on what is installed on the server.Use docker executor with Gitlab CI to isolate execution into a container. Useful particularly to set the node version rather than relying on what is installed on the server.https://code.engineering.queensu.ca/14CDWC/qplan/-/issues/77Mask sensitive information in Gitlab CI2020-10-12T13:27:46ZCarson Cook (14CDWC)carson.cook@queensu.caMask sensitive information in Gitlab CIThere are passwords and other secrets set as environment variables in Gitlab CI. They are needed, but the plaintext value is outputted when printed to the console. The value should be masked. Values need to adhere to restrictions set by ...There are passwords and other secrets set as environment variables in Gitlab CI. They are needed, but the plaintext value is outputted when printed to the console. The value should be masked. Values need to adhere to restrictions set by Gitlab for masking, so some secrets/passwords may need to be changed to be compliant.
- [ ] mysql password
- [ ] email password
- [ ] passport secret
- [ ] CI_REGISTRY_PASSWORD