Exclude hidden files from recently-edited recommendations#997
Open
Exclude hidden files from recently-edited recommendations#997
Conversation
Co-authored-by: skjnldsv <14975046+skjnldsv@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix recommendations to exclude hidden files
Exclude hidden files from recently-edited recommendations
Mar 19, 2026
skjnldsv
reviewed
Mar 19, 2026
…red out Co-authored-by: skjnldsv <14975046+skjnldsv@users.noreply.github.com>
This comment was marked as resolved.
This comment was marked as resolved.
skjnldsv
approved these changes
Mar 19, 2026
Co-authored-by: skjnldsv <14975046+skjnldsv@users.noreply.github.com>
Copilot
AI
changed the title
Exclude hidden files from recently-edited recommendations
Add unit tests for RecentlyEditedFilesSource hidden file filtering
Mar 19, 2026
…ssion test Co-authored-by: skjnldsv <14975046+skjnldsv@users.noreply.github.com>
- composer.json: use vendor/bin/phpunit (bamarni proxy) not vendor-bin/phpunit/vendor/bin/phpunit - tests/bootstrap.php: load server lib/base.php when present (CI context) so OCP interfaces survive composer remove nextcloud/ocp; load OC\Hooks stubs only when not already defined - tests/OcHooksStubs.php: extract OC\Hooks stubs into separate file for conditional require - tests/bootstrap.php: fix PHP CS (empty method bodies on separate lines) Co-authored-by: skjnldsv <14975046+skjnldsv@users.noreply.github.com>
Copilot
AI
changed the title
Add unit tests for RecentlyEditedFilesSource hidden file filtering
Fix PHPUnit CI: wrong binary path, PHP CS, and missing OCP interfaces
Mar 19, 2026
IRootFolder extends OC\Hooks\Emitter (a server-internal interface), which is why OcHooksStubs.php was needed. Fix the root cause instead: replace createMock(IRootFolder::class) with a lightweight anonymous proxy that only exposes getUserFolder(). PHP then never loads IRootFolder at runtime, so no OC\Hooks stubs are required at all. - tests/Unit/Service/RecentlyEditedFilesSourceTest.php: use anonymous proxy - tests/bootstrap.php: remove stubs loading block - tests/OcHooksStubs.php: deleted Co-authored-by: skjnldsv <14975046+skjnldsv@users.noreply.github.com>
Copilot
AI
changed the title
Exclude hidden files from recently-edited recommendations
Fix unit test bootstrap for standalone and CI execution
Mar 19, 2026
Member
|
Done @ChristophWurst |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
composer run test:unitfailed with exit 127 becausevendor-bin/phpunit/vendor/bin/phpunitdoesn't exist —bamarni/composer-bin-pluginexposes the binary atvendor/bin/phpunit(a proxy). Additionally, mockingIRootFolderrequiredOC\Hooks\Emitterstubs at runtime sinceIRootFolder extends OC\Hooks\Emitter, and the CI workflow removesnextcloud/ocpbefore install.Changes
composer.json—test:unitnow usesvendor/bin/phpunittests/bootstrap.php— loadslib/base.phpwhen running inside a Nextcloud server (CI), providing all OCP/OC classes without thenextcloud/ocpdev-dependency; stubs block removed entirelytests/Unit/Service/RecentlyEditedFilesSourceTest.php— replacescreateMock(IRootFolder::class)with an anonymous proxy exposing onlygetUserFolder():IRootFolder::classis a compile-time string constant and doesn't trigger autoloading, soOC\Hooks\Emitteris never loaded — eliminating the need for any runtime stubs.💬 Send tasks to Copilot coding agent from Slack and Teams to turn conversations into code. Copilot posts an update in your thread when it's finished.