Compare commits

...

7 Commits

Author SHA1 Message Date
Anna de1cbfc5ff
Merge c39765dc53 into 4049485ec6 2024-04-26 16:04:16 -04:00
Andy Scherzinger 4049485ec6
Merge pull request #45066 from nextcloud/feat/workflow-auto-update-dependabot-approve-merge.yml
Updating dependabot-approve-merge.yml workflow from template
2024-04-26 20:20:55 +02:00
Andy Scherzinger 2e910e3070
Merge pull request #45065 from nextcloud/feat/workflow-auto-update-pr-feedback.yml
Updating pr-feedback.yml workflow from template
2024-04-26 20:20:31 +02:00
Nextcloud bot db5adbd7c4 Updating dependabot-approve-merge.yml workflow from template
Signed-off-by: Nextcloud bot <bot@nextcloud.com>
2024-04-26 18:13:17 +00:00
Nextcloud bot c9047a8a5e Updating pr-feedback.yml workflow from template
Signed-off-by: Nextcloud bot <bot@nextcloud.com>
2024-04-26 17:59:18 +00:00
Anna Larch c39765dc53 fixup! fix(userstatus): catch unique constrain violation on revert 2024-04-26 14:19:30 +02:00
Anna Larch b8a4356239 fix(userstatus): catch unique constrain violation on revert
Signed-off-by: Anna Larch <anna@nextcloud.com>
2024-04-26 14:05:38 +02:00
3 changed files with 45 additions and 7 deletions

View File

@ -2,6 +2,9 @@
#
# https://github.com/nextcloud/.github
# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization
#
# SPDX-FileCopyrightText: 2021-2024 Nextcloud GmbH and Nextcloud contributors
# SPDX-License-Identifier: MIT
name: Dependabot
@ -21,7 +24,7 @@ concurrency:
jobs:
auto-approve-merge:
if: github.actor == 'dependabot[bot]'
if: github.actor == 'dependabot[bot]' || github.actor == 'renovate[bot]'
runs-on: ubuntu-latest-low
permissions:
# for hmarr/auto-approve-action to approve PRs

View File

@ -1,3 +1,15 @@
# This workflow is provided via the organization template repository
#
# https://github.com/nextcloud/.github
# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization
# SPDX-FileCopyrightText: 2023-2024 Nextcloud GmbH and Nextcloud contributors
# SPDX-FileCopyrightText: 2023 Marcel Klehr <mklehr@gmx.net>
# SPDX-FileCopyrightText: 2023 Joas Schilling <213943+nickvergessen@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 Daniel Kesselberg <mail@danielkesselberg.de>
# SPDX-FileCopyrightText: 2023 Florian Steffens <florian.steffens@nextcloud.com>
# SPDX-License-Identifier: MIT
name: 'Ask for feedback on PRs'
on:
schedule:
@ -5,25 +17,25 @@ on:
jobs:
pr-feedback:
runs-on: ubuntu-22.04
runs-on: ubuntu-latest
steps:
- name: The get-github-handles-from-website action
uses: marcelklehr/get-github-handles-from-website-action@a739600f6b91da4957f51db0792697afbb2f143c # v1.0.0
id: scrape
with:
website: 'https://nextcloud.com/team/'
- uses: marcelklehr/pr-feedback-action@601109aa729eb4c8d6d0ece7567b9d4901db4aef
- uses: marcelklehr/pr-feedback-action@1883b38a033fb16f576875e0cf45f98b857655c4
with:
feedback-message: |
Hello there,
Thank you so much for taking the time and effort to create a pull request to our Nextcloud project.
We hope that the reviewing process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR reviewing process.
We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process.
Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6
Thank you for contributing to Nextcloud and we hope to hear from you soon!
days-before-feedback: 14
start-date: "2023-07-10"
exempt-authors: "${{ steps.scrape.outputs.users }}"
exempt-authors: "${{ steps.scrape.outputs.users }},nextcloud-command,nextcloud-android-bot,skjnldsv,datenangebot"
exempt-bots: true

View File

@ -32,6 +32,7 @@ use OCA\UserStatus\Service\StatusService as UserStatusService;
use OCP\AppFramework\Db\DoesNotExistException;
use OCP\AppFramework\Utility\ITimeFactory;
use OCP\Calendar\IManager;
use OCP\DB\Exception;
use OCP\ICache;
use OCP\ICacheFactory;
use OCP\IUser as User;
@ -72,7 +73,18 @@ class StatusService {
}
if(empty($calendarEvents)) {
$this->userStatusService->revertUserStatus($userId, IUserStatus::MESSAGE_CALENDAR_BUSY);
try {
$this->userStatusService->revertUserStatus($userId, IUserStatus::MESSAGE_CALENDAR_BUSY);
} catch (Exception $e) {
if ($e->getReason() === Exception::REASON_UNIQUE_CONSTRAINT_VIOLATION) {
// A different process might have written another status
// update to the DB while we're processing our stuff.
// We cannot safely restore the status as we don't know which one is valid at this point
// So let's silently log this one and exit
$this->logger->debug('Unique constraint violation for live user status', ['exception' => $e]);
return;
}
}
$this->logger->debug('No calendar events found for status check', ['user' => $userId]);
return;
}
@ -118,7 +130,18 @@ class StatusService {
});
if(empty($applicableEvents)) {
$this->userStatusService->revertUserStatus($userId, IUserStatus::MESSAGE_CALENDAR_BUSY);
try {
$this->userStatusService->revertUserStatus($userId, IUserStatus::MESSAGE_CALENDAR_BUSY);
} catch (Exception $e) {
if ($e->getReason() === Exception::REASON_UNIQUE_CONSTRAINT_VIOLATION) {
// A different process might have written another status
// update to the DB while we're processing our stuff.
// We cannot safely restore the status as we don't know which one is valid at this point
// So let's silently log this one and exit
$this->logger->debug('Unique constraint violation for live user status', ['exception' => $e]);
return;
}
}
$this->logger->debug('No status relevant events found, skipping calendar status change', ['user' => $userId]);
return;
}