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

redmine: refactor, cleanup, bug fix, and add functionality #48189

Merged
merged 4 commits into from Oct 11, 2018

Conversation

aanderse
Copy link
Member

This PR is an attempt to fix the deficiencies in Redmine on NixOS as it stands in 18.09.

My hope is that since prior to 18.09 Redmine had been marked broke for several versions and I'm sure no one else is using it except myself these changes can be back ported to 18.09 at some point.

  • added package option to specify which version of redmine

  • added themes option back in to allow specifying redmine themes

  • added plugins option back in to allow specifying redmine plugins

  • added database.socket option to allow mysql unix socket authentication

  • added port option to allow specifying the port rails runs on

  • cleaned up Gemfile so it is much less hacky

  • switched to ruby version 2.4 by default as suggested by documentation http://www.redmine.org/projects/redmine/wiki/redmineinstall#Installing-Redmine

  • fixed an annoyance (bug) in the service causing recursive symlinks

  • fixed ownership bug on log files generated by redmine

  • updates reflecting renames in nixos options

  • added a nixos test

Motivation for this change
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 nox --run "nox-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)
  • Fits CONTRIBUTING.md.

- added package option to specify which version of redmine
- added themes option back in to allow specifying redmine themes
- added plugins option back in to allow specifying redmine plugins
- added database.socket option to allow mysql unix socket authentication
- added port option to allow specifying the port rails runs on

- cleaned up Gemfile so it is much less hacky
- switched to ruby version 2.4 by default as suggested by documentation http://www.redmine.org/projects/redmine/wiki/redmineinstall#Installing-Redmine
- fixed an annoyance (bug) in the service causing recursive symlinks
- fixed ownership bug on log files generated by redmine
- updates reflecting renames in nixos options

- added a nixos test
@aanderse
Copy link
Member Author

aanderse commented Oct 11, 2018

@7c6f434c Regarding #45353 (comment)
Finally getting back to this now. As promised a NixOS test.

@7c6f434c
Copy link
Member

@GrahamcOfBorg test redmine

@GrahamcOfBorg
Copy link

No attempt on aarch64-linux (full log)

The following builds were skipped because they don't evaluate on aarch64-linux: tests.redmine

Partial log (click to expand)

while evaluating anonymous function at /var/lib/gc-of-borg/nix-test-rs-14/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/grahamc-aarch64-community-14/lib/types.nix:277:86, called from /var/lib/gc-of-borg/nix-test-rs-14/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/grahamc-aarch64-community-14/lib/attrsets.nix:335:15:
while evaluating the attribute 'optionalValue' at /var/lib/gc-of-borg/nix-test-rs-14/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/grahamc-aarch64-community-14/lib/modules.nix:376:5:
while evaluating the attribute 'values' at /var/lib/gc-of-borg/nix-test-rs-14/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/grahamc-aarch64-community-14/lib/modules.nix:362:9:
while evaluating the attribute 'values' at /var/lib/gc-of-borg/nix-test-rs-14/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/grahamc-aarch64-community-14/lib/modules.nix:458:7:
while evaluating anonymous function at /var/lib/gc-of-borg/nix-test-rs-14/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/grahamc-aarch64-community-14/lib/modules.nix:348:28, called from /var/lib/gc-of-borg/nix-test-rs-14/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/grahamc-aarch64-community-14/lib/modules.nix:348:17:
while evaluating 'dischargeProperties' at /var/lib/gc-of-borg/nix-test-rs-14/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/grahamc-aarch64-community-14/lib/modules.nix:416:25, called from /var/lib/gc-of-borg/nix-test-rs-14/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/grahamc-aarch64-community-14/lib/modules.nix:349:62:
while evaluating the attribute 'value' at /var/lib/gc-of-borg/nix-test-rs-14/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/grahamc-aarch64-community-14/lib/types.nix:282:55:
while evaluating the attribute 'dkuk-redmine_alex_skin' at /var/lib/gc-of-borg/nix-test-rs-14/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/grahamc-aarch64-community-14/nixos/tests/redmine.nix:26:9:
access to URI 'https://bitbucket.org/dkuk/redmine_alex_skin/get/1842ef675ef3.zip' is forbidden in restricted mode

@GrahamcOfBorg
Copy link

No attempt on x86_64-linux (full log)

The following builds were skipped because they don't evaluate on x86_64-linux: tests.redmine

Partial log (click to expand)

while evaluating the attribute 'values' at /var/lib/gc-of-borg/nix-root/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/gleber-bastion/lib/modules.nix:362:9:
while evaluating the attribute 'values' at /var/lib/gc-of-borg/nix-root/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/gleber-bastion/lib/modules.nix:458:7:
while evaluating anonymous function at /var/lib/gc-of-borg/nix-root/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/gleber-bastion/lib/lists.nix:103:41, called from /var/lib/gc-of-borg/nix-root/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/gleber-bastion/lib/modules.nix:458:16:
while evaluating anonymous function at /var/lib/gc-of-borg/nix-root/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/gleber-bastion/lib/lists.nix:103:41, called from /var/lib/gc-of-borg/nix-root/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/gleber-bastion/lib/modules.nix:348:17:
while evaluating anonymous function at /var/lib/gc-of-borg/nix-root/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/gleber-bastion/lib/modules.nix:348:28, called from undefined position:
while evaluating 'dischargeProperties' at /var/lib/gc-of-borg/nix-root/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/gleber-bastion/lib/modules.nix:416:25, called from /var/lib/gc-of-borg/nix-root/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/gleber-bastion/lib/modules.nix:349:62:
while evaluating the attribute 'value' at /var/lib/gc-of-borg/nix-root/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/gleber-bastion/lib/types.nix:282:55:
while evaluating the attribute 'dkuk-redmine_alex_skin' at /var/lib/gc-of-borg/nix-root/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/gleber-bastion/nixos/tests/redmine.nix:26:9:
access to URI 'https://bitbucket.org/dkuk/redmine_alex_skin/get/1842ef675ef3.zip' is forbidden in restricted mode

@aanderse
Copy link
Member Author

@7c6f434c Would you recommend I ship those 2 external files with the test?

For my understanding... does the test not build because no network access in sandbox mode, or another reason? I checked off "tested using sandboxing" because I read 18.09 turn that value to on by default. Was I correct go check off that point?

nixos/tests/redmine.nix Outdated Show resolved Hide resolved
@7c6f434c
Copy link
Member

@GrahamcOfBorg test redmine

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: tests.redmine

Partial log (click to expand)

machine: exit status 1
syncing
machine: running command: sync
machine: exit status 0
test script finished in 214.93s
cleaning up
killing machine (pid 597)
vde_switch: EOF on stdin, cleaning up and exiting
vde_switch: Could not remove ctl dir '/build/vde1.ctl': Directory not empty
/nix/store/b446bs7ghdh9xwpgmzmxc6s0qk1imrhh-vm-test-run-redmine

@GrahamcOfBorg
Copy link

Timed out, unknown build status on aarch64-linux (full log)

Attempted: tests.redmine

Partial log (click to expand)

cannot build derivation '/nix/store/h72c98qwzifg9qi18fbjx35b2w70zdvk-unit-redmine.service.drv': 2 dependencies couldn't be built
cannot build derivation '/nix/store/0na68pngr6dps7fa6flyxpxm2fp48zlq-system-units.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/zbfw0is8xmg4yc9hb3w5i8h2idhr0h11-etc.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/fhpw2f9cx607r036jnxkvpkf0hgxjqxp-nixos-system-machine-19.03.git.604f565.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/xwqc4rdr9wfjclq0p8pr5piwq9wmwmx4-closure-info.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/k42s17vm2kkpsa5djzfvlp1ixlfq5bmn-run-nixos-vm.drv': 2 dependencies couldn't be built
cannot build derivation '/nix/store/qhsika3av2kwm52w29iv6x3a00wjph37-nixos-vm.drv': 2 dependencies couldn't be built
cannot build derivation '/nix/store/b24608wmmilbsgvdaglpslyxga02dd5c-nixos-test-driver-redmine.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/k2zv7x5kivvzkagjkvvv01aw4zv37llr-vm-test-run-redmine.drv': 1 dependencies couldn't be built
error: build of '/nix/store/k2zv7x5kivvzkagjkvvv01aw4zv37llr-vm-test-run-redmine.drv' failed

@7c6f434c 7c6f434c merged commit a296033 into NixOS:master Oct 11, 2018
@aanderse
Copy link
Member Author

@7c6f434c Thank you for your help! Would you be willing to backport to 18.09 as well?

@7c6f434c
Copy link
Member

Hm. This is supposed to be fully compatible configuration-wise?

@aanderse
Copy link
Member Author

Hm. This is supposed to be fully compatible configuration-wise?

Yes. No options removed, only added. Will be compatible with existing configurations. On top of that Redmine was marked broken before 18.09 so I'm pretty sure I'll be the only person using this on 18.09 currently.

7c6f434c added a commit that referenced this pull request Oct 11, 2018
redmine: refactor, cleanup, bug fix, and add functionality
(cherry picked from commit a296033)
@7c6f434c
Copy link
Member

Good point about broken. Cherry-picked into 1a75f83 — is this all that is needed?

@aanderse
Copy link
Member Author

Fantastic. That should do it.

Thanks again!

@aanderse aanderse deleted the redmine branch October 11, 2018 18:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants