Skip to content

groupware: upgrade Stalwart to 1.2.0 and stalwart-cli to 2.0.0 - #4127

Open
tammi-23 wants to merge 1 commit into
groupwarefrom
chore/groupware-upgrade-stalwart-1
Open

tammi-23 wants to merge 1 commit into
groupwarefrom
chore/groupware-upgrade-stalwart-1

Conversation

@tammi-23

Copy link
Copy Markdown
Contributor

Description

Upgrades Stalwart from 0.16.27 to 1.2.0 and stalwart-cli from 1.0.13 to 2.0.0, for the integration tests (pkg/jmaptest) and for opencloud_full:

  1. Configuration snapshots converted to the Stalwart 1.x schema (jmap_stalwart.go, opencloud_full/config/stalwart/idmldap.json): renamed fields (e.g. tlsImplicit → implicitTls, isEnabled → enable, passwordMinLength → minPasswordLength), permissions that no longer exist in 1.x removed, and the permissions added in 1.x (mail rules, junk e-mail lists, calendar settings, passkeys, …) added to the roles. The opencloud_full snapshot is now written as upsert by stalwart-cli 2.0, so stalwart-snapshot-passwords handles upsert as well.
  2. New volume stalwart-data-v1 in opencloud_full: Stalwart 1.x can't start on the data of 0.16, so existing setups get a fresh, initialized Stalwart; DEVELOPER.md explains how to remove the old volume.
  3. mayAdmin → mayShare in AddressBookRights and CalendarRights (pkg/jmap): Stalwart 1.x follows RFC 9610 and the current JMAP Calendars draft, rejects mayAdmin in shareWith (Invalid permission "mayAdmin") and reports mayShare in myRights. Before, sharing address books and calendars failed and myRights always reported the right as false. ⚠️ This renames the property in the Groupware API responses as well; the web apps don't use it. TaskRights is unchanged, as tasks are mocked.
  4. Tests adapted to Stalwart 1.x behaviour (pkg/jmaptest):
    • the test users are created with the alias property enable instead of enabled
    • sortOrder of the generated address books and calendars is a 16 bit value, Stalwart 1.x rejects the 64 bit random values (it fails from about 2^31 on, JMAP allows up to 2^53-1)
    • the query limit is only asserted when it is returned, Stalwart 1.x only returns it when it used a different limit (RFC 8620 section 5.5)
    • the keywords $hasattachment and $hasnoattachment, which Stalwart 1.x adds to every email by itself, are ignored when comparing keywords

AI assistance: Claude Code (claude-opus-5-5) was used to convert the snapshots, find and fix the Stalwart 1.x incompatibilities and run the tests.

Related Issue

Motivation and Context

The web development environment moves to Stalwart 1.2.0. The Groupware backend should be tested against the same Stalwart version, and sharing address books and calendars needs the mayShare fix to work with Stalwart 1.x.

How Has This Been Tested?

  • test environment: macOS, Go 1.26.4, Docker Desktop
  • test case 1: go build ./pkg/... ./services/groupware/... and go vet on pkg/jmap, pkg/jmaptest, services/groupware/pkg/groupware
  • test case 2: unit tests of pkg/jmap, pkg/jscalendar and pkg/jscontact pass
  • test case 3: Stalwart integration tests against 1.2.0 (go test -p 1 ./pkg/jmaptest/... ./services/groupware/...): all pass, 3 out of 3 runs, TestEmails additionally 5 out of 5 runs. In earlier runs an unrelated 401 when fetching the session of a random test user and a TestGroupwareVacation failure occurred once each and couldn't be reproduced afterwards.
  • test case 4: opencloud_full snapshot applied with stalwart-cli 2.0.0 to a fresh Stalwart 1.2.0 volume: 7 updated, 17 created, 0 failed, Stalwart starts in production mode and is healthy
  • test case 5: web apps (mail, contacts, calendar) against Stalwart 1.2.0 with an OpenCloud image from an earlier groupware state: mailboxes, address books and calendars load, events can be created. Not tested with an image built from this branch.

Screenshots (if appropriate):

n/a

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Technical debt
  • Tests only (no source changes)

Checklist:

  • Code changes
  • Unit tests added
  • Acceptance tests added
  • Documentation added

- jmaptest and opencloud_full: Stalwart 0.16.27 -> 1.2.0, stalwart-cli
  1.0.13 -> 2.0.0, configuration snapshots converted to the v1 schema
  with the role permissions added in 1.x
- opencloud_full: use the new volume stalwart-data-v1, as Stalwart 1.x
  can't start on the data of 0.16
- jmap: rename mayAdmin to mayShare in the address book and calendar
  rights (RFC 9610), Stalwart 1.x rejects mayAdmin in shareWith
- jmaptest: adapt the tests to Stalwart 1.x (sortOrder range, optional
  query limit, attachment keywords set by the server)

Assisted-by: Claude Code:claude-opus-5-5
@tammi-23 tammi-23 added Type:Bug Type:Maintenance E.g. technical debt, packaging, etc. Status:Needs-Review labels Nov 25, 2026
@tammi-23 tammi-23 self-assigned this Nov 25, 2026
@codacy-production

codacy-production Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 complexity

Metric Results
Complexity 0

View in Codacy

🟢 Coverage 0.00% diff coverage · +0.00% coverage variation

Metric Results
Coverage variation ✅ +0.00% coverage variation (-1.00%)
Diff coverage ✅ 0.00% diff coverage

View coverage diff in Codacy

Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (f626a77) Report Missing Report Missing Report Missing
Head commit (f3f0be7) 106035 (+0) 26712 (+0) 25.19% (+0.00%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#4127) 2 0 0.00%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

1 Codacy didn't receive coverage data for the commit, or there was an error processing the received data. Check your integration for errors and validate that your coverage setup is correct.

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Status:Needs-Review Type:Bug Type:Maintenance E.g. technical debt, packaging, etc.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant