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

[RFC] Setting NCU\ for unstable/work-in-progress API #48891

Merged
merged 1 commit into from
Nov 11, 2024

Conversation

ArtificialOwl
Copy link
Member

This comes after some discussions regarding the implementation of IUserPreferences directly in public or in private first.
During the discussion we established that keeping the API in private helps future unexpected fix and modification that might occurs in the near future; however, it will also block people to test it from their apps.

The conclusion was to provide a namespace for in-progress API with rules between public and private

  • by not using private API, developers are still encouraged to use and test the API in theirs apps
  • by not using public API, developers stays alert that the API can change at any moment.
  • once the testing API is set as stable, code is copied to OCP\ and previous code within NCT\ is marked as deprecated

@ArtificialOwl ArtificialOwl added this to the Nextcloud 31 milestone Oct 25, 2024
@ArtificialOwl ArtificialOwl force-pushed the enh/noid/testing-namespace branch 3 times, most recently from 95a4ab5 to d5d42a3 Compare October 25, 2024 12:21
@ChristophWurst
Copy link
Member

A dedicated namespace means you have to change your app once the API switches from testing to stable. Would it be possible to put the APIs into the OCP namespace but tag them as @experimental or similar? Experimental could mean that the API exists for that release but there are no guarantees for stability. Future versions might have a changes or remove the API.

@ArtificialOwl
Copy link
Member Author

A dedicated namespace means you have to change your app once the API switches from testing to stable. Would it be possible to put the APIs into the OCP namespace but tag them as @experimental or similar? Experimental could mean that the
API exists for that release but there are no guarantees for stability. Future versions might have a changes or remove the API.

While this helps a lot to not have to rename when switching to final, I am myself not a huge fan to have an API in public/ that is set as experimental using only PHPDoc. I also think it loosen the concept of lib/public/
From my point of view, this solution does not fully communicate any developer that he/she is using an experimental API. The fact that a developer import a lib from a testing namespace helps embrace the current status of the API.

@provokateurin
Copy link
Member

For this to be successful there should be a limit on how long an API can stay in OCT before it moves to OCP. If it is there for more than 1 major server version, it will become impossible to maintain apps that need to support 2+ versions of the API.
Therefore I suggest that any API in OCT can only stay there for 1 major server release and then either has to be removed from OCT and redone or moved to OCP (with changes allowed).
If we can not make this guarantee, then I see no benefit over having it in OC as long as needed and then moving it to OCP.

@ArtificialOwl
Copy link
Member Author

For this to be successful there should be a limit on how long an API can stay in OCT before it moves to OCP. If it is there for more than 1 major server version, it will become impossible to maintain apps that need to support 2+ versions of the API. Therefore I suggest that any API in OCT can only stay there for 1 major server release and then either has to be removed from OCT and redone or moved to OCP (with changes allowed). If we can not make this guarantee, then I see no benefit over having it in OC as long as needed and then moving it to OCP.

Totally agree, we need to set a maximum number of version to stay in that namespace.
I would prefer 2 myself but it is true that more will only makes everything harder to maintain. 1 should be good enough.

@skjnldsv skjnldsv changed the title Setting NCT\ for work-in-progress API [RFC] Setting NCT\ for work-in-progress API Oct 26, 2024
@provokateurin
Copy link
Member

provokateurin commented Oct 27, 2024

It would be great do write down this rule (and possibly others) in the docs or server wiki, just so that everyone is on the same page.

@provokateurin
Copy link
Member

Also if you don't mind I suggest we apply strong psalm and rector rules to the namespace, so that any new API will be in great shape before it lands in OCP (at least if it goes through NCT first).

@ArtificialOwl
Copy link
Member Author

wip documentation: nextcloud/documentation#12329

Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
@ArtificialOwl ArtificialOwl force-pushed the enh/noid/testing-namespace branch from 7e1522c to 0f6ef85 Compare November 7, 2024 18:49
@ArtificialOwl ArtificialOwl changed the title [RFC] Setting NCT\ for work-in-progress API [RFC] Setting NCU\ for unstable/work-in-progress API Nov 7, 2024
Copy link
Contributor

@susnux susnux left a comment

Choose a reason for hiding this comment

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

🚀

@ArtificialOwl ArtificialOwl merged commit 7c67df6 into master Nov 11, 2024
179 checks passed
@ArtificialOwl ArtificialOwl deleted the enh/noid/testing-namespace branch November 11, 2024 15:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants