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

[Extend Governor APIs] Extensions and ERD schemas #70

Merged

Conversation

bailinhe
Copy link
Contributor

@bailinhe bailinhe commented Oct 4, 2023

Currently Governor API supports addons by allowing standalone applications to listen to various governor events and perform additional tasks accordingly. This approach, while being simple yet powerful and flexible, limits the capabilities of the addons. Namely, addons that provide configurability for the end users, require communications between the users and the addons through the Governor API.

This [Extend Governor APIs] series PRs aim to provide an alternative way, in addition to the existing addons, to improve the Governor API's extendibility, by implementing a solution that allows the API itself to be extended, in a design that is heavily influenced by Kubernetes' CRD and operator patten.

Data schema created:

  • Extensions
  • Extension Resource Definitions
erDiagram
  extension {
    uuid id
    string url
    string name
    string slug
    string description
    bool enabled
    enum status "offline, online"
  }

  extension_resource_definition {
    uuid id
    string name
    string slug_singular
    string slug_plural
    enum scope "system or user"

    bool enabled
    string version
    jsonb schema "JSON schema"
  }

  user_extension_resource {
    uuid id
    jsonb resource
  }

  system_extension_resource {
    uuid id
    jsonb resource
  }

  extension ||--o{ extension_resource_definition: has

  user ||--o{ user_extension_resource: has
  extension_resource_definition ||--o{ user_extension_resource: validates

  extension_resource_definition ||--o{ system_extension_resource: validates
Loading

@bailinhe bailinhe marked this pull request as ready for review October 4, 2023 00:41
@bailinhe bailinhe requested a review from a team as a code owner October 4, 2023 00:41
fishnix
fishnix previously approved these changes Oct 4, 2023
Copy link
Contributor

@fishnix fishnix left a comment

Choose a reason for hiding this comment

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

couple minor comments 👍

db/migrations/00034_api_extensions.sql Outdated Show resolved Hide resolved
db/migrations/00034_api_extensions.sql Show resolved Hide resolved
db/migrations/00034_api_extensions.sql Outdated Show resolved Hide resolved
@bailinhe bailinhe merged commit d82fe47 into metal-toolbox:main Oct 4, 2023
@bailinhe bailinhe deleted the extend-governor-apis/data-schemas branch October 4, 2023 16:33
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