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

Report issues with metadata #953

Merged
merged 22 commits into from
Oct 23, 2024
Merged

Conversation

mitchdawson1982
Copy link
Collaborator

@mitchdawson1982 mitchdawson1982 commented Oct 17, 2024

This PR creates a service to raise issues with metadata on the FMD front end.

Implements

  • new /feedback/issue url path
  • new report_issue_view
  • new ReportIssue model for storing successfully submitted issues
  • new ReportIssueForm model form & html template for accepting and validating user input before generating a ReportIssue model instance
  • new service module and send_notifcations function for interacting with the notify API
  • new variables and secrets for the notify api key(s) and notification template id's
  • new tests for forms, models and service

Key Decisions

I have opted to provide the report issue form in a separate view and page via a button on the entity details page.
Some examples I have seen that implement forms on an existing page do so at the bottom, which means the user needs to scroll to the bottom.

I tested placing the form at the top of the entity details page, below the contact section, but it looked cluttered on top of the data. Implementing this way also avoids the need for js to show/hide and validate the form in the front end and allows us to utilise the existing backend methods of form & model validation on submission.

When the report issue form is requested via GET request, we obtain the entity name, full URL and data owner values from the request and store these on the user's session to be used to populate the issue model instance alongside the form values on submission. This avoids the need for creating additional template and form fields to hold these values and placing them back in front of the user. Successfully submitted issues are stored as model instances so that these can be reported on in the future if necessary.

I have implemented a basic integration with the GDS Notify service utilising their Python SDK in which we "fire and forget" notification jobs into the service, logging responses and exceptions as necessary. We could implement a more detailed implementation which periodically polls for message status updates, however, this would then require asynchronous jobs using something such as Celery or Python RQ, and would probably go further than our need at this point but is something we could look at in future.

For further consideration

  • Details page button location / style
    image

  • Location/ Styling of the entity name on the issue form
    image

@mitchdawson1982 mitchdawson1982 force-pushed the fmd-911-report-issues-with-metadata branch 4 times, most recently from 8e1ac23 to 77e643d Compare October 17, 2024 15:14
@mitchdawson1982 mitchdawson1982 marked this pull request as ready for review October 21, 2024 10:17
@mitchdawson1982 mitchdawson1982 requested a review from a team as a code owner October 21, 2024 10:17
@mitchdawson1982 mitchdawson1982 force-pushed the fmd-911-report-issues-with-metadata branch 2 times, most recently from 6967829 to 0480d66 Compare October 21, 2024 10:22
MatMoore
MatMoore previously approved these changes Oct 21, 2024
Copy link
Contributor

@MatMoore MatMoore left a comment

Choose a reason for hiding this comment

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

Great work, and thanks for the detailed write up.

The only thing that jumps out at me now is the use of data owner, which we know is the wrong role to notify. But if we're OK revisiting that next sprint then we can ignore that for now 👍🏻

@mitchdawson1982 mitchdawson1982 force-pushed the fmd-911-report-issues-with-metadata branch from 13f1248 to f0dd40f Compare October 22, 2024 09:33
@mitchdawson1982 mitchdawson1982 force-pushed the fmd-911-report-issues-with-metadata branch from f0dd40f to d25667f Compare October 22, 2024 09:35
mitchdawson1982 and others added 8 commits October 22, 2024 11:14
* report an issue workflow changes and test fix

* report an issue workflow changes and test fix
The po file was a bit messed up, because I stuck an extra translation
for "Justice Data" in there. When makemessages ran again, it was
removing this translation. Also there were some missing msgstrs and
fuzzy matches.

This commit moves the justice-data -> Justice Data translation into the
code instead.
@mitchdawson1982 mitchdawson1982 force-pushed the fmd-911-report-issues-with-metadata branch from 7980a06 to 79a4e9c Compare October 23, 2024 08:48
@mitchdawson1982 mitchdawson1982 merged commit 8c4e12e into main Oct 23, 2024
8 checks passed
@mitchdawson1982 mitchdawson1982 deleted the fmd-911-report-issues-with-metadata branch October 23, 2024 14:02
Copy link

sentry-io bot commented Oct 23, 2024

Suspect Issues

This pull request was deployed and Sentry observed the following issues:

  • ‼️ ProgrammingError: relation "feedback_issue" does not exist /feedback/issue View Issue
  • ‼️ AttributeError: 'NoneType' object has no attribute 'replace' /feedback/issue View Issue

Did you find this useful? React with a 👍 or 👎

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.

2 participants