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

Project edit pre-work setup #165

Merged
merged 4 commits into from
Mar 24, 2021
Merged

Project edit pre-work setup #165

merged 4 commits into from
Mar 24, 2021

Conversation

NickPhura
Copy link
Collaborator

Overview

This PR contains the following changes

  • Add structure for getting project data for edit, and putting project data for update
  • Moved a few view/create specific classes/queries to their own files

This PR contains the following types of changes

  • New feature (change which adds functionality)
  • Enhancement (improvements to existing functionality)
  • Bug fix (change which fixes an issue)
  • Misc cleanup / Refactoring / Documentation
  • Version change

Checklist

A list of items that are good to consider when making any changes.

Note: this list is not exhaustive, and not all items are always applicable.

General

  • I have performed a self-review of my own code

Code

  • New files/classes/functions have appropriately descriptive names and comment blocks to describe their use/behaviour
  • I have avoided duplicating code when possible, moving re-usable pieces into functions
  • I have avoided hard-coding values where possible and moved any re-usable constants to a constants file
  • My code is as flat as possible (avoids deeply nested if/else blocks, promise chains, etc)
  • My code changes account for null/undefined values and handle errors appropriately
  • My code uses types/interfaces to help describe values/parameters/etc, help ensure type safety, and improve readability

Style

  • My code follows the established style conventions
  • My code uses native material-ui components/icons/conventions when possible

Documentation

  • I have commented my code sufficiently, such that an unfamiliar developer could understand my code
  • I have added/updated README's and related documentation, as needed

Tests

  • I have added/updated unit tests for any code I've added/updated
  • I have added/updated the Postman requests/tests to account for any API endpoints I've added/updated

Linting/Formatting

  • I have run the linter and fixed any issues, as needed
    See the lint commands in package.json
  • I have run the formatter and fixed any issues, as needed
    See the format commands in package.json

SonarCloud

  • I have addressed all SonarCloud Bugs, Vulnerabilities, Security Hotspots, and Code Smells

How Has This Been Tested?

Please describe the tests that you ran to verify your changes.

Screenshots

Please add any relevant UI screenshots, if applicable.

@github-actions
Copy link

A JIRA Issue ID is missing from your branch name! 🦄

Your branch: Edit_general_structure

If this is your first time contributing to this repository - welcome!


Please refer to jira-lint to get started.

Without the JIRA Issue ID in your branch name you would lose out on automatic updates to JIRA via SCM; some GitHub status checks might fail.

Valid sample branch names:

‣ feature/shiny-new-feature--mojo-10'
‣ 'chore/changelogUpdate_mojo-123'
‣ 'bugfix/fix-some-strange-bug_GAL-2345'

@codecov
Copy link

codecov bot commented Mar 24, 2021

Codecov Report

Merging #165 (94986c1) into dev (9e01371) will decrease coverage by 2.27%.
The diff coverage is 32.36%.

Impacted file tree graph

@@            Coverage Diff             @@
##              dev     #165      +/-   ##
==========================================
- Coverage   48.26%   45.99%   -2.28%     
==========================================
  Files         111      114       +3     
  Lines        2101     2207     +106     
  Branches      472      511      +39     
==========================================
+ Hits         1014     1015       +1     
- Misses        997     1102     +105     
  Partials       90       90              
Impacted Files Coverage Δ
api/src/models/project-update.ts 0.00% <0.00%> (ø)
api/src/openapi/schemas/project.ts 100.00% <ø> (ø)
api/src/paths/permit-no-sampling.ts 0.00% <ø> (ø)
api/src/paths/project.ts 0.00% <0.00%> (ø)
api/src/paths/project/{projectId}/update.ts 0.00% <0.00%> (ø)
api/src/paths/project/{projectId}/view.ts 0.00% <ø> (ø)
...s/permit-no-sampling/permit-no-sampling-queries.ts 100.00% <ø> (ø)
api/src/queries/project/project-create-queries.ts 100.00% <ø> (ø)
api/src/queries/project/project-update-queries.ts 0.00% <0.00%> (ø)
api/src/models/project-create.ts 61.25% <61.25%> (ø)
... and 6 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9e01371...94986c1. Read the comment docs.

@github-actions
Copy link

A JIRA Issue ID is missing from your branch name! 🦄

Your branch: Edit_general_structure

If this is your first time contributing to this repository - welcome!


Please refer to jira-lint to get started.

Without the JIRA Issue ID in your branch name you would lose out on automatic updates to JIRA via SCM; some GitHub status checks might fail.

Valid sample branch names:

‣ feature/shiny-new-feature--mojo-10'
‣ 'chore/changelogUpdate_mojo-123'
‣ 'bugfix/fix-some-strange-bug_GAL-2345'

@sonarqubecloud
Copy link

sonarqubecloud bot commented Mar 24, 2021

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

No Coverage information No Coverage information
0.0% 0.0% Duplication

Copy link
Contributor

@sdevalapurkar sdevalapurkar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good!

can we add tests to missing areas in models/ and queries/ files? should be mostly copies of existing tests in other places to ensure the classes set properties correctly in constructor/that the sqlstatement returned is not null when expected :)

* @export
* @class PostProjectObject
*/
export class PostProjectObject {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we add a test for this class? :)

* @export
* @class PostPermitData
*/
export class PostPermitData {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test for this class as well

* @export
* @class PostFundingData
*/
export class PostFundingData {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and this class too

@anissa-agahchen
Copy link
Contributor

anissa-agahchen commented Mar 24, 2021

@shreyas, I think we might need to tackle the tests in another PR, so that we can start using this common code base

BUT ... we should have a place to capture the list of tests to be done sooner than later

@sdevalapurkar
Copy link
Contributor

@shreyas, I think we might need to tackle the tests in another PR, so that we can start using this common code base

BUT ... we should have a place to capture the list of tests to be done sooner than later

hmmm... yeah I'm ok leaving it to another PR but 2.28% is quite a lot and definitely needs to be addressed
happy to help address it too - but we need to as a team

@anissa-agahchen
Copy link
Contributor

@shreyas, I think we might need to tackle the tests in another PR, so that we can start using this common code base
BUT ... we should have a place to capture the list of tests to be done sooner than later

hmmm... yeah I'm ok leaving it to another PR but 2.28% is quite a lot and definitely needs to be addressed
happy to help address it too - but we need to as a team

Yeah, we can help address it better once we have it in dev

Copy link
Contributor

@anissa-agahchen anissa-agahchen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks good in general .. the codecov went down, but I think it's worth putting the PR through and we can collectively address the test coverage

@NickPhura, what approach should go with?

@NickPhura
Copy link
Collaborator Author

NickPhura commented Mar 24, 2021

It looks good in general .. the codecov went down, but I think it's worth putting the PR through and we can collectively address the test coverage

@NickPhura, what approach should go with?

I'd rather get this merged now, and include the necessary tests in each of the individual edit ticket PRs. This is working when I test it with postman, but it hasn't been hooked up the the frontend, so it might be that I've overlooked something. It would be a bit safer to write tests for each edit workflow after getting its full end-to-end working.

@NickPhura
Copy link
Collaborator Author

@shreyas, I think we might need to tackle the tests in another PR, so that we can start using this common code base
BUT ... we should have a place to capture the list of tests to be done sooner than later

hmmm... yeah I'm ok leaving it to another PR but 2.28% is quite a lot and definitely needs to be addressed
happy to help address it too - but we need to as a team

Yeah, we can/should add tests as we flush out each of the edit pieces. But right now, with this being an incomplete piece of the round-trip workflow, I'd prefer to hold off in case something critical needs to change.

@sdevalapurkar sdevalapurkar merged commit d78003e into dev Mar 24, 2021
@sdevalapurkar sdevalapurkar deleted the Edit_general_structure branch March 24, 2021 22:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants