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

build(psalm): Configure unstable namespace #49224

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

provokateurin
Copy link
Member

@provokateurin provokateurin commented Nov 12, 2024

Summary

  • Add separate psalm config for NCU
  • Add NcuExperimentalChecker which is a copy of the OcpSinceChecker but checks for @experimental and not @since
  • Bump psalm error level to 1 since we only write interfaces in this namespace and level 3, 2 and 1 provide some stricter checks for that (see https://psalm.dev/docs/running_psalm/error_levels/)
  • No baseline for this namespace, we don't want to introduce any legacy code right from the start

Checklist

@provokateurin provokateurin added the 3. to review Waiting for reviews label Nov 12, 2024
@provokateurin provokateurin added this to the Nextcloud 31 milestone Nov 12, 2024
}
}

private static function checkMethodOrConstantComment(Stmt $stmt, FileSource $statementsSource, string $type): void {
Copy link
Member

Choose a reason for hiding this comment

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

missing check for since

Copy link
Member Author

@provokateurin provokateurin Nov 12, 2024

Choose a reason for hiding this comment

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

For NCU we only want to check @experimental and not @since.
If the API is moved to OCP it is not compatible anyway due to the namespace change (even if everything else stays the same), so that's the point when the @since annotations need to be added and the @experimental annotations need to be removed.

Copy link
Member

Choose a reason for hiding this comment

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

We need the since to be able to remember the 1 release until decision and 2 releases until removal?

https://docs.nextcloud.com/server/latest/developer_manual/digging_deeper/api.html

An API can only live in this unstable namespace for one major release.

Deprecated API from the NCU namespace are kept for 2 major releases.

Copy link
Member Author

@provokateurin provokateurin Nov 12, 2024

Choose a reason for hiding this comment

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

I thought we'd add @experimental 31.0.0 to indicate the version it lives in the namespace.
@ArtificialOwl maybe you can shed some more light on how this should work, the documentation doesn't seem to be clear enough about this (please also update it if necessary).

Copy link
Member

Choose a reason for hiding this comment

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

As you are saying, having @since while in unstable might be confusing, and we can follow the implementation version via @experimental

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Waiting for reviews
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants