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

#2014 - Add callback url to GET and POST requests #2029

Merged
merged 38 commits into from
Oct 8, 2024

Conversation

MackHalliday
Copy link

@MackHalliday MackHalliday commented Oct 2, 2024

  • Add callback_url value to response in related GET and POST notifications request.
  • If callback_url in body of POST request, update value in DB.
  • Decided not to reuse htttps_url schema because of impact on POST to ServiceCallback

Description

issue #2014

How Has This Been Tested?

Tested in Postman and confirmed that callback_url can be added to the Notification Object

POST Notification SMS

Screenshot 2024-10-08 at 11 47 06 AM Screenshot 2024-10-08 at 11 47 20 AM

GET Notification

Screenshot 2024-10-08 at 11 48 04 AM

POST Notification Email

Screenshot 2024-10-08 at 11 48 42 AM

POST Notification Validation Errors

Screenshot 2024-10-08 at 11 49 09 AM Screenshot 2024-10-08 at 11 49 59 AM

Checklist

  • I have assigned myself to this PR
  • PR has an appropriate title: #9999 - What the thing does
  • PR has a detailed description, including links to specific documentation
  • I have added the appropriate labels to the PR.
  • I did not remove any parts of the template, such as checkboxes even if they are not used
  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to any documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works. Testing guidelines
  • I have ensured the latest main is merged into my branch and all checks are green prior to review
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules
  • The ticket was moved into the DEV test column when I began testing this change

@MackHalliday MackHalliday self-assigned this Oct 2, 2024
@MackHalliday MackHalliday marked this pull request as ready for review October 8, 2024 16:04
@MackHalliday MackHalliday requested a review from a team as a code owner October 8, 2024 16:04
Copy link
Member

Choose a reason for hiding this comment

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

@k-macmillan Yikes! I missed this during #1436. Tests should be using the sample_notification fixture and not using create_notification. I'm not asking Mack to change that for this ticket.

'callback_url',
[
('invalid-url', 'is not a valid URI.'),
('htp://wrongformat.com', 'does not match ^https.*'),
Copy link
Member

Choose a reason for hiding this comment

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

Did you mean to test "http"?

Copy link
Author

Choose a reason for hiding this comment

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

I put htp but http makes more sense.

Copy link
Author

Choose a reason for hiding this comment

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

Updated.

@MackHalliday MackHalliday requested a review from kalbfled October 8, 2024 17:16
kalbfled
kalbfled previously approved these changes Oct 8, 2024

assert resp_json['id'] == str(notification.id)
assert resp_json['content']['body'] == template.content.replace('(( Name))', 'Jo')
assert 'callback_url' not in resp_json or resp_json['callback_url'] is None

Choose a reason for hiding this comment

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

callback_url should always be in the response?
shouldn't we just check for resp_json['callback_url'] is None ?

Copy link
Author

Choose a reason for hiding this comment

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

Ops - Yes that should be just resp_json['callback_url'] is None

Updated.

@EvanParish EvanParish merged commit c63a559 into main Oct 8, 2024
5 checks passed
@EvanParish EvanParish deleted the 2014-add-callback-url-to-requests branch October 8, 2024 18:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants