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 packages and separate internal and pkg #129

Merged
merged 6 commits into from
Dec 5, 2023

Conversation

powerfooI
Copy link
Collaborator

@powerfooI powerfooI commented Nov 30, 2023

Summary

  1. Move auxiliary type definitions from api/v1alpha1 to api/types like BackupVolumeSpec.
  2. Move task-related types into pkg/task like OperationContext.
  3. Move controller, resource, telemetry and const folder in previous pkg/ to a new folder internal/.
  4. In resource folder, the PR separate every resource manager into single folder, in which names of their tasks and task flows are included. This change increases locality of code of every resource manager and make pkg/task a quite independent package that does not rely on ob-operator actually. Every resource manager register their task flows in their own package init part.
  5. Move struct coordinator and interface ResourceManager to a new package coordinator in pkg/ folder, which is another independent module, too.
  6. In order to avoid possible race when registering task flows, a simple mutex was added to task_manager. I believe that it does not impact the functionality of task registry. This is the only change that impacts functionalities in this PR.
  7. Set specific types to fields (TaskName, FlowName, TaskID etc.) in pkg/task instead of plain string that may cause confusion in some cases. (e.g. mismatch name of task flows and tasks).

This PR may somehow reach the requirement of #128

…eManager's folder in internal/ instead of keeping them in pkg/task
…kID type. This causes mismatches if store string taskId and load with taskID taskId
@powerfooI powerfooI changed the title Refactor packages and separate internal/ and pkg/ Refactor packages and separate internal and pkg Dec 1, 2023
@powerfooI powerfooI marked this pull request as ready for review December 1, 2023 05:46
charts/oceanbase-cluster/values.yaml Outdated Show resolved Hide resolved
example/backup/backup_policy_oss.yaml Outdated Show resolved Hide resolved
example/webapp/configserver.yaml Outdated Show resolved Hide resolved
example/webapp/obproxy.yaml Outdated Show resolved Hide resolved
example/webapp/obproxy.yaml Outdated Show resolved Hide resolved
charts/oceanbase-cluster/values.yaml Outdated Show resolved Hide resolved
Copy link
Member

@chris-sun-star chris-sun-star left a comment

Choose a reason for hiding this comment

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

LGTM

@chris-sun-star chris-sun-star merged commit 7a0dba5 into oceanbase:master Dec 5, 2023
1 check passed
@powerfooI powerfooI deleted the refactor/tasks branch March 29, 2024 13:12
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