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

nixos/mattermost: Clean up, modernize, support MySQL, support mmctl, and support plugin building #208181

Merged
merged 6 commits into from
Jan 20, 2025

Conversation

numinit
Copy link
Contributor

@numinit numinit commented Dec 29, 2022

Description of changes

nixpkgs deserves a Mattermost module that uses more up to date best practices!

Taking ideas from #198040, we should support more complex database configurations and better defaults like peer authentication.

Enable mmctl and the Mattermost test suite (~17000 tests).

Support building Mattermost plugins in the sandbox (couple examples are in the test suite).

Things done
  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 22.05 Release Notes (or backporting 21.11 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
    • (Release notes changes) Ran nixos/doc/manual/md-to-db.sh to update generated release notes
  • Fits CONTRIBUTING.md.

@numinit numinit requested a review from Kranzes December 29, 2022 02:45
@github-actions github-actions bot added 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` labels Dec 29, 2022
@numinit numinit force-pushed the mattermost-refactor branch from 6b42e85 to 0228f5c Compare December 29, 2022 02:50
@numinit
Copy link
Contributor Author

numinit commented Dec 29, 2022

See the tests for an example of how to add and enable a plugin.

@ofborg ofborg bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 1-10 labels Dec 29, 2022
@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/prs-ready-for-review/3032/1619

@Kranzes
Copy link
Member

Kranzes commented Dec 29, 2022

To have a truly immutable plugins install & enable functionality we will need to patch Mattermost's source code. But for now this is fine I guess...

@numinit numinit marked this pull request as draft March 5, 2023 00:43
@numinit
Copy link
Contributor Author

numinit commented Mar 5, 2023

Haven't forgotten about this. I think the strategy will be to use the current Mattermost module as a reference to re-add the missing features.

@SuperSandro2000 SuperSandro2000 removed their assignment Feb 3, 2024
@numinit numinit mentioned this pull request Feb 26, 2024
13 tasks
@wegank wegank added 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md 2.status: merge conflict This PR has merge conflicts with the target branch labels Mar 19, 2024
@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Mar 20, 2024
@wegank wegank added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jul 4, 2024
@numinit numinit force-pushed the mattermost-refactor branch from 0228f5c to fac011b Compare October 22, 2024 06:07
@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Oct 22, 2024
@numinit numinit changed the title nixos/mattermost: Refactor, support plugins nixos/mattermost: Clean up and modernize Oct 22, 2024
@numinit numinit force-pushed the mattermost-refactor branch from fac011b to 52fc542 Compare October 22, 2024 07:09
@numinit
Copy link
Contributor Author

numinit commented Jan 19, 2025

Progress update on this: I've locally rebased against #373113, and made the tests take both ESR and latest into account. Once that PR closes, I'll rebase again and undraft, because it's looking like it's time.

I'm happy to report that all {unit,integration} tests on {patched,unpatched} webapps for {mutable,mostly mutable,immutable,environment file} configs work for Mattermost {ESR,latest} on {MySQL,Postgres}, including plugin builds and migrations from ESR to latest. Have to test on ARM64 a little more, but it's pretty promising. The tests that we have to disable are fairly consistently the ones that use SMTP and Elasticsearch, plus a handful that seem plain broken.

@numinit numinit force-pushed the mattermost-refactor branch 2 times, most recently from 2edb4aa to 7ad1bce Compare January 19, 2025 23:07
@github-actions github-actions bot added 10.rebuild-darwin: 1-10 and removed 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin labels Jan 19, 2025
@nix-owners nix-owners bot requested a review from fsagbuya January 19, 2025 23:10
@numinit
Copy link
Contributor Author

numinit commented Jan 19, 2025

Going to make sure there are no more ARM issues and then undraft.

Add the following passthrus:

- mattermost.withTests (builds with tests but takes a while)
- mattermost.withoutTests (builds without tests but is shorter)
- mattermost.tests.mattermostWithTests
- mattermost.buildPlugin (builds a plugin from source)

Enable the mmctl build, and its tests, if selected.
We don't have to run the full Mattermost/mmctl e2e test suite for this
derivation.
Based on NixOS#198040. Prioritizes backwards compatibility, including
database and plugin compatibility, while adding more sensible
defaults like database peer authentication.

Expand the scope of tests to include plugins (including building
from source) and testing that a piece of media uploads and downloads
to make sure the storage directory doesn't vanish.
@numinit numinit force-pushed the mattermost-refactor branch from 7ad1bce to be25f66 Compare January 20, 2025 00:00
@numinit numinit marked this pull request as ready for review January 20, 2025 01:49
@numinit
Copy link
Contributor Author

numinit commented Jan 20, 2025

We're good. All builds and tests, including NixOS tests, pass on both my Zen 4 EPYC box and the aarch64 community builder.

@fricklerhandwerk fricklerhandwerk merged commit 33986ca into NixOS:master Jan 20, 2025
29 of 31 checks passed
@numinit
Copy link
Contributor Author

numinit commented Jan 20, 2025

🎊 2 years in the making, thanks for the merge!

@fricklerhandwerk
Copy link
Contributor

fricklerhandwerk commented Jan 20, 2025

@numinit thanks a lot for sticking with it. Contributors like you are the true heroes of NixOS.

@numinit
Copy link
Contributor Author

numinit commented Jan 25, 2025

Very kind words @fricklerhandwerk - thank YOU for your tireless work on all things Nix too!

This merging meant that we were able to squash a Critical severity security bug in 48 hours thanks to the update script and a clean backport: #376561

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: changelog 8.has: clean-up 8.has: documentation This PR adds or changes documentation 8.has: module (update) This PR changes an existing module in `nixos/` 10.rebuild-darwin: 1-10 10.rebuild-linux: 1-10 11.by: package-maintainer This PR was created by the maintainer of the package it changes 12.approvals: 3+ This PR was reviewed and approved by three or more reputable people
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants