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

Use common function for service policy boilerplate #5109

Draft
wants to merge 1 commit into
base: extract-create-service-policy
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
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.
@mcmire mcmire force-pushed the refactor-service-classes branch from 1c790a7 to 987ec77 Compare January 8, 2025 22:45
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.

1 participant