Bug 208511 - www/gitlab: update to 8.6.5
Summary: www/gitlab: update to 8.6.5
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Kurt Jaeger
URL:
Keywords:
Depends on: 208507 208508 208509 208510
Blocks:
  Show dependency treegraph
 
Reported: 2016-04-04 13:09 UTC by Torsten Zühlsdorff
Modified: 2016-04-14 07:47 UTC (History)
4 users (show)

See Also:


Attachments
patch with update to 8.6.4 (68.13 KB, patch)
2016-04-04 13:09 UTC, Torsten Zühlsdorff
no flags Details | Diff
patch with update to 8.6.4 - v.2 (72.50 KB, patch)
2016-04-05 07:35 UTC, Torsten Zühlsdorff
no flags Details | Diff
patch with update to 8.6.4 - v.3 (72.99 KB, patch)
2016-04-05 14:49 UTC, Torsten Zühlsdorff
no flags Details | Diff
patch with update to 8.6.5 (73.29 KB, patch)
2016-04-08 10:48 UTC, Torsten Zühlsdorff
ports: maintainer-approval+
Details | Diff
gitlab.in diff, removing linuxisms (6.17 KB, patch)
2016-04-13 05:46 UTC, Johannes Jost Meixner
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Torsten Zühlsdorff 2016-04-04 13:09:00 UTC
Created attachment 168963 [details]
patch with update to 8.6.4

Hello,

attached a patch for bring GitLab to its new major version 8.6.4.

Buildtests are done for 9.3, 10.0, 10.1, 10.2 and 10.3 amd64 and i386. Also a test installation works fine.

I asked Michael Fausten and Johannes Meixner for an update test from 8.5 to 8.6 because both have running instances. If the feedback is positive i will set the approval flag for the patch. Till then all the dependencies can be processed ;)

Greetings,
Torsten
Comment 1 Johannes Jost Meixner freebsd_committer 2016-04-05 06:54:02 UTC
Building it right now, but here's something I stumbled over:

Satellites were removed prior to 8.6.4

https://about.gitlab.com/2015/10/27/gitlab-8-dot-1-dot-2-released/#comment-2331814217

So the line in Makefile to create them,
        ${MKDIR} ${STAGEDIR}/home/git/gitlab-satellites
and the line in pkg-plist to bring them into the package,
@dir(,git,750) /home/git/gitlab-satellites

are unnecessary
Comment 2 Johannes Jost Meixner freebsd_committer 2016-04-05 07:28:51 UTC
Please add the new dependencies you've attached to this PR
to www/gitlab/Makefile RUN_DEPENDS.
Comment 3 Torsten Zühlsdorff 2016-04-05 07:35:09 UTC
Created attachment 168994 [details]
patch with update to 8.6.4 - v.2

Stumpled accross the missing dependencies some minutes ago. Must have messed up the incomming remove of PORTSDIR -.-

Now the patch is updated. I also removed the satellites directory. I keep this for backwards compatibility, but since 8.5 is the first version of GitLab in the portstree, there seems no need for this.
Of course there could be user migrating to FreeBSD-GitLab (i hope so ;)), but it is long enough deprecated.
Comment 4 Johannes Jost Meixner freebsd_committer 2016-04-05 11:51:49 UTC
((In reply to Torsten Zühlsdorff from comment #3)
The joy of sending private emails . . . ;-)

Can you please bump the Gemfile patch for 

attr_encrypted, updated past Gitlab's Gemfile
https://svnweb.freebsd.org/ports?view=revision&revision=412331

and likewise carrierwave:
https://svnweb.freebsd.org/ports?view=revision&revision=412263

?

I suggest we use >= instead of ~>. While pessimistic versioning might be the more correct approach, given the way ports handle things we need to be able to live with dependencies being updated "at random".

Thanks
-J
Comment 5 Torsten Zühlsdorff 2016-04-05 14:49:15 UTC
Created attachment 169006 [details]
patch with update to 8.6.4 - v.3

Attached a patch which also covers the needed patches. I really had hoped, this is no longer needed, if gitlab is in the ports. :/

I also added a USE_RUBY=yes to allow a TEST with Ruby 2.2. The Issue Tracker states that there is support, while the documentation clearly say there is not. That is a bad situation. If the documentation is right gitlab is only available for people building their own ports and sticking with ruby 2.1. If not the documentation is wrong.

Please see the patch as a clear need-testing.
Comment 6 miks.mikelsons 2016-04-06 13:47:35 UTC
Git user need to be created with home directory defined with "/home/git" instead of "/usr/local/git"
Comment 7 Kurt Jaeger freebsd_committer 2016-04-07 18:50:57 UTC
testbuilds@work
Comment 8 Kurt Jaeger freebsd_committer 2016-04-07 19:34:45 UTC
Strange error, fails to build on current in poudriere:

===>   Installing existing package /packages/All/rubygem-omniauth-cas3-1.1.3.txz
[cur-default] Installing rubygem-omniauth-cas3-1.1.3...
pkg-static: Missing dependency 'ruby21-gems'

Failed to install the following 1 package(s): /packages/All/rubygem-omniauth-cas3-1.1.3.txz

For full log see http://people.freebsd.org/~pi/logs/www__gitlab-cur-1460055039.txt
Comment 9 Mathieu Arnold freebsd_committer 2016-04-07 22:09:54 UTC
(In reply to Kurt Jaeger from comment #8)
> Strange error, fails to build on current in poudriere:
> 
> ===>   Installing existing package
> /packages/All/rubygem-omniauth-cas3-1.1.3.txz
> [cur-default] Installing rubygem-omniauth-cas3-1.1.3...
> pkg-static: Missing dependency 'ruby21-gems'
> 
> Failed to install the following 1 package(s):
> /packages/All/rubygem-omniauth-cas3-1.1.3.txz
> 
> For full log see
> http://people.freebsd.org/~pi/logs/www__gitlab-cur-1460055039.txt

This seems unrelated, your rubygem-omniauth-cas3 package is somewhat strangely broken.
Comment 10 Kurt Jaeger freebsd_committer 2016-04-08 05:15:54 UTC
I re-rolled -cas3, seems to work now.
Comment 11 Torsten Zühlsdorff 2016-04-08 10:43:39 UTC
(In reply to miks.mikelsons from comment #6)

> Git user need to be created with home directory defined 
> with "/home/git" instead of "/usr/local/git"

That is a good catch, but sadly not enforced by the port. It is done by /usr/ports/UIDs and need to changed there. I would like you to create a PR for this, so that the relevant person can cope with this! :)
Comment 12 Torsten Zühlsdorff 2016-04-08 10:48:32 UTC
Created attachment 169102 [details]
patch with update to 8.6.5

Update the patch to 8.6.5.

The patch itself works. But i'm still not sure, if it works correctly with Ruby 2.2.
I'm currently build it one my laptop in an clean environment to check this.
Comment 13 Kurt Jaeger freebsd_committer 2016-04-08 13:09:39 UTC
Testbuilds@work
Comment 14 Kurt Jaeger freebsd_committer 2016-04-08 17:43:45 UTC
Testbuilds are all fine. Is is ready for the tree ? What about migration
from 8.5.x to this ? Any things a user has to consider ?
Comment 15 miks.mikelsons 2016-04-08 17:45:00 UTC
Is it possible to somehow include install instruction in port, so that do not depend on external url?
Comment 16 miks.mikelsons 2016-04-08 17:46:21 UTC
I also have some improvement/notes on install documentation. Where I need to put it?
Pull request on https://github.com/t-zuehlsdorff/gitlabhq/blob/8-6-docu/doc/install/installation-freebsd.md ?
Comment 17 Torsten Zühlsdorff 2016-04-09 19:55:51 UTC
(In reply to miks.mikelsons from comment #15)

> Is it possible to somehow include install instruction in port, 
> so that do not depend on external url?

There is already in patch in work by xmj@. But i will handle this as seperate issue because the update did not depends on this.
Also there is work/communication with the GitLab community to get the documentation into upstream :)

> I also have some improvement/notes on install documentation. 
> Where I need to put it?
> Pull request on https://github.com/t-zuehlsdorff/gitlabhq/blob/8-6-docu/doc/install/installation-freebsd.md ?

Yes, that is currently the right place, thank you! :)

@Kurt: the update is not tested fully. If done i will set the maintainer-approv flag to +. Without the flag please consider the patch as not ready and need test.
Comment 18 miks.mikelsons 2016-04-09 20:05:57 UTC
There is problem with gitlab starting on boot. I have same problem as mentioned there https://forums.freebsd.org/threads/54631/.
When starting with "service gitlab start" it's working, but not on boot.
Comment 19 Torsten Zühlsdorff 2016-04-11 07:31:46 UTC
(In reply to miks.mikelsons from comment #18)

> There is problem with gitlab starting on boot. 
> I have same problem as mentioned there https://forums.freebsd.org/threads/54631/.
> When starting with "service gitlab start" it's working, but not on boot.

Mh, that is a good catch. I think this could be through a dependency to a running redis.
I will research how to add a runtime dependency to the rc script.

Thanks for the report!
Comment 20 Johannes Jost Meixner freebsd_committer 2016-04-13 05:46:36 UTC
Created attachment 169275 [details]
gitlab.in diff, removing linuxisms

I've been able to rewrite the Gitlab rc.d script such that a few of the Linuxisms are removed, and that does the dependency handling.

Further, I've been able to test both `service gitlab restart` and having the gitlab rc.d script executed on (jail) startup.

Miks, could you please take this diff (based on ports/head aka Gitlab 8.5.5) for a spin?
Comment 21 Torsten Zühlsdorff 2016-04-13 16:02:31 UTC
Comment on attachment 169102 [details]
patch with update to 8.6.5

I now approve the patch after getting multiple positive feedback! :)

The provided patch for handling the startup-error will be processed later, since it has nothing to do with the update itself.
Comment 22 commit-hook freebsd_committer 2016-04-13 16:47:09 UTC
A commit references this bug:

Author: pi
Date: Wed Apr 13 16:46:44 UTC 2016
New revision: 413219
URL: https://svnweb.freebsd.org/changeset/ports/413219

Log:
  www/gitlab: 8.5.5 -> 8.6.5

  PR:		208511
  Submitted by:	Torsten Zuehlsdorff <ports@toco-domains.de> (maintainer)
  Reviewed by:	xmj, miks.mikelsons@gmail.com

Changes:
  head/www/gitlab/Makefile
  head/www/gitlab/distinfo
  head/www/gitlab/files/patch-Gemfile
  head/www/gitlab/files/patch-config_database.yml.postgresql
  head/www/gitlab/files/patch-config_gitlab.yml.example
  head/www/gitlab/files/patch-config_initializers_1__settings.rb
  head/www/gitlab/files/patch-config_unicorn.rb.example
  head/www/gitlab/files/patch-lib_support_nginx_gitlab
  head/www/gitlab/files/patch-lib_support_nginx_gitlab-ssl
  head/www/gitlab/pkg-message
  head/www/gitlab/pkg-plist
Comment 23 Kurt Jaeger freebsd_committer 2016-04-13 16:51:29 UTC
Keeping this PR open until https://bugs.freebsd.org/bugzilla/attachment.cgi?id=169275 is decided ?
Comment 24 miks.mikelsons 2016-04-13 20:24:25 UTC
(In reply to Johannes Jost Meixner from comment #20)

Your rc.d version is working correctly on server restart. Applied it on clean gitlab install.
Comment 25 miks.mikelsons 2016-04-13 20:32:17 UTC
(In reply to Torsten Zühlsdorff from comment #21)

Please, check my installation notes https://github.com/t-zuehlsdorff/gitlabhq/compare/8-6-docu...miks:8-6-docu.

IMO we need to make installation more streamlined, so after installation you only need to make/tweak your custom configs, not fighting to get gitlab running at all.

I noticed that for now gitlab is enforcing postgresql93 (because of databases/rubygem-pg).

Do I need to make patch for gitlab port or pull request for installation doc?
Comment 26 Torsten Zühlsdorff 2016-04-14 07:47:37 UTC
@Kurt:
I created an own PR for the rc-problem. Every issue its ticket. :)
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=208793

@Johannes:
Thank you for the patch. It fixes the issue, but i think it is to invasive. Removing linuxisms is a good think, but it makes it even more complicate to staying in sync with upstream. I want to stay as close as possible to the source.

@Miks:
I took a quick look at your documentation improvements. 

In short: the postgresql-catch is good, but the jail comment should be obsolete since 9.3. It could be 9.4 also, i'm not sure. There is no need for changing the home-dir or creating .ssh - this should be done automatically. Same for the uploads dir. If not this is a bug of the port and should be addressed by a PR. The bundle install is a nogo - the whole point of the port is to avoid this command because it causes various bad problems.

Where do you want to discuss the the points? Github, E-Mail or own PR? Just choose one and we will do it there. :)

I will close the PR since the update is there :)