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

Fixes #592 -- Bump jsonattrs; small style fixes #1401

Merged
merged 3 commits into from
Apr 20, 2017
Merged

Fixes #592 -- Bump jsonattrs; small style fixes #1401

merged 3 commits into from
Apr 20, 2017

Conversation

oliverroick
Copy link
Member

Proposed changes in this pull request

Fixes #592.

GeoODK sends empty XML (<location_problems />) elements when no value is provided for a form field. We convert the XML into a Python dictionary using pyxform.xform2json.XFormToDict; all empty XML elements are converted to empty strings ("location_problems": "") or a list with one empty string ("location_problems": [""]).

This is a problem for integer, decimal, select_one and select_multiple fields because an empty string is an actual value but it's not valid for fields mentioned above because it's not a number and usually not an option for select fields.

This PR only bumps django-jsonattrs to a new version. The actual bug fix is added to django-json attrs PR #17. Please review the django-jsonattrs PR before accepting this one.

When should this PR be merged

When ready.

Risks

None/

Follow-up actions

  • @oliverroick to make a full release of django-jsonattrs when the PR is accepted.

Checklist (for reviewing)

General

  • Is this PR explained thoroughly? All code changes must be accounted for in the PR description.
  • Is the PR labeled correctly? It should have the migration label if a new migration is added.
  • Is the risk level assessment sufficient? The risks section should contain all risks that might be introduced with the PR and which actions we need to take to mitigate these risks. Possible risks are database migrations, new libraries that need to be installed or changes to deployment scripts.

Functionality

  • Are all requirements met? Compare implemented functionality with the requirements specification.
  • Does the UI work as expected? There should be no Javascript errors in the console; all resources should load. There should be no unexpected errors. Deliberately try to break the feature to find out if there are corner cases that are not handled.

Code

  • Do you fully understand the introduced changes to the code? If not ask for clarification, it might uncover ways to solve a problem in a more elegant and efficient way.
  • Does the PR introduce any inefficient database requests? Use the debug server to check for duplicate requests.
  • Are all necessary strings marked for translation? All strings that are exposed to users via the UI must be marked for translation.

Tests

  • Are there sufficient test cases? Ensure that all components are tested individually; models, forms, and serializers should be tested in isolation even if a test for a view covers these components.
  • If this is a bug fix, are tests for the issue in place? There must be a test case for the bug to ensure the issue won’t regress. Make sure that the tests break without the new code to fix the issue.
  • If this is a new feature or a significant change to an existing feature? has the manual testing spreadsheet been updated with instructions for manual testing?

Security

  • Confirm this PR doesn't commit any keys, passwords, tokens, usernames, or other secrets.
  • Are all UI and API inputs run through forms or serializers?
  • Are all external inputs validated and sanitized appropriately?
  • Does all branching logic have a default case?
  • Does this solution handle outliers and edge cases gracefully?
  • Are all external communications secured and restricted to SSL?

Documentation

  • Are changes to the UI documented in the platform docs? If this PR introduces new platform site functionality or changes existing ones, the changes must be documented in the Cadasta Platform Documentation.
  • Are changes to the API documented in the API docs? If this PR introduces new API functionality or changes existing ones, the changes must be documented in the API docs.
  • Are reusable components documented? If this PR introduces components that are relevant to other developers (for instance a mixin for a view or a generic form) they should be documented in the Wiki.

Copy link
Contributor

@seav seav left a comment

Choose a reason for hiding this comment

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

Aside from the minor misspelling I noticed (see inline comment), I want to raise a general comment regarding how we treat QA for the other repos: django-jsonattrs, django-tutelary, and django-skivvy. Right now, it seems any changes to any of those repos does not really go into the same QA process we have on cadasta-platform (have 2 reviewers, put on staging for isolated testing if needed, etc.). Should we be instituting the same or a similar but lightweight QA process as well?

headers=headers,
status=status,
content_type=self.DEFAULT_CONTENT_TYPE)
tempate_data = {'message': message}
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this be template_data instead of tempate_data?

Copy link
Member Author

Choose a reason for hiding this comment

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

It should!

@oliverroick
Copy link
Member Author

I agree we should apply the same QA standards to all our libraries. I was expecting you to look at the other PR as well; implicitly when you approve this PR, you also approve the other PR.

I'll add the same required checks to our other repositories and will assign people for review in the future.

Copy link
Contributor

@bjohare bjohare 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 other than comment on django-jsonattrs PR.

Copy link
Contributor

@seav seav left a comment

Choose a reason for hiding this comment

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

This PR and the PR in django-jsonattrs now looks good to me!

@amplifi
Copy link
Contributor

amplifi commented Apr 20, 2017

Merge pending release of Cadasta/django-jsonattrs#17

@oliverroick
Copy link
Member Author

oliverroick commented Apr 20, 2017

Released django-jsonattrs 0.1.22 and added it to the requirements, should be good to go when the tests have passed.

@amplifi amplifi merged commit 77be22a into master Apr 20, 2017
@amplifi amplifi deleted the bugfix/#592 branch April 20, 2017 10:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Questionnaires with select_one questions MUST have default or be required
4 participants