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: squash systemd-tmpfiles warning #376838

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

numinit
Copy link
Contributor

@numinit numinit commented Jan 26, 2025

There was a systemd-tmpfiles warning about not being able to remove the 'plugins' directory. Squash this warning through removal of unnecessary systemd-tmpfiles options, and write a test for it.

Add the {option}services.mattermost.pluginsBundle option to allow overriding the plugin directory and also using it for tests. Update wording in option documentation so it is more clear.

Make the tests go faster by pipelining shutdowns of nodes.

Followup to #208181 which introduced these minor nits.

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • 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/)
  • 25.05 Release Notes (or backporting 24.11 and 25.05 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
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@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 Jan 26, 2025
@numinit numinit force-pushed the mattermost/misc-cleanups branch 2 times, most recently from 32e542e to 8c8385a Compare January 26, 2025 00:40
@github-actions github-actions bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 1-10 labels Jan 26, 2025
@numinit numinit force-pushed the mattermost/misc-cleanups branch from 8c8385a to d5eca8b Compare January 26, 2025 00:50
There was a systemd-tmpfiles warning about not being able to remove the
'plugins' directory. Squash this warning through removal of unnecessary
systemd-tmpfiles options, and write a test for it.

Add the {option}`services.mattermost.pluginsBundle` option to allow
overriding the plugin directory and also using it for tests. Update
wording in option documentation so it is more clear.

Make the tests go faster by pipelining shutdowns of nodes.
@numinit numinit force-pushed the mattermost/misc-cleanups branch from d5eca8b to 4bd073f Compare January 26, 2025 00:52
@@ -756,7 +767,7 @@ in
"d= ${tempDir} 0750 ${cfg.user} ${cfg.group} - -"

# Ensure that pluginDir is a directory, as it could be a symlink on prior versions.
"r- ${pluginDir} - - - - -"
Copy link
Contributor Author

@numinit numinit Jan 26, 2025

Choose a reason for hiding this comment

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

These r- caused the warning ("unable to remove..."). d= will make sure they're a directory instead of a symlink to one.

with pkgs;
map (
plugin:
stdenv.mkDerivation {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

No CC needed in these, and we can symlink prior to repacking.

mostlyMutableToplevel: str, mostlyMutable,
def switch_to_specialisation(node, toplevel: str, specialisation: str):
print(f"switch_to_specialisation({node.name!r}, {toplevel!r}, {specialisation!r})", file=sys.stderr)
node.succeed(f"{toplevel}/specialisation/{specialisation}/bin/switch-to-configuration switch || true")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

For a variety of reasons, the config switch can fail for unrelated reasons to Mattermost if we're on unstable, but Mattermost may still restart. We should just wait for it to come up.

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: module (update) This PR changes an existing module in `nixos/` 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 1-10
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant