Bug 296698 - www/gitlab: gitlab 19.1.1 does not work correctly with current version of rubygem js-routes (2.4.1)
Summary: www/gitlab: gitlab 19.1.1 does not work correctly with current version of rub...
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: Matthias Fechner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2026-07-11 16:28 UTC by peter.sopko+freebsd.org
Modified: 2026-07-12 12:20 UTC (History)
1 user (show)

See Also:
bugzilla: maintainer-feedback? (mfechner)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description peter.sopko+freebsd.org 2026-07-11 16:28:26 UTC
gitlab 19.1.1 (the current version in ports tree) states in its Gemfile that it requires js-routes ~> 2.3 (i.e. 2.3 or more), which is not exactly correct, as with 2.4.x version of js-routes gem the gitlab:js:routes rake command does not correctly replace all neccessary routings from __route to __jsr (as js-routes after commit 935d55b [https://github.com/railsware/js-routes/commit/935d55ba6e32bf1d0fd5c939f98c33023e785d74] (it's hard to tell exact version, as CHANGELOG does not mention this change specifically, but I suppose it is since 2.4.x) no longer uses __route__ but __route), which causes (after running rake gitlab:compile:assets) javascript console errors and non-working views (dashboard/projects, dashboard/groups, ...). 
Of course this is more of an upstream problem (gitlab should either adapt to new js-routes behaviour, or at least stick to 2.3.7 version of js-routes gem exactly until they do so), but since js-routes 2.4.x is already out and also in the freebsd ports tree and there is no separate port for js-routes 2.3, this has become also a freebsd issue.

A workaround for now is to after install/update of gitlab to remove the rubygem-js-routes that has been installed from ports/pkg, install the gem manually and afterwards clean gitlab assets (if they have been compiled with js-routes 2.4.x gem already), re-generate routes and compile assets. 

> pkg delete -f rubygem-js-routes
> gem install js-routes -v 2.3.7
> su -l git -c "cd /usr/local/www/gitlab && RAILS_ENV=production NODE_ENV=production USE_DB=false SKIP_STORAGE_VALIDATION=true NODE_OPTIONS='--max_old_space_size=8192' bundle exec rake gitlab:assets:clean"
> su -l git -c "cd /usr/local/www/gitlab && RAILS_ENV=production NODE_ENV=production USE_DB=false SKIP_STORAGE_VALIDATION=true NODE_OPTIONS='--max_old_space_size=8192' bundle exec rake gitlab:js:routes"
> su -l git -c "cd /usr/local/www/gitlab && RAILS_ENV=production NODE_ENV=production USE_DB=false SKIP_STORAGE_VALIDATION=true NODE_OPTIONS='--max_old_space_size=8192' bundle exec rake gitlab:assets:compile"
Comment 1 Matthias Fechner freebsd_committer freebsd_triage 2026-07-12 06:57:31 UTC
Thank you very much, I currently search for a problem with the 19.1.2 version and found the same problem like you reported here.

Thanks for spotting to the root cause.
I just try a fix to test if that fixes the issue.
Comment 2 commit-hook freebsd_committer freebsd_triage 2026-07-12 08:24:54 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=c49ba7cf5ca1e8e12c8ff76f96f232c7ee448084

commit c49ba7cf5ca1e8e12c8ff76f96f232c7ee448084
Author:     Matthias Fechner <mfechner@FreeBSD.org>
AuthorDate: 2026-07-12 07:08:08 +0000
Commit:     Matthias Fechner <mfechner@FreeBSD.org>
CommitDate: 2026-07-12 08:23:50 +0000

    www/gitlab: fix regression from d747b3e47669abac14d4808212f48455fbe3f3fe

    www/rubygem-js-routes 2.4.x includes in incompatible API change which
    breaks gitlab at runtime while e.g. loading projects.
    The problem only appears if the asset for gitlab are recompiled with
    this new version which makes it harder to spot the problem.

    I will follow up the issue here:
    https://gitlab.com/gitlab-org/gitlab/-/work_items/605464

    Thanks a lot to Peter for finding the cause of that problem!

    PR:             296698

 www/Makefile                                 |  1 +
 www/gitlab/Makefile                          |  2 +-
 www/rubygem-js-routes-gitlab/Makefile (new)  | 20 ++++++++++++++++++++
 www/rubygem-js-routes-gitlab/distinfo (new)  |  3 +++
 www/rubygem-js-routes-gitlab/pkg-descr (new) |  2 ++
 5 files changed, 27 insertions(+), 1 deletion(-)
Comment 3 Matthias Fechner freebsd_committer freebsd_triage 2026-07-12 08:29:04 UTC
Thanks again for your report spotting to the cause of the problem and providing the fix!
Comment 4 commit-hook freebsd_committer freebsd_triage 2026-07-12 12:20:34 UTC
A commit in branch 2026Q3 references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=c2b2344c250c9a304a807f74220c4329b5eb9ffb

commit c2b2344c250c9a304a807f74220c4329b5eb9ffb
Author:     Matthias Fechner <mfechner@FreeBSD.org>
AuthorDate: 2026-07-12 07:08:08 +0000
Commit:     Matthias Fechner <mfechner@FreeBSD.org>
CommitDate: 2026-07-12 12:19:36 +0000

    www/gitlab: fix regression from d747b3e47669abac14d4808212f48455fbe3f3fe

    www/rubygem-js-routes 2.4.x includes in incompatible API change which
    breaks gitlab at runtime while e.g. loading projects.
    The problem only appears if the asset for gitlab are recompiled with
    this new version which makes it harder to spot the problem.

    I will follow up the issue here:
    https://gitlab.com/gitlab-org/gitlab/-/work_items/605464

    Thanks a lot to Peter for finding the cause of that problem!

    PR:             296698
    (cherry picked from commit c49ba7cf5ca1e8e12c8ff76f96f232c7ee448084)

 www/Makefile                                 |  1 +
 www/gitlab/Makefile                          |  2 +-
 www/rubygem-js-routes-gitlab/Makefile (new)  | 20 ++++++++++++++++++++
 www/rubygem-js-routes-gitlab/distinfo (new)  |  3 +++
 www/rubygem-js-routes-gitlab/pkg-descr (new) |  2 ++
 5 files changed, 27 insertions(+), 1 deletion(-)