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

Elisa/7492 public device endpoint #8341

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

emyl3
Copy link
Collaborator

@emyl3 emyl3 commented Dec 3, 2024

BACKEND PULL REQUEST

Related Issue

Changes Proposed

Additional Information

  • co-authored by @DanielSass
  • created a new DeviceTypeProdSyncService for logic related to the device sync from prod
    • TBD I may or may not combine this with the existing DeviceTypeSyncService or just rename this service to make it clear it is for the LIVD sync will depend on how the sync is implemented in part III

Testing

  • deployed on dev4
  • use an API testing tool of your choice to fetch the device list from dev4
    e.g.
    curl --header "Sr-Prod-Devices-Token: REPLACE_TOKEN_HERE" https://dev4.simplereport.gov/api/devices
    
    • you should see the entire list without any InternalIds
  • use an API testing tool of your choice to hit that same endpoint without the Sr-Prod-Devices-Token header
    e.g.
    curl -v  https://dev4.simplereport.gov/api/devices
    
    • you should see no devices and see that the request is Unauthorized

@emyl3 emyl3 force-pushed the elisa/7492-public-device-endpoint branch from 6fd0a9b to 42aaf8b Compare December 4, 2024 21:22
Copy link
Collaborator

@bobbywells52 bobbywells52 left a comment

Choose a reason for hiding this comment

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

Tested and the end point works as expected with and without authorization + paired with Elisa and talked through all of my questions -- LGTM! Thanks for all of you work on this Elisa!!

Copy link
Collaborator

@mpbrown mpbrown left a comment

Choose a reason for hiding this comment

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

Tested the endpoint and everything looks good!

With the current configuration it looks like the lower environments will also end up having this endpoint active right? Just want to check whether that is desired or whether we should have a configuration setting so that by default the endpoint is disabled in the lowers but could be turned on for testing if needed similar to the sendgrid config setting?

private int testLength;

@JsonIgnore
Copy link
Collaborator

Choose a reason for hiding this comment

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

@emyl3 Have you looked into our concerns that removing these ignore tags will cause an issue?

Copy link
Collaborator

Choose a reason for hiding this comment

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

And I apologize because I just now realized I never added that detail to the ticket:

#7492 (comment)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I had previously deployed this branch both with and without the @JsonIgnore -- is this what you were thinking in terms of adding a timer and logging to see if there's a difference with and without the @JsonIgnore

This is with the JsonIgnore tag
Screenshot 2024-11-15 at 12 21 54

This is without
Screenshot 2024-11-15 at 13 40 56

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Let me know if this is not what you had in mind and I can adjust the testing plan and retest 😅

Copy link
Collaborator

Choose a reason for hiding this comment

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

Part of me thinks that the issue is no longer relevant because the audit log was moved out of our db table. The other part of me thinks if it is somehow still an issue, we aren't going to see it until we send this to prod.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I talked to @mehansen about this a bit and I loved her idea of just trying to replicate the original issue as a means of confirming that its no longer a concern. But again, the lack of an audit log in the db might make that a futile effort.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

After discussing with @DanielSass @mehansen and @mpbrown after standup, we will deploy this after the cert renewal.

Once merged in, I will keep an eye on the following:

If there are any slowdowns noticeable from Azure following the deploy, we will revert this PR and see if there are ways we can investigate this further.

In the meantime, I will look into if there's a way to view DB request times in Azure or check-in with Shanice after cert renewal.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'm seeing the our "Azure Database for PostgreSQL - Flexible Server" view for our prod DB and there is a way to view both the Read and Write Throughput Bytes/Sec (Avg) -- Would this be sufficient? 🤔

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@shanice-skylight Are you familiar with any Azure tools to monitor avg DB request times? I saw there's this but we don't seem to have that enabled. 🤔

@emyl3 emyl3 added the Blocked label Dec 16, 2024
@emyl3
Copy link
Collaborator Author

emyl3 commented Dec 16, 2024

⚠️ HOLD OFF ON MERGING!

@@ -24,6 +24,8 @@ public class WebConfiguration implements WebMvcConfigurer {
public static final String PATIENT_UPLOAD = "/upload/patients";
public static final String RESULT_UPLOAD = "/upload/results";
public static final String CONDITION_AGNOSTIC_RESULT_UPLOAD = "/upload/condition-agnostic";

Copy link
Collaborator

Choose a reason for hiding this comment

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

formatting nit - extra newline?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ahhh thank you! I'll update that in the part 3 PR 😅

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ooo oops -- I'll remove this in my next PR 😅 Thank you for catching this 🎣

Comment on lines 23 to +25
@Autowired private DeviceTypeSyncService deviceTypeSyncService;
@Autowired private DeviceTypeProdSyncService deviceTypeProdSyncService;
@Autowired private DeviceTypeService deviceTypeService;
Copy link
Collaborator

Choose a reason for hiding this comment

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

TBD I may or may not combine this with the existing DeviceTypeSyncService or just rename this service to make it clear it is for the LIVD sync will depend on how the sync is implemented in part III

I like this idea! I got tripped up w/ these names

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.

5 participants