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/gitlab: Fix databaseCreateLocally evaluation and operation #69344

Merged
merged 2 commits into from
Oct 8, 2019

Conversation

talyz
Copy link
Contributor

@talyz talyz commented Sep 24, 2019

Motivation for this change

Currently, as long as the services.gitlab.databaseCreateLocally option is set to true, the default, we create a local database, even if the services.gitlab.databaseHost option is set, indicating that we're not going to connect to the local database. We also assert that services.gitlab.user and services.gitlab.databaseUsername are equal, which in actuality only matters when services.gitlab.databaseHost is set to its default value "". This issue was raised in #68841.

Even worse, setting services.gitlab.databaseCreateLocally to false results in an evaluation failure unless services.postgresql.enable is set to true either manually or by another module.

This fixes both of these issues and needs to be ported to 19.09.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nix-review --run "nix-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.
Notify maintainers

cc @aanderse @flokli @globin @mawis

Sorry, something went wrong.

Copy link
Member

@globin globin left a comment

Choose a reason for hiding this comment

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

Fine except for style nitpick

Verified

This commit was signed with the committer’s verified signature. The key has expired.
thoughtpolice Austin Seipp
config.services.postgresql.package is only defined when the postgresql
service is activated, which means we fail to evaluate when
databaseCreateLocally == false. Fix this by using the default
postgresql package when the postgresql service is disabled.
Make sure that we don't create a database if we're not going to
connect to it. Also, fix the assertion that usernames be equal to only
trig when peer authentication is used (databaseHost == "").
@talyz talyz force-pushed the gitlab-create-database branch from d99b88a to 58a7502 Compare September 24, 2019 13:24
@ofborg ofborg 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/` 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux labels Sep 24, 2019
@ghost
Copy link

ghost commented Oct 1, 2019

Can this be merged? @globin

@globin globin merged commit b5449e6 into NixOS:master Oct 8, 2019
@talyz talyz deleted the gitlab-create-database branch October 9, 2019 06:54
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: 0 This PR does not cause any packages to rebuild on Linux
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants