#502: Обновление v4.2.0

Инструкция

Подготовка

Для обновления на версию v4.2.0 проверьте, что в конфигурационном файле .env поставлена версия v4.2.0 или main (всегда обновляет на последнюю доступную стабильную версию):

~# grep VERSION .env
SW_FRONTEND_VERSION=v4.2.0
SW_BACKEND_VERSION=v4.2.0

или

~# grep VERSION .env
SW_FRONTEND_VERSION=main
SW_BACKEND_VERSION=main

ВАЖНО! Проверьте файл docker-compose.yml на соответствие следующим инструкциям!

Перед редактированием файла обязательно сделайте копию:

cp docker-compose.yml{,.back-`date +%Y%m%d%H%M%S`}

1. В файле ОТСУТСТВУЕТ секция celerybeat (если присутствует - удалите ее полностью):

  celerybeat:
    <<: *django
    restart: always
    depends_on:
      - postgres
      - redis
    command: /start-celerybeat
    labels:
      - "traefik.enable=false"

2. В секции cron присутствует строчка - swarmica_ugc:/swarmica/swarmica/attachments:z , то есть полностью секция выглядит вот так:

  cron:
    <<: *django
    restart: always
    depends_on:
      - postgres
      - redis
    command: /start-cron
    volumes:
      - ./.env:/etc/environment:ro
      - swarmica_articles:/swarmica/swarmica/article/:z
      - swarmica_cron_d:/etc/cron.d/:z
      - swarmica_ugc:/swarmica/swarmica/attachments:z
      - swarmica_runtime:/swarmica/swarmica/runtime_scripts/:z
    labels:
      - "traefik.enable=false"

Если строчка отсутствует, то добавьте ее, как указано в примере выше.

Обновление

Выполните обновление с перезагрузкой системы. Будет прерывание сервиса на несколько минут, рекомендуется выполнять обновление в часы, когда использование системы минимально:

docker compose pull
docker compose up -d --remove-orphans

После обновления

После того, как все контейнеры запустятся и сервис станет доступен через веб-интерфейс, выполните пост-апгрейдные шаги:

1. Запустите команду конвертации фильтров в формат, совместимый с v4.2.0:

docker exec --env-file .env -it swarmica-django-1 python manage.py migrate_filter_conditions

2. Запустите команду проверки и восстановление параметров сценариев ботов (если у вас используется Telegram, Whatsapp, VK):

docker exec --env-file .env -it swarmica-django-1 python manage.py restore_bot_scenario_parameters

3. Запустите команду пост-старт, чтобы обновить файлы статики, индексы поиска и выполнить другие необходимые процедуры:

docker exec --env-file .env -it swarmica-django-1 python manage.py post_start

Эта команда может занять долгое время, в зависимости от количества данных в системе.

4. Запустите команду простановки исторических данных по исходному каналу тикета:

docker exec --env-file .env -it swarmica-django-1 python manage.py migrate_ticket_source

5. После того, как все успешно обновлено и работоспособность проверена, можно удалить неиспользуемые данные docker для освобождения дискового пространства:

docker system prune -a

ВАЖНО! Убедитесь, что все контейнеры успешно запустились, перед запуском этой команды

Список изменений

Frontend

  • Feature #1300: Multiple choice for Assignee, Requester, Author, License Key, Timezone, Organization in Filters
  • Feature #1318: Article versions and ability to restore a specific revision
  • Feature #1367: Added refresh button for ticket, article, user, organization, license lists
  • Feature #1372: Added segments management to the settings
  • Feature #1373: Supported 'visibility' & 'segments' in article filters
  • Feature #1379: Improved the display of channels in lists & tickets
  • Feature #1388: Ability to manage published article visibility: all users, authorized only, only a specific segments
  • Bug #1325: Unable to delete list from a KCS article created from ticket
  • Bug #1334: Article editor shows article has changes even though it does not
  • Bug #1346: Fixed warning value prop should not be null for Date and Number custom field value editing widget
  • Bug #1348: Changed the 'Evaluate one more' button to 'Finish the evaluation'
  • Bug #1350: Show full date with time in lists
  • Bug #1351: Added style overrides when opening a modal popup on high resolution screens
  • Bug #1358: Fixed KCS Search appears on top of add comment form
  • Bug #1360: Light buttons appear blue when pressed
  • Bug #1363: Fixed typo in help for Brand KB Header field
  • Bug #1368: Fix Codeblock language selector in article editor
  • Bug #1374: Fixed 'Discard changes' button not clearing local changes
  • Bug #1381: Fixed cannot read properties of null (reading 'length') after merging a user with a blank name
  • Bug #1398: Fixed visibility widget misalignment and full article page refresh
  • Devops #1380: Add automatic sorting for locale files
  • Devops #1402: Rollback MDXEditor to version 3.0.5
  • Devops: Bump version to v4.2.0
  • Refactor #1330: Remove unnecessary filtration from target merge users state
  • Refactor #1359: Added event constants for ticket & user

Backend

  • Feature #1966: Implemented the logic for publishing articles to a segment.
  • Feature #1967: Exact query match search engine for Article and Ticket searches
  • Feature #1894: Added support for multiple selection for assignee, requester, license, author, organization in filter conditions, auto-assign, and exports.
  • Feature #1903: Implemented support for VK messages to community
  • Feature #1964: Added the ability to disable all notifications for the user, and added documentation for merging users.
  • Feature #1932: Added filters organization__isnull, uid__exclude for users API
  • Feature #1938: CLI tool to check and re-send ticket comment notifications
  • Feature #1942: Add default email channel for new requestors with email identity for tickets with no email channel
  • Feature #1942: Change email ticket channels on requester change
  • Feature #1948: Rewrite billing ids for user and organization on save
  • Feature #1951: Allow incoming emails without subject
  • Feature #1952: Added the source channel property for ticket, added source channel to filters and lists
  • Feature #1953: Added the isolated_channel scenario parameter and logic for Telegram
  • Feature #1961: Added error handlers and error message sending, as well as fixed authorization steps for VK bots
  • Feature #1971: Added restore_bot_scenario_parameters command and refactored bots scenario and parameter creation for Telegram, WhatsApp, and VK bots into a single method with a check for necessity creation
  • Feature #1972: Added property 'latest' to article revisions
  • Feature #1980: Added setting is_user_depended=True on Filter save when the condition value is a list and contains 'me' or 'my'
  • Feature billmanager6#16: Create tickets from billmanager with default priority
  • Feature billmanager6#17: Sync comment CSAT from billing
  • Bug #1927: Allowed merging users without an organization.
  • Bug #1933: Fixed Article annotate_t_links to prperly use provided date range
  • Bug #1940: Set enabled to False if channel is_deleted
  • Bug #1949: Allowed INTERNAL_USER for /api/chats/
  • Bug #1950: Fixed body_text to body_html|safe in html templates
  • Bug #1958: Fixed an error when deleting a chat message
  • Bug #1960: Disabled autoescaping for email template subject
  • Bug #1962: Fixed AttributeError when autoassign conditions is None
  • Bug #1968: Fixed Telegram session behavior during ticket merging, as well as refactored getting state and storage.
  • Bug #1973: Apply strip() to email subject and move WAITING_FOR_CODE state in VK bot to prevent incorrect code waiting
  • Bug #1974: Fixed build_queryset when getting me, my in the list and missing user
  • Bug #1976: Ensure latest is set when restoring article from revision by using serializer save, which calls bulk_create, to unify revision creation
  • Bug #1977: Fixed the code re-sending when the user sends new emails instead of the code during the registration process.
  • Bug #1978: Added sorting by visibility field for articles
  • Devops #1914: Removed celerybeat container
  • Refactor #1939: Optimized work with icontains and isnull, added constants to query_language

Известные проблемы

  • frontend#1395: При редактировании статей переносы строк внутри пунктов списков исчезают и несколько строк склеиваются в одну. При публикации / предпросмотре все выглядит корректно. Решение запланировано на обновление v4.2.1, как промежуточное решение можно:
    • Игнорировать некорректное отображение в редакторе
    • Использовать многоуровневые списки вместо простого переноса строк внутри списка
  • backend#1988: Команда migrate_ticket_source очень долго выполняется. Решение запланировано на обновление v4.2.1
  • backend#1982: При точном поиске удваивается статья, если совпадение есть и в заголовке и в теле статьи. Решение запланировано на обновление v4.2.1