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

Tidy up typing in OC\Files\View #36836

Merged
merged 8 commits into from Apr 5, 2023
Merged

Tidy up typing in OC\Files\View #36836

merged 8 commits into from Apr 5, 2023

Conversation

come-nc
Copy link
Contributor

@come-nc come-nc commented Feb 23, 2023

Summary

Add return types and fix psalm complaints in View and related classes.

Checklist

@come-nc come-nc added the 2. developing Work in progress label Feb 23, 2023
@come-nc come-nc added this to the Nextcloud 27 milestone Feb 23, 2023
@come-nc come-nc self-assigned this Feb 23, 2023
@come-nc
Copy link
Contributor Author

come-nc commented Mar 14, 2023

@come-nc
Copy link
Contributor Author

come-nc commented Mar 27, 2023

/rebase

@come-nc
Copy link
Contributor Author

come-nc commented Mar 30, 2023

@icewind1991 https://github.com/nextcloud/server/blob/master/apps/dav/lib/Connector/Sabre/Directory.php#L139-L141 this is blowing up because it puts null in non-nullable parameters.
Any idea how to refactor this properly?

@come-nc
Copy link
Contributor Author

come-nc commented Mar 30, 2023

@icewind1991 https://github.com/nextcloud/server/blob/master/apps/dav/lib/Connector/Sabre/Directory.php#L139-L141 this is blowing up because it puts null in non-nullable parameters. Any idea how to refactor this properly?

For now I went back to weak typing for internalPath in FileInfo.

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
It’s not used and not in any OCP interface/class.

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Applications are calling methods from the class which are not from the
 public interface, and which cannot be added easily to public interface
 because Node interface extends FileInfo.

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
@come-nc come-nc marked this pull request as ready for review April 3, 2023 13:02
@come-nc come-nc requested review from ChristophWurst, provokateurin, a team, ArtificialOwl, icewind1991 and blizzz and removed request for a team April 3, 2023 13:03
Copy link
Member

@ChristophWurst ChristophWurst left a comment

Choose a reason for hiding this comment

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

👍 looks ok but I'm not familiar enough with this area of the code to given an approval

Copy link
Member

@icewind1991 icewind1991 left a comment

Choose a reason for hiding this comment

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

Good work otherwise 👍

* @param string $path
* @return string
*/
public function getLocalFolder($path) {
Copy link
Member

Choose a reason for hiding this comment

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

is deleting this intentional?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, the only place it was used was a test.

@icewind1991
Copy link
Member

@icewind1991 https://github.com/nextcloud/server/blob/master/apps/dav/lib/Connector/Sabre/Directory.php#L139-L141 this is blowing up because it puts null in non-nullable parameters. Any idea how to refactor this properly?

probably makes most sense to change those nulls to empty strings. But it probably makes more sense to do a that in a separate PR

@provokateurin provokateurin removed their request for review April 4, 2023 16:13
lib/private/Files/View.php Outdated Show resolved Hide resolved
@@ -250,7 +250,7 @@ public function getMountPoint();
/**
* Get the owner of the file
*
* @return \OCP\IUser
* @return ?\OCP\IUser
Copy link
Member

Choose a reason for hiding this comment

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

should be added to critical changes (even if not a de-facto change to raise awareness)

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
@come-nc come-nc added 3. to review Waiting for reviews pending documentation This pull request needs an associated documentation update and removed 2. developing Work in progress labels Apr 5, 2023
@come-nc come-nc merged commit 8f55039 into master Apr 5, 2023
37 checks passed
@come-nc come-nc deleted the fix/view-type-cleanup branch April 5, 2023 08:14
@juliushaertl
Copy link
Member

Causing some test failures on office by stricter typing that might be related to version handling in server. First investigation in nextcloud/richdocuments#2896, to be continued tomorrow.

@DaphneMuller
Copy link

Hello!
Thank you for your work on this! I noticed that your PR still has the label 'documentation'. I'm not sure if you already had a look at the documentation for your PR, but at Nextcloud we strive to document changes that affect other app developers or other admins before the release takes place, and I'm pinging you with the hope to get this done.

Are you familiar with our documentation process already?
Changes that affect app developers should be documented here:
https://docs.nextcloud.com/server/27/developer_manual/app_publishing_maintenance/app_upgrade_guide/upgrade_to_27.html

Changes that affect administrators should be documented here:
https://docs.nextcloud.com/server/latest/admin_manual/release_notes/upgrade_to_27.html

While I understand sometimes it's handy to merge fast to get your changes in, it would be great if next time you could try to add the documentation before merging. You can find more information on that here:
https://docs.nextcloud.com/server/27/developer_manual/prologue/compatibility_app_ecosystem.html#documentation-procedures-of-changes-that-affect-app-developers

If all your documentation efforts are done, please remove the label 'documentation' and check the checkbox in your opening note and I'll stop bugging you :)

Many thanks in advance and thanks again for your work!

* @param string $path
* @return string
*/
public static function getLocalFolder($path) {
Copy link
Member

Choose a reason for hiding this comment

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

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.

None yet

6 participants