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

Refactor service classes to use createServicePolicy #5109

Draft
wants to merge 1 commit into
base: extract-create-service-policy-3
Choose a base branch
from

Conversation

mcmire
Copy link
Contributor

@mcmire mcmire commented Jan 7, 2025

Explanation

A previous commit added a createServicePolicy function to controller-utils. This allows us to refactor the following service classes which make use of a Cockatiel policy by replacing boilerplace code with a simple function call:

  • CodefiV2 in assets-controllers
  • ClientConfigApiService in remote-feature-flag-controller

Note that other service modules that do not yet make use of a Cockatiel policy have not been updated to use createServicePolicy. We would need to upgrade these areas to use the latest service object pattern we've established.

References

Closes #4994.

Changelog

(N/A — no consumer-facing changes)

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've highlighted breaking changes using the "BREAKING" category above as appropriate
  • I've prepared draft pull requests for clients and consumer packages to resolve any breaking changes

@mcmire mcmire force-pushed the extract-create-service-policy branch from 627b096 to 530bc4c Compare January 8, 2025 22:44
@mcmire mcmire force-pushed the refactor-service-classes branch from 1c790a7 to 987ec77 Compare January 8, 2025 22:45
@mcmire mcmire force-pushed the refactor-service-classes branch from 987ec77 to 778223c Compare January 16, 2025 18:36
@mcmire mcmire changed the base branch from extract-create-service-policy to extract-create-service-policy-3 January 16, 2025 18:39
@mcmire mcmire changed the title Use common function for service policy boilerplate Refactor service classes to use createServicePolicy Jan 16, 2025
@mcmire mcmire force-pushed the refactor-service-classes branch from 778223c to 9d15cfb Compare January 16, 2025 18:45
A previous commit added a `createServicePolicy` function to
`controller-utils`. This allows us to refactor the following service
classes which make use of a Cockatiel policy by replacing boilerplace
code with a simple function call:

- `CodefiV2` in `assets-controllers`
- `ClientConfigApiService` in `remote-feature-flag-controller`

Note that other service modules that do not yet make use of a Cockatiel
policy have not been updated to use `createServicePolicy`. We would need
to upgrade these areas to use the latest service object pattern we've
established.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant