Skip to content

Initial refactor work#922

Open
darinkrauss wants to merge 1 commit intodarin/refactor-oauthfrom
darin/refactor-work
Open

Initial refactor work#922
darinkrauss wants to merge 1 commit intodarin/refactor-oauthfrom
darin/refactor-work

Conversation

@darinkrauss
Copy link
Copy Markdown
Contributor

  • Initial refactor work
  • Add Provider interface to eventually replace concrete *work.Processor
  • Update ProcessPipeline to require completion function
  • Require work.Client dependency for all processors for consistency
  • Specify ProcessingTimeoutMaximum using time.Duration
  • Rename MetadataLengthMaximum to MetadataSizeMaximum
  • Add test functionality

- Initial refactor work
- Add Provider interface to eventually replace concrete *work.Processor
- Update ProcessPipeline to require completion function
- Require work.Client dependency for all processors for consistency
- Specify ProcessingTimeoutMaximum using time.Duration
- Rename MetadataLengthMaximum to MetadataSizeMaximum
- Add test functionality
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Initial refactor of the work processing framework to standardize processor dependencies, tighten pipeline behavior, and prepare for replacing concrete processors with a provider interface.

Changes:

  • Introduces a work.Provider interface and regenerates mocks to support it.
  • Refactors ProcessPipeline.Process to require a completion function and updates processors/tests accordingly.
  • Standardizes processors to require work.Client via work/base.Dependencies, and updates timeout/metadata max constants.

Reviewed changes

Copilot reviewed 25 out of 25 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
work/work.go Converts timeout max to time.Duration, renames metadata max constant, and updates validation accordingly.
work/test/work.go Adds helper to build Work from Create with a specific state (test utility).
work/test/processor_mocks.go Updates generated mocks to include Provider and adds required imports.
work/test/process_result.go Updates timeout max usage and adds matchers for failing/failed error assertions in tests.
work/processor.go Adds Provider interface for processor context/logging/result helpers.
work/process_result.go Changes pipeline processing to require a completion function; adds exported error-to-failed-result helper.
work/base/processor_test.go Updates tests for new dependencies model and new pipeline completion requirement.
work/base/processor.go Adds Dependencies (requires work.Client), refactors Process into a pipeline, and centralizes failure creation.
private/plugin/abbott Bumps git submodule pointer.
plugin/abbott/abbott/work/work.go Embeds work/base.Dependencies into plugin processor dependencies and removes redundant work client field.
oura/work/users/revoke/processor.go Embeds base dependencies and updates pipeline usage to provide completion.
oura/work/subscribe/processor.go Embeds base dependencies and updates pipeline usage to provide completion.
oura/work/processors/processors.go Embeds base dependencies and passes them into each processor factory dependency set.
oura/work/data/setup/processor.go Embeds base dependencies, removes redundant work client field, and uses WorkClient() accessor.
oura/work/data/historic/processor.go Embeds base dependencies and updates pipeline usage to provide completion.
oura/work/data/event/processor.go Embeds base dependencies and updates pipeline usage to provide completion.
oura/jotform/work/reconcile.go Embeds base dependencies and updates pipeline usage to provide completion.
data/source/work/mixin_test.go Updates tests to initialize processor via new dependencies and pipeline completion.
data/set/work/mixin_test.go Updates tests to initialize processor via new dependencies and pipeline completion.
data/service/service/standard.go Wires standardized work/base.Dependencies into Abbott/Oura processor factory construction.
data/raw/work/mixin_test.go Updates tests to initialize processor via new dependencies and pipeline completion.
customerio/work/event/processor_test.go Updates test to provide base WorkClient dependency.
customerio/work/event/processor.go Embeds base dependencies and updates pipeline usage to provide completion.
auth/service/service/service.go Wires standardized work/base.Dependencies into Jotform/CustomerIO processor factories and improves logging.
auth/providersession/work/mixin_test.go Updates tests to initialize processor via new dependencies and pipeline completion.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread work/process_result.go
Comment thread work/process_result.go
Comment thread work/process_result.go
Comment thread work/test/processor_mocks.go
Comment thread work/base/processor.go
Comment thread work/work.go
Comment thread work/processor.go
@darinkrauss
Copy link
Copy Markdown
Contributor Author

Updates based upon feedback included in later PR.

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