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

Feature/breakers service matching #21368

Draft
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

acrollet
Copy link
Contributor

@acrollet acrollet commented Mar 21, 2025

Summary

This PR updates the common client to be able to do breakers matching on service name instead of request URL. This will help avoid breakers tripping for different services that share the same host and base_path. (Most notably lighthouse)

Breakers PR: department-of-veterans-affairs/breakers#40
Slack thread: https://dsva.slack.com/archives/C0460N83Y9G/p1742325203299699

Gemfile Update:

  • Updated breakers gem to use a specific branch from the GitHub repository.

Middleware Usage:

  • Modified docs/setup/betamocks.md to include service_name when using breakers middleware.
  • Updated lib/common/client/base.rb to warn if service_name is not passed to breakers middleware and to ensure breakers is the first middleware implemented.
  • Enhanced lib/common/client/configuration/base.rb to match requests by service_name if available and added logging for service creation. [1] [2]

Service Configuration:

  • Added service_name method to lib/kafka/schema_registry/configuration.rb and modules/ivc_champva/lib/pega_api/configuration.rb. [1] [2]
  • Updated matcher procs in lib/evss/base_service.rb and modules/claims_api/lib/bgs_service/local_bgs.rb to include _breakers_service and _request_service_name parameters. [1] [2]
  • Modified lib/unified_health_data/configuration.rb to pass service_name to breakers middleware.

Related issue(s)

  • Link to ticket created in va.gov-team repo OR screenshot of Jira ticket if your team uses Jira
  • Link to previous change of the code/bug (if applicable)
  • Link to epic if not included in ticket

Testing done

  • New code is covered by unit tests
  • Describe what the old behavior was prior to the change
  • Describe the steps required to verify your changes are working as expected. Exclusively stating 'Specs run' is NOT acceptable as appropriate testing
  • If this work is behind a flipper:
    • Tests need to be written for both the flipper on and flipper off scenarios. Docs.
    • What is the testing plan for rolling out the feature?

Screenshots

Note: Optional

What areas of the site does it impact?

(Describe what parts of the site are impacted andifcode touched other areas)

Acceptance criteria

  • I fixed|updated|added unit tests and integration tests for each feature (if applicable).
  • No error nor warning in the console.
  • Events are being sent to the appropriate logging solution
  • Documentation has been updated (link to documentation)
  • No sensitive information (i.e. PII/credentials/internal URLs/etc.) is captured in logging, hardcoded, or specs
  • Feature/bug has a monitor built into Datadog (if applicable)
  • If app impacted requires authentication, did you login to a local build and verify all authenticated routes work as expected
  • I added a screenshot of the developed feature

Requested Feedback

(OPTIONAL)What should the reviewers know in addition to the above. Is there anything specific you wish the reviewer to assist with. Do you have any concerns with this PR, why?

@va-vfs-bot va-vfs-bot temporarily deployed to feature/breakers-service-matching/main/main March 21, 2025 14:40 Inactive
@va-vfs-bot va-vfs-bot temporarily deployed to feature/breakers-service-matching/main/main March 21, 2025 14:50 Inactive
@va-vfs-bot va-vfs-bot temporarily deployed to feature/breakers-service-matching/main/main March 21, 2025 15:25 Inactive
@acrollet acrollet added the NOT_YET Don't merge this PR w/o the authors permission label Mar 21, 2025
@acrollet
Copy link
Contributor Author

Added NOT_YET label, this should not be merged until the breakers dependency is updated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NOT_YET Don't merge this PR w/o the authors permission test-passing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants