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

Add exception handling to LogOrganizationsApiCredentialStatusJob #2330

Merged
merged 5 commits into from
Nov 22, 2024

Conversation

lukey-luke
Copy link
Contributor

🎫 Ticket

This is a follow-up to #2327 for DPC-4390.

🛠 Changes

  • wrap DpcApiClient calls so if an exception is raised, the sidekiq job can continue to run for organizations with successful API calls (see context below)

ℹ️ Context

  • following the automatic deployment to the dev environment, I observed that the sidekiq job was not emitting the expected message in the logs.
  • it appears that one of the organizations on the dev environment has an invalid UUID, causing get_client_tokens() to fail

Screenshot 2024-11-19 at 5 58 44 PM
Screenshot 2024-11-19 at 5 58 47 PM

🧪 Validation

@lukey-luke lukey-luke marked this pull request as ready for review November 20, 2024 05:15
@lukey-luke lukey-luke requested a review from a team November 20, 2024 05:16
expect(Rails.logger).to receive(:info).with(['Organizations API credential status',
{ have_active_credentials: 1,
have_incomplete_or_no_credentials: 0 }])
described_class.perform_now
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 make sure we are logging failure?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think this is a bit beyond the scope of the original goals for building the dashboard, but it's an easy lift, so I added a new expect() to this test.

Copy link
Contributor

@jdettmannnava jdettmannnava left a comment

Choose a reason for hiding this comment

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

LGTM

@lukey-luke lukey-luke merged commit da00e87 into main Nov 22, 2024
8 checks passed
@lukey-luke lukey-luke deleted the ls/bugfix-4390-exception-in-logs branch November 22, 2024 16:52
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