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

Add Typed Events for CalDAV- and CardDAV-related Events #22041

Merged
merged 2 commits into from
Aug 19, 2020

Conversation

georgehrke
Copy link
Member

@georgehrke georgehrke commented Jul 29, 2020

Deprecated Use instead
\OCA\DAV\CalDAV\CalDavBackend::createCalendar OCA\DAV\Events\CalendarCreatedEvent
\OCA\DAV\CalDAV\CalDavBackend::updateCalendar OCA\DAV\Events\CalendarUpdatedEvent
\OCA\DAV\CalDAV\CalDavBackend::deleteCalendar OCA\DAV\Events\CalendarDeletedEvent
\OCA\DAV\CalDAV\CalDavBackend::createCalendarObject OCA\DAV\Events\CalendarObjectCreatedEvent
\OCA\DAV\CalDAV\CalDavBackend::updateCalendarObject OCA\DAV\Events\CalendarObjectUpdatedEvent
\OCA\DAV\CalDAV\CalDavBackend::deleteCalendarObject OCA\DAV\Events\CalendarObjectDeletedEvent
\OCA\DAV\CalDAV\CalDavBackend::createSubscription OCA\DAV\Events\SubscriptionCreatedEvent
\OCA\DAV\CalDAV\CalDavBackend::updateSubscription OCA\DAV\Events\SubscriptionUpdatedEvent
\OCA\DAV\CalDAV\CalDavBackend::deleteSubscription OCA\DAV\Events\SubscriptionDeletedEvent
\OCA\DAV\CalDAV\CalDavBackend::createCachedCalendarObject OCA\DAV\Events\CachedCalendarObjectCreatedEvent
\OCA\DAV\CalDAV\CalDavBackend::updateCachedCalendarObject OCA\DAV\Events\CachedCalendarObjectUpdatedEvent
\OCA\DAV\CalDAV\CalDavBackend::deleteCachedCalendarObject OCA\DAV\Events\CachedCalendarObjectDeletedEvent
\OCA\DAV\CalDAV\CalDavBackend::updateShares OCA\DAV\Events\CalendarShareUpdatedEvent
\OCA\DAV\CalDAV\CalDavBackend::publishCalendar OCA\DAV\Events\CalendarPublishedEvent
\OCA\DAV\CalDAV\CalDavBackend::publishCalendar OCA\DAV\Events\CalendarUnpublishedEvent
\OCA\DAV\CardDAV\CardDavBackend::createCard OCA\DAV\Events\CardCreatedEvent
\OCA\DAV\CardDAV\CardDavBackend::updateCard OCA\DAV\Events\CardUpdatedEvent
\OCA\DAV\CardDAV\CardDavBackend::deleteCard OCA\DAV\Events\CardDeletedEvent

Documentation PR: nextcloud/documentation#2765

@georgehrke georgehrke added the 3. to review Waiting for reviews label Jul 29, 2020
@georgehrke
Copy link
Member Author

How long should we keep the old events in place?

@georgehrke georgehrke added this to the Nextcloud 20 milestone Jul 29, 2020
@skjnldsv
Copy link
Member

How long should we keep the old events in place?

usual deprecation? 3 releases?

@georgehrke georgehrke added 2. developing Work in progress and removed 3. to review Waiting for reviews labels Jul 29, 2020
@georgehrke
Copy link
Member Author

CalDAV tester is not happy, need to look into that

@georgehrke georgehrke force-pushed the feature/noid/typed_events_dav branch from 6f531b2 to 0a563f4 Compare July 29, 2020 13:38
@georgehrke georgehrke added 3. to review Waiting for reviews and removed 2. developing Work in progress labels Jul 29, 2020
@georgehrke
Copy link
Member Author

CalDAV tester is not happy, need to look into that

fixed

@nextcloud nextcloud deleted a comment from faily-bot bot Aug 5, 2020
@MorrisJobke
Copy link
Member

How long should we keep the old events in place?

Put them also into #20953 and see #14552.

Copy link
Member

@MorrisJobke MorrisJobke left a comment

Choose a reason for hiding this comment

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

Fine with me 👍

@MorrisJobke
Copy link
Member

Also the documentation should be updated - I added it to the OP.

@MorrisJobke
Copy link
Member

@georgehrke Mind to look into the failing events?

@skjnldsv skjnldsv added 2. developing Work in progress and removed 3. to review Waiting for reviews labels Aug 6, 2020
@georgehrke georgehrke force-pushed the feature/noid/typed_events_dav branch from 0a563f4 to a666af7 Compare August 6, 2020 06:51
@MorrisJobke
Copy link
Member

Looks far better now 👍

@MorrisJobke MorrisJobke mentioned this pull request Aug 11, 2020
57 tasks
Copy link
Member

@rullzer rullzer left a comment

Choose a reason for hiding this comment

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

🚀

@MorrisJobke
Copy link
Member

Rebased and autosquashed.

@MorrisJobke MorrisJobke removed the 2. developing Work in progress label Aug 18, 2020
@MorrisJobke MorrisJobke added the 4. to release Ready to be released and/or waiting for tests to finish label Aug 18, 2020
@MorrisJobke
Copy link
Member

@georgehrke I assume it's ready to merge, right?

@faily-bot
Copy link

faily-bot bot commented Aug 19, 2020

🤖 beep boop beep 🤖

Here are the logs for the failed build:

Status of 31971: failure

mysql8.0-php7.2

Show full log
 NOCOVERAGE=true TEST_SELECTION=DB ./autotest.sh mysql
Using PHP executable /usr/bin/php
Using database oc_autotest
Setup environment for mysql testing on local storage ...
Waiting for MySQL initialisation ...
.............
Installing ....
An unhandled exception has been thrown:
TypeError: Argument 2 passed to OCA\DAV\Events\AddressBookCreatedEvent::__construct() must be of the type array, null given, called in /drone/src/apps/dav/lib/CardDAV/CardDavBackend.php on line 464 and defined in /drone/src/apps/dav/lib/Events/AddressBookCreatedEvent.php:50
Stack trace:
#0 /drone/src/apps/dav/lib/CardDAV/CardDavBackend.php(464): OCA\DAV\Events\AddressBookCreatedEvent->__construct(0, NULL)
#1 /drone/src/apps/dav/lib/HookManager.php(166): OCA\DAV\CardDAV\CardDavBackend->createAddressBook('principals/user...', 'contacts', Array)
#2 /drone/src/apps/dav/lib/AppInfo/Application.php(131): OCA\DAV\HookManager->firstLogin(Object(OC\User\User))
#3 /drone/src/3rdparty/symfony/event-dispatcher/EventDispatcher.php(264): OCA\DAV\AppInfo\Application->OCA\DAV\AppInfo\{closure}(Object(OC\EventDispatcher\GenericEventWrapper), 'OCP\\IUser::firs...', Object(Symfony\Component\EventDispatcher\EventDispatcher))
#4 /drone/src/3rdparty/symfony/event-dispatcher/EventDispatcher.php(239): Symfony\Component\EventDispatcher\EventDispatcher->doDispatch(Array, 'OCP\\IUser::firs...', Object(OC\EventDispatcher\GenericEventWrapper))
#5 /drone/src/3rdparty/symfony/event-dispatcher/EventDispatcher.php(73): Symfony\Component\EventDispatcher\EventDispatcher->callListeners(Array, 'OCP\\IUser::firs...', Object(OC\EventDispatcher\GenericEventWrapper))
#6 /drone/src/lib/private/EventDispatcher/SymfonyAdapter.php(84): Symfony\Component\EventDispatcher\EventDispatcher->dispatch(Object(OC\EventDispatcher\GenericEventWrapper), Object(OC\EventDispatcher\GenericEventWrapper))
#7 /drone/src/lib/private/User/Session.php(566): OC\EventDispatcher\SymfonyAdapter->dispatch('OCP\\IUser::firs...', Object(Symfony\Component\EventDispatcher\GenericEvent))
#8 /drone/src/lib/private/User/Session.php(412): OC\User\Session->prepareUserLogin(true, false)
#9 /drone/src/lib/private/User/Session.php(621): OC\User\Session->completeLogin(Object(OC\User\User), Array, false)
#10 /drone/src/lib/private/User/Session.php(366): OC\User\Session->loginWithPassword('admin', 'admin')
#11 /drone/src/lib/private/Setup.php(435): OC\User\Session->login('admin', 'admin')
#12 /drone/src/core/Command/Maintenance/Install.php(105): OC\Setup->install(Array)
#13 /drone/src/3rdparty/symfony/console/Command/Command.php(255): OC\Core\Command\Maintenance\Install->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#14 /drone/src/3rdparty/symfony/console/Application.php(1000): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#15 /drone/src/3rdparty/symfony/console/Application.php(271): Symfony\Component\Console\Application->doRunCommand(Object(OC\Core\Command\Maintenance\Install), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#16 /drone/src/3rdparty/symfony/console/Application.php(147): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#17 /drone/src/lib/private/Console/Application.php(215): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#18 /drone/src/console.php(100): OC\Console\Application->run()
#19 /drone/src/occ(11): require_once('/drone/src/cons...')
#20 {mai

acceptance-app-files

  • tests/acceptance/features/app-files.feature:262
Show full log
  Scenario: unmarking a file as favorite causes the file list to be sorted again                          # /drone/src/tests/acceptance/features/app-files.feature:262
    Given I am logged in                                                                                  # LoginPageContext::iAmLoggedIn()
    And I create a new folder named "A name alphabetically lower than welcome.txt"                        # FileListContext::iCreateANewFolderNamed()
    And I see that "A name alphabetically lower than welcome.txt" precedes "welcome.txt" in the file list # FileListContext::iSeeThatPrecedesInTheFileList()
    And I close the details view                                                                          # FilesAppContext::iCloseTheDetailsView()
    And I see that the details view is closed                                                             # FilesAppContext::iSeeThatTheDetailsViewIsClosed()
    And I mark "welcome.txt" as favorite                                                                  # FileListContext::iMarkAsFavorite()
    And I see that "welcome.txt" is marked as favorite                                                    # FileListContext::iSeeThatIsMarkedAsFavorite()
    And I see that "welcome.txt" precedes "A name alphabetically lower than welcome.txt" in the file list # FileListContext::iSeeThatPrecedesInTheFileList()
    When I unmark "welcome.txt" as favorite                                                               # FileListContext::iUnmarkAsFavorite()
    Then I see that "welcome.txt" is not marked as favorite                                               # FileListContext::iSeeThatIsNotMarkedAsFavorite()
      Not favorited state icon for file welcome.txt in file list could not be found after 100 seconds (NoSuchElementException)
    And I see that "A name alphabetically lower than welcome.txt" precedes "welcome.txt" in the file list # FileListContext::iSeeThatPrecedesInTheFileList()

acceptance-login

  • tests/acceptance/features/login.feature:38
Show full log
  Scenario: log in with invalid user once fixed by admin              # /drone/src/tests/acceptance/features/login.feature:38
    Given I act as John                                               # ActorContext::iActAs()
    And I can not log in with user unknownUser and password 123456acb # LoginPageContext::iCanNotLogInWithUserAndPassword()
    When I act as Jane                                                # ActorContext::iActAs()
    And I am logged in as the admin                                   # LoginPageContext::iAmLoggedInAsTheAdmin()
    And I open the User settings                                      # SettingsMenuContext::iOpenTheUserSettings()
    And I click the New user button                                   # UsersSettingsContext::iClickTheNewUserButton()
    And I see that the new user form is shown                         # UsersSettingsContext::iSeeThatTheNewUserFormIsShown()
    And I create user unknownUser with password 123456acb             # UsersSettingsContext::iCreateUserWithPassword()
    And I see that the list of users contains the user unknownUser    # UsersSettingsContext::iSeeThatTheListOfUsersContainsTheUser()
    And I act as John                                                 # ActorContext::iActAs()
    And I log in with user unknownUser and password 123456acb         # LoginPageContext::iLogInWithUserAndPassword()
    Then I see that the current page is the Files app                 # FilesAppContext::iSeeThatTheCurrentPageIsTheFilesApp()
      Failed asserting that 'http://acceptance-login/index.php/login?user=unknownUser' starts with "http://acceptance-login/index.php/apps/files/".

Copy link
Member

@MorrisJobke MorrisJobke left a comment

Choose a reason for hiding this comment

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

Together with #22304 psalm is also happy 👍

@MorrisJobke MorrisJobke merged commit 4361d65 into master Aug 19, 2020
@MorrisJobke MorrisJobke deleted the feature/noid/typed_events_dav branch August 19, 2020 17:34
@MorrisJobke
Copy link
Member

Merged the documentation and added it to the critical changes ticket.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4. to release Ready to be released and/or waiting for tests to finish
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants