Skip to content

Refactor Models Nov 30, 2024 #3

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

Closed
Tracked by #2
Arlodotexe opened this issue Nov 30, 2024 · 0 comments · Fixed by #6
Closed
Tracked by #2

Refactor Models Nov 30, 2024 #3

Arlodotexe opened this issue Nov 30, 2024 · 0 comments · Fixed by #6
Assignees
Labels
areas::product::source Affects product source (code, etc) tasks:refactor::breaking A refactor resulting in a breaking change tasks::refactor::improvement A general improvement, internal or user-facing. tasks::review::design Setup, architecture or design patterns

Comments

@Arlodotexe
Copy link
Member

Arlodotexe commented Nov 30, 2024

Background

See #2 for background.

Problem

The models must be updated according to the refined API spec.

Solution

We've split this analysis into two sections: Lists and properties. Each section lists what's extra and what's missing for each of the three types.


Lists:

Current setup

Publisher

  • Projects
  • Users
  • ParentPublishers
  • ChildPublishers

Project

  • Collaborators
  • Dependencies
  • Connections
  • Features
  • Links
  • Images

User

  • Connections
  • Projects
  • Publishers
  • Links

Changes to make:

[What's extra]:

Publisher doesn't need:

  • Users
  • Projects

Project doesn't need:

  • [n/a]

User doesn't need:

  • Projects
[What's missing]:

Publisher is missing:

  • Users + Roles
  • Connections
  • Links

Project is missing:

  • [n/a]

User is missing:

  • Projects + Roles
  • Publisher + Roles

Properties:

Current setup

Publisher

  • Owner
  • Name
  • Description
  • Icon
  • AccentColor
  • ContactEmail
  • IsUnlisted

Project

  • Publisher
  • Name
  • Description
  • Icon
  • HeroImage
  • AccentColor
  • Category
  • CreatedAt
  • ForgetMe
  • IsUnlisted

User

  • Name
  • MarkdownAboutMe
  • Icon
  • ForgetMe

Changes to make:

[What's extra]:

Publisher doesn't need:

  • Owner
  • ContactEmail
  • Icon

Project doesn't need:

  • HeroImage
  • CreatedAt
  • Icon

User doesn't need:

  • MarkdownAboutMe
  • Icon
[What's missing]:

Publisher is missing:

  • ExtendedDescription
  • ForgetMe

Project is missing:

  • ExtendedDescription

User is missing:

  • ExtendedDescription

In addition to property and collection updates, several other changes should be made to the models while we're in here refactoring things:

  • Remove constructors entirely, declare properties as required or supply default values instead.
  • Remove any json-related attributes.
  • Any mention of IsPrivate should be updated to IsUnlisted, including comments.
  • Identify common properties and collections, then create common interfaces to ensure consistency. Ensure code comments match the generic nature of the common interfaces.
  • Cid should be replaced with DagCid wherever possible. This signals to IPLD that the value is a "link" type pointing to another DAG and is used by various automated tooling.
@Arlodotexe Arlodotexe self-assigned this Dec 29, 2024
@Arlodotexe Arlodotexe added areas::product::source Affects product source (code, etc) difficulty::low tasks::refactor::cleanup A refactor where function is unaffected tasks::refactor::improvement A general improvement, internal or user-facing. tasks::review::design Setup, architecture or design patterns tasks:refactor::breaking A refactor resulting in a breaking change and removed tasks::refactor::cleanup A refactor where function is unaffected labels Dec 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
areas::product::source Affects product source (code, etc) tasks:refactor::breaking A refactor resulting in a breaking change tasks::refactor::improvement A general improvement, internal or user-facing. tasks::review::design Setup, architecture or design patterns
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

1 participant