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

[ISSUE-1254] Move domain APIs (contacts, calendar, firebase, etc) from jmap-extensions to jmap-extensions-api #1339

Merged
merged 16 commits into from
Dec 10, 2024

Conversation

HoussemNasri
Copy link
Member

@HoussemNasri HoussemNasri commented Nov 26, 2024

Closes #1254

Refactoring Guidelines

  • Keep the API module as small as possible.
  • Guice modules SHOULD NOT reside in the API module.
  • (unless necessary) Production code SHOULD NOT depend on jmap-extensions (it should depend on jmap-extensions-api instead).
  • Avoid introducing new Maven modules for free (we already have MANY modules).

TODO

  • Add unit tests for all modified JSON serializers.
  • Sort dependencies.
  • Move Contracts
  • Avoid declaring version for jmap-extensions-api unnecessary

tmail-backend/pom.xml Outdated Show resolved Hide resolved
@HoussemNasri HoussemNasri added invalid This doesn't seem right and removed invalid This doesn't seem right labels Nov 27, 2024
@HoussemNasri HoussemNasri force-pushed the refactor-jmap-extensions branch from 7b332e4 to 44766f8 Compare November 28, 2024 15:32
@HoussemNasri
Copy link
Member Author

HoussemNasri commented Nov 29, 2024

It is hard to tell in which layer this class belong. It extends JmapChange so it is clearly an implementation and Jmap-specific but is also referenced in multiple places from models on label.scala and jmap-extensions-cassandra.

case class LabelChange(accountId: AccountId,
created: Set[LabelId] = Set(),
updated: Set[LabelId] = Set(),
destroyed: Set[LabelId] = Set(),
state: State) extends JmapChange {

I have two ideas, but can't decide which one is better:

  • Introduce a jmap-extensions-core that contains the common impl between the extensions- modules and place LabelChange there.
  • Introduce JmapLabelChange that inherits JmapChange and remove the inheritance for the existing LabelChange.

@chibenwa
Copy link
Member

It is hard to tell in which layer this class belong.

Let's look at how it was solved james side.

Mailbox change is part of the API.

@HoussemNasri HoussemNasri force-pushed the refactor-jmap-extensions branch 3 times, most recently from 881c63e to 7a5c52a Compare December 1, 2024 21:56
@chibenwa
Copy link
Member

chibenwa commented Dec 2, 2024

Please rebase

Copy link
Member

@chibenwa chibenwa left a comment

Choose a reason for hiding this comment

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

tmail-backend/jmap/extensions-api/src/main/scala/com/linagora/tmail/james/jmap/contact/EmailAddressContactEventModule.scala guice stuff is not API stuff.

Maybe it can move back?

@HoussemNasri HoussemNasri force-pushed the refactor-jmap-extensions branch 3 times, most recently from b3ceb8a to 80685d6 Compare December 3, 2024 15:15
@HoussemNasri HoussemNasri changed the title [WIP] Move domain APIs (contacts, calendar, firebase, etc) from jmap-extensions to jmap-extensions-api Move domain APIs (contacts, calendar, firebase, etc) from jmap-extensions to jmap-extensions-api Dec 3, 2024
@HoussemNasri HoussemNasri changed the title Move domain APIs (contacts, calendar, firebase, etc) from jmap-extensions to jmap-extensions-api [ISSUE-1254] Move domain APIs (contacts, calendar, firebase, etc) from jmap-extensions to jmap-extensions-api Dec 3, 2024
Copy link
Member

@chibenwa chibenwa left a comment

Choose a reason for hiding this comment

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

Almost there!

@Arsnael
Copy link
Member

Arsnael commented Dec 10, 2024

[ERROR] Failed to execute goal io.github.evis:scalafix-maven-plugin_2.13:0.1.6_0.9.34:scalafix (scala-check-style) on project jmap-extensions-api: Scalafix invoked with errors. Check logs for details. -> [Help 1]

Copy link
Member

@chibenwa chibenwa left a comment

Choose a reason for hiding this comment

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

Again, one step closer!

Copy link
Member

@chibenwa chibenwa left a comment

Choose a reason for hiding this comment

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

We can IMO merge this now.

@HoussemNasri HoussemNasri force-pushed the refactor-jmap-extensions branch 2 times, most recently from 511ff23 to a13ee91 Compare December 10, 2024 15:56
@HoussemNasri HoussemNasri force-pushed the refactor-jmap-extensions branch from a13ee91 to 2b9ef71 Compare December 10, 2024 15:58
@chibenwa chibenwa merged commit ffb7bf6 into linagora:master Dec 10, 2024
5 checks passed
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.

Extract APIs (not implementation) from jmap-extensions module into their own maven module
4 participants