git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #50962 from flokli/gitlab-updater

gitlab: 11.4.4 -> 11.5.0

commit2c2ab68672a34e7c226ff0c5ecf4d2e063ac5705 authorFlorian Klink <flokli@flokli.de> dateMon 26 Nov 2018, 18:47 (8 years ago) parent128a4466870eaf
15 files changed+554−267
nixos/tests/gitlab.nix+3−1 pkgs/applications/version-management/gitlab-shell/remove-hardcoded-locations.patch−27 pkgs/applications/version-management/gitlab-workhorse/deterministic-build.patch−11 pkgs/applications/version-management/gitlab/data.json+32 pkgs/applications/version-management/gitlab/default.nix+14−20 pkgs/applications/version-management/gitaly/Gemfile → pkgs/applications/version-management/gitlab/gitaly/Gemfile+11−6 pkgs/applications/version-management/gitaly/Gemfile.lock → pkgs/applications/version-management/gitlab/gitaly/Gemfile.lock+66−61 pkgs/applications/version-management/gitaly/default.nix → pkgs/applications/version-management/gitlab/gitaly/default.nix+2−2 pkgs/applications/version-management/gitaly/gemset.nix → pkgs/applications/version-management/gitlab/gitaly/gemset.nix+138−130 pkgs/applications/version-management/gitlab-shell/default.nix → pkgs/applications/version-management/gitlab/gitlab-shell/default.nix+2−2 pkgs/applications/version-management/gitlab/gitlab-shell/remove-hardcoded-locations.patch+45 pkgs/applications/version-management/gitlab-workhorse/default.nix → pkgs/applications/version-management/gitlab/gitlab-workhorse/default.nix+4−4 pkgs/applications/version-management/gitlab-workhorse/remove-hardcoded-paths.patch → pkgs/applications/version-management/gitlab/gitlab-workhorse/remove-hardcoded-paths.patch pkgs/applications/version-management/gitlab/update.py+234 pkgs/top-level/all-packages.nix+3−3
nixos/tests/gitlab.nix+3−1
@@ -16,6 +16,7 @@ import ./make-test.nix ({ pkgs, lib, ...} : with lib; {
1616
1717 services.nginx = {
1818 enable = true;
19+ recommendedProxySettings = true;
1920 virtualHosts = {
2021 "localhost" = {
2122 locations."/".proxyPass = "http://unix:/run/gitlab/gitlab-workhorse.socket";
@@ -75,7 +76,8 @@ import ./make-test.nix ({ pkgs, lib, ...} : with lib; {
7576 $gitlab->waitForUnit("gitlab.service");
7677 $gitlab->waitForUnit("gitlab-sidekiq.service");
7778 $gitlab->waitForFile("/var/gitlab/state/tmp/sockets/gitlab.socket");
78− $gitlab->waitUntilSucceeds("curl -sSf http://localhost/users/sign_in");
79+ $gitlab->waitUntilSucceeds("curl -sSf http://gitlab/users/sign_in");
80+ $gitlab->succeed("curl -isSf http://gitlab | grep -i location | grep -q http://gitlab/users/sign_in");
7981 $gitlab->succeed("${pkgs.sudo}/bin/sudo -u gitlab -H gitlab-rake gitlab:check 1>&2")
8082 '';
8183})
pkgs/applications/version-management/gitlab-shell/remove-hardcoded-locations.patchdeleted−27
@@ -1,27 +0,0 @@
1−diff --git a/go/internal/config/config.go b/go/internal/config/config.go
2−index c57b4de..88cfc95 100644
3−--- a/go/internal/config/config.go
4−+++ b/go/internal/config/config.go
5−@@ -27,7 +27,7 @@ func New() (*Config, error) {
6− }
7− cfg.RootDir = dir
8−
9−- configBytes, err := ioutil.ReadFile(path.Join(cfg.RootDir, configFile))
10−+ configBytes, err := ioutil.ReadFile("/run/gitlab/shell-config.yml")
11− if err != nil {
12− return nil, err
13− }
14−diff --git a/lib/gitlab_shell.rb b/lib/gitlab_shell.rb
15−index 1452f95..2b40327 100644
16−--- a/lib/gitlab_shell.rb
17−+++ b/lib/gitlab_shell.rb
18−@@ -180,7 +180,8 @@ class GitlabShell
19− end
20−
21− # We use 'chdir: ROOT_PATH' to let the next executable know where config.yml is.
22−- Kernel.exec(env, *args, unsetenv_others: true, chdir: ROOT_PATH)
23−+ # Except we don't, because we're already in the right directory on nixos!
24−+ Kernel.exec(env, *args, unsetenv_others: true)
25− end
26−
27− def api
pkgs/applications/version-management/gitlab-workhorse/deterministic-build.patchdeleted−11
@@ -1,11 +0,0 @@
1−--- a/Makefile 2018-10-08 12:45:15.206269937 +0200
2−+++ b/Makefile 2018-10-08 12:45:24.435366307 +0200
3−@@ -6,7 +6,7 @@
4− BIN_BUILD_DIR := $(TARGET_DIR)/bin
5− PKG_BUILD_DIR := $(TARGET_DIR)/src/$(PKG)
6− COVERAGE_DIR := $(TARGET_DIR)/cover
7−-VERSION := $(shell git describe)-$(shell date -u +%Y%m%d.%H%M%S)
8−+VERSION := 6.1.1
9− GOBUILD := go build -ldflags "-X main.Version=$(VERSION)"
10− EXE_ALL := gitlab-zip-cat gitlab-zip-metadata gitlab-workhorse
11− INSTALL := install
pkgs/applications/version-management/gitlab/data.jsonnew file+32
@@ -0,0 +1,32 @@
1+{
2+ "ce": {
3+ "version": "11.5.0",
4+ "repo_hash": "0cjkkap3n9g9zahrxk99a330ahyb6cvx97dsnrxcdsn0cbrsxsrb",
5+ "deb_hash": "0kn7mg1lk4gvc3x76z4rbh0j03b0wk6x1p5938wx8sc50k0bgrcp",
6+ "deb_url": "https://packages.gitlab.com/gitlab/gitlab-ce/packages/debian/stretch/gitlab-ce_11.5.0-ce.0_amd64.deb/download.deb",
7+ "owner": "gitlab-org",
8+ "repo": "gitlab-ce",
9+ "rev": "v11.5.0",
10+ "passthru": {
11+ "GITALY_SERVER_VERSION": "0.129.0",
12+ "GITLAB_PAGES_VERSION": "1.3.0",
13+ "GITLAB_SHELL_VERSION": "8.4.1",
14+ "GITLAB_WORKHORSE_VERSION": "7.1.0"
15+ }
16+ },
17+ "ee": {
18+ "version": "11.5.0",
19+ "repo_hash": "1s2jr7vhbpklpcfjxgxnmq0zq14hh2aa6akdsb7ld7fj5lmzp00z",
20+ "deb_hash": "108mgmlf947h200qrwg71ilhq5ihr4awxns6lqs2wa90ph9yq25c",
21+ "deb_url": "https://packages.gitlab.com/gitlab/gitlab-ee/packages/debian/stretch/gitlab-ee_11.5.0-ee.0_amd64.deb/download.deb",
22+ "owner": "gitlab-org",
23+ "repo": "gitlab-ee",
24+ "rev": "v11.5.0-ee",
25+ "passthru": {
26+ "GITALY_SERVER_VERSION": "0.129.0",
27+ "GITLAB_PAGES_VERSION": "1.3.0",
28+ "GITLAB_SHELL_VERSION": "8.4.1",
29+ "GITLAB_WORKHORSE_VERSION": "7.1.0"
30+ }
31+ }
32+}
pkgs/applications/version-management/gitlab/default.nix+14−20
@@ -11,32 +11,22 @@ let
1111 groups = [ "default" "unicorn" "ed25519" "metrics" ];
1212 };
1313
14− version = "11.4.4";
14+ flavour = if gitlabEnterprise then "ee" else "ce";
15+ data = (builtins.fromJSON (builtins.readFile ./data.json)).${flavour};
1516
16− sources = if gitlabEnterprise then {
17− gitlabDeb = fetchurl {
18− url = "https://packages.gitlab.com/gitlab/gitlab-ee/packages/debian/stretch/gitlab-ee_${version}-ee.0_amd64.deb/download.deb";
19− sha256 = "15lpcdjcw6lpmzlhqnpd6pgaxh7wvx2mldjd1vqr414r4bcnhgy4";
20− };
17+ version = data.version;
18+ sources = {
2119 gitlab = fetchFromGitLab {
22− owner = "gitlab-org";
23− repo = "gitlab-ee";
24− rev = "v${version}-ee";
25− sha256 = "046hchr7q4jnx3j4yxg3rdixfzlva35al3ci26pf9vxrbbl5y8cg";
20+ owner = data.owner;
21+ repo = data.repo;
22+ rev = data.rev;
23+ sha256 = data.repo_hash;
2624 };
27− } else {
2825 gitlabDeb = fetchurl {
29− url = "https://packages.gitlab.com/gitlab/gitlab-ce/packages/debian/stretch/gitlab-ce_${version}-ce.0_amd64.deb/download.deb";
30− sha256 = "02p7azyjgb984bk491q6f4zk1mikbcd38rif08kl07bjjzzkir81";
31− };
32− gitlab = fetchFromGitLab {
33− owner = "gitlab-org";
34− repo = "gitlab-ce";
35− rev = "v${version}";
36− sha256 = "1hq9iyp0xrxwmncn61ja3pdj9h2hmdy1l63d1ic3r1dyacybaf2g";
26+ url = data.deb_url;
27+ sha256 = data.deb_hash;
3728 };
3829 };
39−
4030in
4131
4232stdenv.mkDerivation rec {
@@ -101,6 +91,10 @@ stdenv.mkDerivation rec {
10191 passthru = {
10292 inherit rubyEnv;
10393 ruby = rubyEnv.wrappedRuby;
94+ GITALY_SERVER_VERSION = data.passthru.GITALY_SERVER_VERSION;
95+ GITLAB_PAGES_VERSION = data.passthru.GITLAB_PAGES_VERSION;
96+ GITLAB_SHELL_VERSION = data.passthru.GITLAB_SHELL_VERSION;
97+ GITLAB_WORKHORSE_VERSION = data.passthru.GITLAB_WORKHORSE_VERSION;
10498 };
10599
106100 meta = with lib; {
pkgs/applications/version-management/gitaly/Gemfile → pkgs/applications/version-management/gitlab/gitaly/Gemfilerenamed+11−6
@@ -1,14 +1,17 @@
11source 'https://rubygems.org'
22
3−gem 'rugged', '~> 0.27.4'
3+# Require bundler >= 1.16.5 to avoid this bug: https://github.com/bundler/bundler/issues/6537
4+gem 'bundler', '>= 1.16.5'
5+
6+gem 'rugged', '~> 0.27'
47gem 'github-linguist', '~> 6.1', require: 'linguist'
58gem 'gitlab-markup', '~> 1.6.4'
6−gem 'gitaly-proto', '~> 0.116.0', require: 'gitaly'
9+gem 'gitaly-proto', '~> 0.123.0', require: 'gitaly'
710gem 'activesupport', '~> 5.0.2'
811gem 'rdoc', '~> 4.2'
912gem 'gitlab-gollum-lib', '~> 4.2', require: false
1013gem 'gitlab-gollum-rugged_adapter', '~> 0.4.4', require: false
11−gem 'grpc', '~> 1.11.0'
14+gem 'grpc', '~> 1.15.0'
1215gem 'sentry-raven', '~> 2.7.2', require: false
1316gem 'faraday', '~> 0.12'
1417
@@ -16,10 +19,12 @@ gem 'faraday', '~> 0.12'
1619# This version needs to be in sync with GitLab CE/EE
1720gem 'licensee', '~> 8.9.0'
1821
19−# Locked until https://github.com/google/protobuf/issues/4210 is closed
20−gem 'google-protobuf', '= 3.5.1'
22+gem 'google-protobuf', '~> 3.6'
2123
2224group :development, :test do
23− gem 'gitlab-styles', '~> 2.0.0', require: false
25+ gem 'rubocop', '~> 0.50', require: false
2426 gem 'rspec', require: false
27+ gem 'rspec-parameterized', require: false
28+ gem 'timecop', require: false
29+ gem 'factory_bot', require: false
2530end
pkgs/applications/version-management/gitaly/Gemfile.lock → pkgs/applications/version-management/gitlab/gitaly/Gemfile.lockrenamed+66−61
@@ -1,26 +1,37 @@
11GEM
22 remote: https://rubygems.org/
33 specs:
4+ abstract_type (0.0.7)
45 activesupport (5.0.6)
56 concurrent-ruby (~> 1.0, >= 1.0.2)
67 i18n (~> 0.7)
78 minitest (~> 5.1)
89 tzinfo (~> 1.1)
9− addressable (2.5.2)
10− public_suffix (>= 2.0.2, < 4.0)
11− ast (2.3.0)
10+ adamantium (0.2.0)
11+ ice_nine (~> 0.11.0)
12+ memoizable (~> 0.4.0)
13+ ast (2.4.0)
14+ binding_of_caller (0.8.0)
15+ debug_inspector (>= 0.0.1)
1216 charlock_holmes (0.7.6)
17+ coderay (1.1.2)
18+ concord (0.1.5)
19+ adamantium (~> 0.2.0)
20+ equalizer (~> 0.0.9)
1321 concurrent-ruby (1.0.5)
1422 crass (1.0.4)
23+ debug_inspector (0.0.3)
1524 diff-lcs (1.3)
25+ equalizer (0.0.11)
1626 escape_utils (1.2.1)
17− faraday (0.12.2)
27+ factory_bot (4.11.1)
28+ activesupport (>= 3.0.0)
29+ faraday (0.15.3)
1830 multipart-post (>= 1.2, < 3)
1931 gemojione (3.3.0)
2032 json
21− gitaly-proto (0.116.0)
22− google-protobuf (~> 3.1)
23− grpc (~> 1.10)
33+ gitaly-proto (0.123.0)
34+ grpc (~> 1.0)
2435 github-linguist (6.2.0)
2536 charlock_holmes (~> 0.7.6)
2637 escape_utils (~> 1.2.0)
@@ -44,60 +55,44 @@ GEM
4455 mime-types (>= 1.16)
4556 posix-spawn (~> 0.3)
4657 gitlab-markup (1.6.4)
47− gitlab-styles (2.0.0)
48− rubocop (~> 0.49)
49− rubocop-gitlab-security (~> 0.1.0)
50− rubocop-rspec (~> 1.15)
5158 gollum-grit_adapter (1.0.1)
5259 gitlab-grit (~> 2.7, >= 2.7.1)
53− google-protobuf (3.5.1)
54− googleapis-common-protos-types (1.0.1)
60+ google-protobuf (3.6.1)
61+ googleapis-common-protos-types (1.0.2)
5562 google-protobuf (~> 3.0)
56− googleauth (0.6.2)
57− faraday (~> 0.12)
58− jwt (>= 1.4, < 3.0)
59− logging (~> 2.0)
60− memoist (~> 0.12)
61− multi_json (~> 1.11)
62− os (~> 0.9)
63− signet (~> 0.7)
64− grpc (1.11.0)
63+ grpc (1.15.0)
6564 google-protobuf (~> 3.1)
6665 googleapis-common-protos-types (~> 1.0.0)
67− googleauth (>= 0.5.1, < 0.7)
6866 i18n (0.8.1)
67+ ice_nine (0.11.2)
6968 json (2.1.0)
70− jwt (2.1.0)
7169 licensee (8.9.2)
7270 rugged (~> 0.24)
73− little-plugger (1.1.4)
74− logging (2.2.2)
75− little-plugger (~> 1.1)
76− multi_json (~> 1.10)
77− memoist (0.16.0)
71+ memoizable (0.4.2)
72+ thread_safe (~> 0.3, >= 0.3.1)
7873 mime-types (3.2.2)
7974 mime-types-data (~> 3.2015)
8075 mime-types-data (3.2018.0812)
8176 mini_portile2 (2.3.0)
8277 minitest (5.9.1)
83− multi_json (1.13.1)
8478 multipart-post (2.0.0)
8579 nokogiri (1.8.4)
8680 mini_portile2 (~> 2.3.0)
8781 nokogumbo (1.5.0)
8882 nokogiri
89− os (0.9.6)
90− parallel (1.12.0)
91− parser (2.4.0.0)
92− ast (~> 2.2)
83+ parallel (1.12.1)
84+ parser (2.5.1.2)
85+ ast (~> 2.4.0)
9386 posix-spawn (0.3.13)
94− powerpack (0.1.1)
95− public_suffix (3.0.2)
96− rainbow (2.2.2)
97− rake
98− rake (12.1.0)
87+ powerpack (0.1.2)
88+ proc_to_ast (0.1.0)
89+ coderay
90+ parser
91+ unparser
92+ procto (0.0.3)
93+ rainbow (3.0.0)
9994 rdoc (4.3.0)
100− rouge (3.2.1)
95+ rouge (3.3.0)
10196 rspec (3.7.0)
10297 rspec-core (~> 3.7.0)
10398 rspec-expectations (~> 3.7.0)
@@ -110,56 +105,66 @@ GEM
110105 rspec-mocks (3.7.0)
111106 diff-lcs (>= 1.2.0, < 2.0)
112107 rspec-support (~> 3.7.0)
108+ rspec-parameterized (0.4.0)
109+ binding_of_caller
110+ parser
111+ proc_to_ast
112+ rspec (>= 2.13, < 4)
113+ unparser
113114 rspec-support (3.7.1)
114− rubocop (0.50.0)
115+ rubocop (0.54.0)
115116 parallel (~> 1.10)
116− parser (>= 2.3.3.1, < 3.0)
117+ parser (>= 2.5)
117118 powerpack (~> 0.1)
118− rainbow (>= 2.2.2, < 3.0)
119+ rainbow (>= 2.2.2, < 4.0)
119120 ruby-progressbar (~> 1.7)
120121 unicode-display_width (~> 1.0, >= 1.0.1)
121− rubocop-gitlab-security (0.1.0)
122− rubocop (>= 0.47.1)
123− rubocop-rspec (1.17.0)
124− rubocop (>= 0.50.0)
125− ruby-progressbar (1.8.3)
126− rugged (0.27.4)
122+ ruby-progressbar (1.10.0)
123+ rugged (0.27.5)
127124 sanitize (4.6.6)
128125 crass (~> 1.0.2)
129126 nokogiri (>= 1.4.4)
130127 nokogumbo (~> 1.4)
131128 sentry-raven (2.7.2)
132129 faraday (>= 0.7.6, < 1.0)
133− signet (0.8.1)
134− addressable (~> 2.3)
135− faraday (~> 0.9)
136− jwt (>= 1.5, < 3.0)
137− multi_json (~> 1.10)
138130 stringex (2.8.4)
139131 thread_safe (0.3.6)
132+ timecop (0.9.1)
140133 tzinfo (1.2.2)
141134 thread_safe (~> 0.1)
142− unicode-display_width (1.3.0)
135+ unicode-display_width (1.4.0)
136+ unparser (0.2.8)
137+ abstract_type (~> 0.0.7)
138+ adamantium (~> 0.2.0)
139+ concord (~> 0.1.5)
140+ diff-lcs (~> 1.3)
141+ equalizer (~> 0.0.9)
142+ parser (>= 2.3.1.2, < 2.6)
143+ procto (~> 0.0.2)
143144
144145PLATFORMS
145146 ruby
146147
147148DEPENDENCIES
148149 activesupport (~> 5.0.2)
150+ bundler (>= 1.16.5)
151+ factory_bot
149152 faraday (~> 0.12)
150− gitaly-proto (~> 0.116.0)
153+ gitaly-proto (~> 0.123.0)
151154 github-linguist (~> 6.1)
152155 gitlab-gollum-lib (~> 4.2)
153156 gitlab-gollum-rugged_adapter (~> 0.4.4)
154157 gitlab-markup (~> 1.6.4)
155− gitlab-styles (~> 2.0.0)
156− google-protobuf (= 3.5.1)
157− grpc (~> 1.11.0)
158+ google-protobuf (~> 3.6)
159+ grpc (~> 1.15.0)
158160 licensee (~> 8.9.0)
159161 rdoc (~> 4.2)
160162 rspec
161− rugged (~> 0.27.4)
163+ rspec-parameterized
164+ rubocop (~> 0.50)
165+ rugged (~> 0.27)
162166 sentry-raven (~> 2.7.2)
167+ timecop
163168
164169BUNDLED WITH
165− 1.16.4
170+ 1.17.1
pkgs/applications/version-management/gitaly/default.nix → pkgs/applications/version-management/gitlab/gitaly/default.nixrenamed+2−2
@@ -7,14 +7,14 @@ let
77 gemdir = ./.;
88 };
99in buildGoPackage rec {
10− version = "0.125.1";
10+ version = "0.129.0";
1111 name = "gitaly-${version}";
1212
1313 src = fetchFromGitLab {
1414 owner = "gitlab-org";
1515 repo = "gitaly";
1616 rev = "v${version}";
17− sha256 = "0vbxjqjs1r5c350r67812andasby5zk25xlaqp201lmlvamiv0ni";
17+ sha256 = "0lidqa0w0vy87p5xfmqrfvbyzvl9wj2p918qs2f5rc7shzm38rn6";
1818 };
1919
2020 goPackagePath = "gitlab.com/gitlab-org/gitaly";
pkgs/applications/version-management/gitaly/gemset.nix → pkgs/applications/version-management/gitlab/gitaly/gemset.nixrenamed+138−130
@@ -1,4 +1,12 @@
11{
2+ abstract_type = {
3+ source = {
4+ remotes = ["https://rubygems.org"];
5+ sha256 = "09330cmhrc2wmfhdj9zzg82sv6cdhm3qgdkva5ni5xfjril2pf14";
6+ type = "gem";
7+ };
8+ version = "0.0.7";
9+ };
210 activesupport = {
311 dependencies = ["concurrent-ruby" "i18n" "minitest" "tzinfo"];
412 source = {
@@ -8,22 +16,31 @@
816 };
917 version = "5.0.6";
1018 };
11− addressable = {
12− dependencies = ["public_suffix"];
19+ adamantium = {
20+ dependencies = ["ice_nine" "memoizable"];
1321 source = {
1422 remotes = ["https://rubygems.org"];
15− sha256 = "0viqszpkggqi8hq87pqp0xykhvz60g99nwmkwsb0v45kc2liwxvk";
23+ sha256 = "0165r2ikgfwv2rm8dzyijkp74fvg0ni72hpdx8ay2v7cj08dqyak";
1624 type = "gem";
1725 };
18− version = "2.5.2";
26+ version = "0.2.0";
1927 };
2028 ast = {
2129 source = {
2230 remotes = ["https://rubygems.org"];
23− sha256 = "0pp82blr5fakdk27d1d21xq9zchzb6vmyb1zcsl520s3ygvprn8m";
31+ sha256 = "184ssy3w93nkajlz2c70ifm79jp3j737294kbc5fjw69v1w0n9x7";
2432 type = "gem";
2533 };
26− version = "2.3.0";
34+ version = "2.4.0";
35+ };
36+ binding_of_caller = {
37+ dependencies = ["debug_inspector"];
38+ source = {
39+ remotes = ["https://rubygems.org"];
40+ sha256 = "05syqlks7463zsy1jdfbbdravdhj9hpj5pv2m74blqpv8bq4vv5g";
41+ type = "gem";
42+ };
43+ version = "0.8.0";
2744 };
2845 charlock_holmes = {
2946 source = {
@@ -33,6 +50,23 @@
3350 };
3451 version = "0.7.6";
3552 };
53+ coderay = {
54+ source = {
55+ remotes = ["https://rubygems.org"];
56+ sha256 = "15vav4bhcc2x3jmi3izb11l4d9f3xv8hp2fszb7iqmpsccv1pz4y";
57+ type = "gem";
58+ };
59+ version = "1.1.2";
60+ };
61+ concord = {
62+ dependencies = ["adamantium" "equalizer"];
63+ source = {
64+ remotes = ["https://rubygems.org"];
65+ sha256 = "1b6cdn0fg4n9gzbdr7zyf4jq40y6h0c0g9cra7wk9hhmsylk91bg";
66+ type = "gem";
67+ };
68+ version = "0.1.5";
69+ };
3670 concurrent-ruby = {
3771 source = {
3872 remotes = ["https://rubygems.org"];
@@ -49,6 +83,14 @@
4983 };
5084 version = "1.0.4";
5185 };
86+ debug_inspector = {
87+ source = {
88+ remotes = ["https://rubygems.org"];
89+ sha256 = "0vxr0xa1mfbkfcrn71n7c4f2dj7la5hvphn904vh20j3x4j5lrx0";
90+ type = "gem";
91+ };
92+ version = "0.0.3";
93+ };
5294 diff-lcs = {
5395 source = {
5496 remotes = ["https://rubygems.org"];
@@ -57,6 +99,14 @@
5799 };
58100 version = "1.3";
59101 };
102+ equalizer = {
103+ source = {
104+ remotes = ["https://rubygems.org"];
105+ sha256 = "1kjmx3fygx8njxfrwcmn7clfhjhb6bvv3scy2lyyi0wqyi3brra4";
106+ type = "gem";
107+ };
108+ version = "0.0.11";
109+ };
60110 escape_utils = {
61111 source = {
62112 remotes = ["https://rubygems.org"];
@@ -65,14 +115,23 @@
65115 };
66116 version = "1.2.1";
67117 };
118+ factory_bot = {
119+ dependencies = ["activesupport"];
120+ source = {
121+ remotes = ["https://rubygems.org"];
122+ sha256 = "13q1b7imb591068plg4ashgsqgzarvfjz6xxn3jk6klzikz5zhg1";
123+ type = "gem";
124+ };
125+ version = "4.11.1";
126+ };
68127 faraday = {
69128 dependencies = ["multipart-post"];
70129 source = {
71130 remotes = ["https://rubygems.org"];
72− sha256 = "157c4cmb5g1b3ny6k9qf9z57rfijl54fcq3hnqqf6g31g1m096b2";
131+ sha256 = "16hwxc8v0z6gkanckjhx0ffgqmzpc4ywz4dfhxpjlz2mbz8d5m52";
73132 type = "gem";
74133 };
75− version = "0.12.2";
134+ version = "0.15.3";
76135 };
77136 gemojione = {
78137 dependencies = ["json"];
@@ -84,13 +143,13 @@
84143 version = "3.3.0";
85144 };
86145 gitaly-proto = {
87− dependencies = ["google-protobuf" "grpc"];
146+ dependencies = ["grpc"];
88147 source = {
89148 remotes = ["https://rubygems.org"];
90− sha256 = "15946776v5v8c2jisknjm82s4q3b3q9x2xygjf4bkk4m45n766w1";
149+ sha256 = "16b9sdaimhcda401z2s7apf0nz6y0lxs74xhkwlz4jzf6ms44mgg";
91150 type = "gem";
92151 };
93− version = "0.116.0";
152+ version = "0.123.0";
94153 };
95154 github-linguist = {
96155 dependencies = ["charlock_holmes" "escape_utils" "mime-types" "rugged"];
@@ -144,15 +203,6 @@
144203 };
145204 version = "1.6.4";
146205 };
147− gitlab-styles = {
148− dependencies = ["rubocop" "rubocop-gitlab-security" "rubocop-rspec"];
149− source = {
150− remotes = ["https://rubygems.org"];
151− sha256 = "1k8xrkjx8rcny8p0gsp18wskvn1qbw4rfgdp1f6x0p4xp6dlhjf4";
152− type = "gem";
153− };
154− version = "2.0.0";
155− };
156206 gollum-grit_adapter = {
157207 dependencies = ["gitlab-grit"];
158208 source = {
@@ -165,37 +215,28 @@
165215 google-protobuf = {
166216 source = {
167217 remotes = ["https://rubygems.org"];
168− sha256 = "0s8ijd9wdrkqwsb6nasrsv7f9i5im2nyax7f7jlb5y9vh8nl98qi";
218+ sha256 = "134d3ini9ymdwxpz445m28ss9x0m6vcpijcdkzvgk4n538wdmppf";
169219 type = "gem";
170220 };
171− version = "3.5.1";
221+ version = "3.6.1";
172222 };
173223 googleapis-common-protos-types = {
174224 dependencies = ["google-protobuf"];
175225 source = {
176226 remotes = ["https://rubygems.org"];
177− sha256 = "0yf10s7w8wpa49hc86z7z2fkn9yz7j2njz0n8xmqb24ji090z4ck";
227+ sha256 = "01ds7g01pxqm3mg283xjzy0lhhvvhvzw3m7gf7szd1r7la4wf0qq";
178228 type = "gem";
179229 };
180− version = "1.0.1";
181− };
182− googleauth = {
183− dependencies = ["faraday" "jwt" "logging" "memoist" "multi_json" "os" "signet"];
184− source = {
185− remotes = ["https://rubygems.org"];
186− sha256 = "08z4zfj9cwry13y8c2w5p4xylyslxxjq4wahd95bk1ddl5pknd4f";
187− type = "gem";
188− };
189− version = "0.6.2";
230+ version = "1.0.2";
190231 };
191232 grpc = {
192− dependencies = ["google-protobuf" "googleapis-common-protos-types" "googleauth"];
233+ dependencies = ["google-protobuf" "googleapis-common-protos-types"];
193234 source = {
194235 remotes = ["https://rubygems.org"];
195− sha256 = "1is4czi3i7y6zyxzyrpsma1z91axmc0jz2ngr6ckixqd3629npkz";
236+ sha256 = "0m2wspnm1cfkmhlbp7yqv5bb4vsfh246cm0aavxra67aw4l8plhb";
196237 type = "gem";
197238 };
198− version = "1.11.0";
239+ version = "1.15.0";
199240 };
200241 i18n = {
201242 source = {
@@ -205,18 +246,18 @@
205246 };
206247 version = "0.8.1";
207248 };
208− json = {
249+ ice_nine = {
209250 source = {
210251 remotes = ["https://rubygems.org"];
211− sha256 = "01v6jjpvh3gnq6sgllpfqahlgxzj50ailwhj9b3cd20hi2dx0vxp";
252+ sha256 = "1nv35qg1rps9fsis28hz2cq2fx1i96795f91q4nmkm934xynll2x";
212253 type = "gem";
213254 };
214− version = "2.1.0";
255+ version = "0.11.2";
215256 };
216− jwt = {
257+ json = {
217258 source = {
218259 remotes = ["https://rubygems.org"];
219− sha256 = "1w0kaqrbl71cq9sbnixc20x5lqah3hs2i93xmhlfdg2y3by7yzky";
260+ sha256 = "01v6jjpvh3gnq6sgllpfqahlgxzj50ailwhj9b3cd20hi2dx0vxp";
220261 type = "gem";
221262 };
222263 version = "2.1.0";
@@ -230,30 +271,14 @@
230271 };
231272 version = "8.9.2";
232273 };
233− little-plugger = {
234− source = {
235− remotes = ["https://rubygems.org"];
236− sha256 = "1frilv82dyxnlg8k1jhrvyd73l6k17mxc5vwxx080r4x1p04gwym";
237− type = "gem";
238− };
239− version = "1.1.4";
240− };
241− logging = {
242− dependencies = ["little-plugger" "multi_json"];
243− source = {
244− remotes = ["https://rubygems.org"];
245− sha256 = "06j6iaj89h9jhkx1x3hlswqrfnqds8br05xb1qra69dpvbdmjcwn";
246− type = "gem";
247− };
248− version = "2.2.2";
249− };
250− memoist = {
274+ memoizable = {
275+ dependencies = ["thread_safe"];
251276 source = {
252277 remotes = ["https://rubygems.org"];
253− sha256 = "0pq8fhqh8w25qcw9v3vzfb0i6jp0k3949ahxc3wrwz2791dpbgbh";
278+ sha256 = "0v42bvghsvfpzybfazl14qhkrjvx0xlmxz0wwqc960ga1wld5x5c";
254279 type = "gem";
255280 };
256− version = "0.16.0";
281+ version = "0.4.2";
257282 };
258283 mime-types = {
259284 dependencies = ["mime-types-data"];
@@ -288,14 +313,6 @@
288313 };
289314 version = "5.9.1";
290315 };
291− multi_json = {
292− source = {
293− remotes = ["https://rubygems.org"];
294− sha256 = "1rl0qy4inf1mp8mybfk56dfga0mvx97zwpmq5xmiwl5r770171nv";
295− type = "gem";
296− };
297− version = "1.13.1";
298− };
299316 multipart-post = {
300317 source = {
301318 remotes = ["https://rubygems.org"];
@@ -322,30 +339,22 @@
322339 };
323340 version = "1.5.0";
324341 };
325− os = {
326− source = {
327− remotes = ["https://rubygems.org"];
328− sha256 = "1llv8w3g2jwggdxr5a5cjkrnbbfnvai3vxacxxc0fy84xmz3hymz";
329− type = "gem";
330− };
331− version = "0.9.6";
332− };
333342 parallel = {
334343 source = {
335344 remotes = ["https://rubygems.org"];
336− sha256 = "0qv2yj4sxr36ga6xdxvbq9h05hn10bwcbkqv6j6q1fiixhsdnnzd";
345+ sha256 = "01hj8v1qnyl5ndrs33g8ld8ibk0rbcqdpkpznr04gkbxd11pqn67";
337346 type = "gem";
338347 };
339− version = "1.12.0";
348+ version = "1.12.1";
340349 };
341350 parser = {
342351 dependencies = ["ast"];
343352 source = {
344353 remotes = ["https://rubygems.org"];
345− sha256 = "130rfk8a2ws2fyq52hmi1n0xakylw39wv4x1qhai4z17x2b0k9cq";
354+ sha256 = "1zp89zg7iypncszxsjp8kiccrpbdf728jl449g6cnfkz990fyb5k";
346355 type = "gem";
347356 };
348− version = "2.4.0.0";
357+ version = "2.5.1.2";
349358 };
350359 posix-spawn = {
351360 source = {
@@ -358,35 +367,35 @@
358367 powerpack = {
359368 source = {
360369 remotes = ["https://rubygems.org"];
361− sha256 = "1fnn3fli5wkzyjl4ryh0k90316shqjfnhydmc7f8lqpi0q21va43";
370+ sha256 = "1r51d67wd467rpdfl6x43y84vwm8f5ql9l9m85ak1s2sp3nc5hyv";
362371 type = "gem";
363372 };
364− version = "0.1.1";
373+ version = "0.1.2";
365374 };
366− public_suffix = {
375+ proc_to_ast = {
376+ dependencies = ["coderay" "parser" "unparser"];
367377 source = {
368378 remotes = ["https://rubygems.org"];
369− sha256 = "1x5h1dh1i3gwc01jbg01rly2g6a1qwhynb1s8a30ic507z1nh09s";
379+ sha256 = "14c65w48bbzp5lh1cngqd1y25kqvfnq1iy49hlzshl12dsk3z9wj";
370380 type = "gem";
371381 };
372− version = "3.0.2";
382+ version = "0.1.0";
373383 };
374− rainbow = {
375− dependencies = ["rake"];
384+ procto = {
376385 source = {
377386 remotes = ["https://rubygems.org"];
378− sha256 = "08w2ghc5nv0kcq5b257h7dwjzjz1pqcavajfdx2xjyxqsvh2y34w";
387+ sha256 = "13imvg1x50rz3r0yyfbhxwv72lbf7q28qx9l9nfbb91h2n9ch58c";
379388 type = "gem";
380389 };
381− version = "2.2.2";
390+ version = "0.0.3";
382391 };
383− rake = {
392+ rainbow = {
384393 source = {
385394 remotes = ["https://rubygems.org"];
386− sha256 = "0mfqgpp3m69s5v1rd51lfh5qpjwyia5p4rg337pw8c8wzm6pgfsw";
395+ sha256 = "0bb2fpjspydr6x0s8pn1pqkzmxszvkfapv0p4627mywl7ky4zkhk";
387396 type = "gem";
388397 };
389− version = "12.1.0";
398+ version = "3.0.0";
390399 };
391400 rdoc = {
392401 source = {
@@ -399,10 +408,10 @@
399408 rouge = {
400409 source = {
401410 remotes = ["https://rubygems.org"];
402− sha256 = "0h79gn2wmn1wix2d27lgiaimccyj8gvizrllyym500pir408x62f";
411+ sha256 = "1digsi2s8wyzx8vsqcxasw205lg6s7izx8jypl8rrpjwshmv83ql";
403412 type = "gem";
404413 };
405− version = "3.2.1";
414+ version = "3.3.0";
406415 };
407416 rspec = {
408417 dependencies = ["rspec-core" "rspec-expectations" "rspec-mocks"];
@@ -440,56 +449,47 @@
440449 };
441450 version = "3.7.0";
442451 };
443− rspec-support = {
452+ rspec-parameterized = {
453+ dependencies = ["binding_of_caller" "parser" "proc_to_ast" "rspec" "unparser"];
444454 source = {
445455 remotes = ["https://rubygems.org"];
446− sha256 = "1nl30xb6jmcl0awhqp6jycl01wdssblifwy921phfml70rd9flj1";
456+ sha256 = "0arynbr6cfjhccwc8gy2xf87nybdnncsnmfwknnh8s7d4mj730p0";
447457 type = "gem";
448458 };
449− version = "3.7.1";
459+ version = "0.4.0";
450460 };
451− rubocop = {
452− dependencies = ["parallel" "parser" "powerpack" "rainbow" "ruby-progressbar" "unicode-display_width"];
453− source = {
454− remotes = ["https://rubygems.org"];
455− sha256 = "1hpd7zcv4y9y750wj630abvmcjwv39dsrj1fjff60ik7gfri0xlz";
456− type = "gem";
457− };
458− version = "0.50.0";
459− };
460− rubocop-gitlab-security = {
461− dependencies = ["rubocop"];
461+ rspec-support = {
462462 source = {
463463 remotes = ["https://rubygems.org"];
464− sha256 = "0aw9qmyc6xj6fi0jxp8m4apk358rd91z492ragn6jp4rghkqj5cy";
464+ sha256 = "1nl30xb6jmcl0awhqp6jycl01wdssblifwy921phfml70rd9flj1";
465465 type = "gem";
466466 };
467− version = "0.1.0";
467+ version = "3.7.1";
468468 };
469− rubocop-rspec = {
470− dependencies = ["rubocop"];
469+ rubocop = {
470+ dependencies = ["parallel" "parser" "powerpack" "rainbow" "ruby-progressbar" "unicode-display_width"];
471471 source = {
472472 remotes = ["https://rubygems.org"];
473− sha256 = "1hf48ng67yswvshmv4cyysj1rs1z3fnvlycr50jdcgwlynpyxkhs";
473+ sha256 = "106y99lq0fg62k3vk1w5wwb4vq16pnh4l61skc82xck627z0h8is";
474474 type = "gem";
475475 };
476− version = "1.17.0";
476+ version = "0.54.0";
477477 };
478478 ruby-progressbar = {
479479 source = {
480480 remotes = ["https://rubygems.org"];
481− sha256 = "029kv0q3kfq53rjyak4ypn7196l8z4hflfmv4p5787n78z7baiqf";
481+ sha256 = "1cv2ym3rl09svw8940ny67bav7b2db4ms39i4raaqzkf59jmhglk";
482482 type = "gem";
483483 };
484− version = "1.8.3";
484+ version = "1.10.0";
485485 };
486486 rugged = {
487487 source = {
488488 remotes = ["https://rubygems.org"];
489− sha256 = "1y6k5yrfmhc1v4albbpa3xzl28vk5lric3si8ada28sp9mmk2x72";
489+ sha256 = "1jv4nw9hvlxp8hhhlllrfcznki82i50fp1sj65zsjllfl2bvz8x6";
490490 type = "gem";
491491 };
492− version = "0.27.4";
492+ version = "0.27.5";
493493 };
494494 sanitize = {
495495 dependencies = ["crass" "nokogiri" "nokogumbo"];
@@ -509,15 +509,6 @@
509509 };
510510 version = "2.7.2";
511511 };
512− signet = {
513− dependencies = ["addressable" "faraday" "jwt" "multi_json"];
514− source = {
515− remotes = ["https://rubygems.org"];
516− sha256 = "0js81lxqirdza8gf2f6avh11fny49ygmxfi1qx7jp8l9wrhznbkv";
517− type = "gem";
518− };
519− version = "0.8.1";
520− };
521512 stringex = {
522513 source = {
523514 remotes = ["https://rubygems.org"];
@@ -534,6 +525,14 @@
534525 };
535526 version = "0.3.6";
536527 };
528+ timecop = {
529+ source = {
530+ remotes = ["https://rubygems.org"];
531+ sha256 = "0d7mm786180v4kzvn1f77rhfppsg5n0sq2bdx63x9nv114zm8jrp";
532+ type = "gem";
533+ };
534+ version = "0.9.1";
535+ };
537536 tzinfo = {
538537 dependencies = ["thread_safe"];
539538 source = {
@@ -546,9 +545,18 @@
546545 unicode-display_width = {
547546 source = {
548547 remotes = ["https://rubygems.org"];
549− sha256 = "12pi0gwqdnbx1lv5136v3vyr0img9wr0kxcn4wn54ipq4y41zxq8";
548+ sha256 = "0040bsdpcmvp8w31lqi2s9s4p4h031zv52401qidmh25cgyh4a57";
549+ type = "gem";
550+ };
551+ version = "1.4.0";
552+ };
553+ unparser = {
554+ dependencies = ["abstract_type" "adamantium" "concord" "diff-lcs" "equalizer" "parser" "procto"];
555+ source = {
556+ remotes = ["https://rubygems.org"];
557+ sha256 = "0rh1649846ac17av30x0b0v9l45v0x1j2y1i8m1a7xdd0v4sld0z";
550558 type = "gem";
551559 };
552− version = "1.3.0";
560+ version = "0.2.8";
553561 };
554562}
pkgs/applications/version-management/gitlab-shell/default.nix → pkgs/applications/version-management/gitlab/gitlab-shell/default.nixrenamed+2−2
@@ -1,14 +1,14 @@
11{ stdenv, ruby, bundler, fetchFromGitLab, go }:
22
33stdenv.mkDerivation rec {
4− version = "8.3.3";
4+ version = "8.4.1";
55 name = "gitlab-shell-${version}";
66
77 src = fetchFromGitLab {
88 owner = "gitlab-org";
99 repo = "gitlab-shell";
1010 rev = "v${version}";
11− sha256 = "1qapw0yvlw1nxjik7jpbbbl3yx299sfvdx67zsd5ai7bhk1gd8xl";
11+ sha256 = "00jzrpdfqgrba2qi5ngc0g07p7gmip7my563hw542gg8l88d27xq";
1212 };
1313
1414 buildInputs = [ ruby bundler go ];
pkgs/applications/version-management/gitlab/gitlab-shell/remove-hardcoded-locations.patchnew file+45
@@ -0,0 +1,45 @@
1+diff --git a/go/internal/config/config.go b/go/internal/config/config.go
2+index 435cb29..078c1df 100644
3+--- a/go/internal/config/config.go
4++++ b/go/internal/config/config.go
5+@@ -2,7 +2,6 @@ package config
6+
7+ import (
8+ "io/ioutil"
9+- "os"
10+ "path"
11+
12+ yaml "gopkg.in/yaml.v2"
13+@@ -26,16 +25,13 @@ type Config struct {
14+ }
15+
16+ func New() (*Config, error) {
17+- dir, err := os.Getwd()
18+- if err != nil {
19+- return nil, err
20+- }
21++ dir := "/run/gitlab"
22+
23+ return NewFromDir(dir)
24+ }
25+
26+ func NewFromDir(dir string) (*Config, error) {
27+- return newFromFile(path.Join(dir, configFile))
28++ return newFromFile(path.Join(dir, "shell-config.yml"))
29+ }
30+
31+ func newFromFile(filename string) (*Config, error) {
32+diff --git a/lib/gitlab_shell.rb b/lib/gitlab_shell.rb
33+index 57c70f5..700569b 100644
34+--- a/lib/gitlab_shell.rb
35++++ b/lib/gitlab_shell.rb
36+@@ -187,7 +187,8 @@ class GitlabShell # rubocop:disable Metrics/ClassLength
37+
38+ args = [executable, gitaly_address, json_args]
39+ # We use 'chdir: ROOT_PATH' to let the next executable know where config.yml is.
40+- Kernel.exec(env, *args, unsetenv_others: true, chdir: ROOT_PATH)
41++ # Except we don't, because we're already in the right directory on nixos!
42++ Kernel.exec(env, *args, unsetenv_others: true)
43+ end
44+
45+ def api
pkgs/applications/version-management/gitlab-workhorse/default.nix → pkgs/applications/version-management/gitlab/gitlab-workhorse/default.nixrenamed+4−4
@@ -3,18 +3,18 @@
33stdenv.mkDerivation rec {
44 name = "gitlab-workhorse-${version}";
55
6− version = "7.0.0";
6+ version = "7.1.0";
77
8− srcs = fetchFromGitLab {
8+ src = fetchFromGitLab {
99 owner = "gitlab-org";
1010 repo = "gitlab-workhorse";
1111 rev = "v${version}";
12− sha256 = "1mmfb7h5sbva2kv9h9cxfg7dyksxrwwikq7jwggfawqaadzwm677";
12+ sha256 = "1jq28z2kf58wnbv8jkwfx2bm8ki22hpm9ssdy2ymza22gq0zx00g";
1313 };
1414
1515 buildInputs = [ git go ];
1616
17− patches = [ ./remove-hardcoded-paths.patch ./deterministic-build.patch ];
17+ patches = [ ./remove-hardcoded-paths.patch ];
1818
1919 makeFlags = [ "PREFIX=$(out)" "VERSION=${version}" ];
2020
pkgs/applications/version-management/gitlab-workhorse/remove-hardcoded-paths.patch → pkgs/applications/version-management/gitlab/gitlab-workhorse/remove-hardcoded-paths.patchrenamed

The content is the same.

pkgs/applications/version-management/gitlab/update.pynew file+234
@@ -0,0 +1,234 @@
1+#!/usr/bin/env nix-shell
2+#! nix-shell -i python3 -p bundix common-updater-scripts nix nix-prefetch-git python3 python3Packages.requests python3Packages.lxml python3Packages.click python3Packages.click-log
3+
4+import click
5+import click_log
6+import os
7+import re
8+import logging
9+import subprocess
10+import json
11+import pathlib
12+from typing import Iterable
13+
14+import requests
15+from xml.etree import ElementTree
16+
17+logger = logging.getLogger(__name__)
18+
19+
20+class GitLabRepo:
21+ def __init__(self, owner: str, repo: str):
22+ self.owner = owner
23+ self.repo = repo
24+
25+ @property
26+ def url(self):
27+ return f"https://gitlab.com/{self.owner}/{self.repo}"
28+
29+ @property
30+ def tags(self) -> Iterable[str]:
31+ r = requests.get(self.url + "/tags?format=atom", stream=True)
32+
33+ tree = ElementTree.fromstring(r.content)
34+ return sorted((e.text for e in tree.findall(
35+ '{http://www.w3.org/2005/Atom}entry/{http://www.w3.org/2005/Atom}title')), reverse=True)
36+
37+ def get_git_hash(self, rev: str):
38+ out = subprocess.check_output(['nix-prefetch-git', self.url, rev])
39+ j = json.loads(out)
40+ return j['sha256']
41+
42+ def get_deb_url(self, flavour: str, version: str, arch: str = 'amd64') -> str:
43+ """
44+ gitlab builds debian packages, which we currently need as we don't build the frontend on our own
45+ this returns the url of a given flavour, version and arch
46+ :param flavour: 'ce' or 'ee'
47+ :param version: a version, without 'v' prefix and '-ee' suffix
48+ :param arch: amd64
49+ :return: url of the debian package
50+ """
51+ if self.owner != "gitlab-org" or self.repo not in ['gitlab-ce', 'gitlab-ee']:
52+ raise Exception(f"don't know how to get deb_url for {self.url}")
53+ return f"https://packages.gitlab.com/gitlab/gitlab-{flavour}/packages" + \
54+ f"/debian/stretch/gitlab-{flavour}_{version}-{flavour}.0_{arch}.deb/download.deb"
55+
56+ def get_deb_hash(self, flavour: str, version: str) -> str:
57+ out = subprocess.check_output(['nix-prefetch-url', self.get_deb_url(flavour, version)])
58+ return out.decode('utf-8').strip()
59+
60+ @staticmethod
61+ def rev2version(tag: str) -> str:
62+ """
63+ normalize a tag to a version number.
64+ This obviously isn't very smart if we don't pass something that looks like a tag
65+ :param tag: the tag to normalize
66+ :return: a normalized version number
67+ """
68+ # strip v prefix
69+ version = re.sub(r"^v", '', tag)
70+ # strip -ee suffix
71+ return re.sub(r"-ee$", '', version)
72+
73+ def get_file(self, filepath, rev):
74+ """
75+ returns file contents at a given rev
76+ :param filepath: the path to the file, relative to the repo root
77+ :param rev: the rev to fetch at
78+ :return:
79+ """
80+ return requests.get(self.url + f"/raw/{rev}/{filepath}").text
81+
82+ def get_data(self, rev, flavour):
83+ version = self.rev2version(rev)
84+
85+ passthru = {v: self.get_file(v, rev).strip() for v in ['GITALY_SERVER_VERSION', 'GITLAB_PAGES_VERSION',
86+ 'GITLAB_SHELL_VERSION', 'GITLAB_WORKHORSE_VERSION']}
87+ return dict(version=self.rev2version(rev),
88+ repo_hash=self.get_git_hash(rev),
89+ deb_hash=self.get_deb_hash(flavour, version),
90+ deb_url=self.get_deb_url(flavour, version),
91+ owner=self.owner,
92+ repo=self.repo,
93+ rev=rev,
94+ passthru=passthru)
95+
96+
97+def _flavour2gitlabrepo(flavour: str):
98+ if flavour not in ['ce', 'ee']:
99+ raise Exception(f"unknown gitlab flavour: {flavour}, needs to be ce or ee")
100+
101+ owner = 'gitlab-org'
102+ repo = 'gitlab-' + flavour
103+
104+ return GitLabRepo(owner, repo)
105+
106+
107+def _update_data_json(filename: str, repo: GitLabRepo, rev: str, flavour: str):
108+ flavour_data = repo.get_data(rev, flavour)
109+
110+ if not os.path.exists(filename):
111+ with open(filename, 'w') as f:
112+ json.dump({flavour: flavour_data}, f, indent=2)
113+ else:
114+ with open(filename, 'r+') as f:
115+ data = json.load(f)
116+ data[flavour] = flavour_data
117+ f.seek(0)
118+ json.dump(data, f, indent=2)
119+
120+
121+def _get_data_json():
122+ data_file_path = pathlib.Path(__file__).parent / 'data.json'
123+ with open(data_file_path, 'r') as f:
124+ return json.load(f)
125+
126+
127+def _call_update_source_version(pkg, version):
128+ """calls update-source-version from nixpkgs root dir"""
129+ nixpkgs_path = pathlib.Path(__file__).parent / '../../../../'
130+ return subprocess.check_output(['update-source-version', pkg, version], cwd=nixpkgs_path)
131+
132+
133+@click_log.simple_verbosity_option(logger)
134+@click.group()
135+def cli():
136+ pass
137+
138+
139+@cli.command('update-data')
140+@click.option('--rev', default='latest', help='The rev to use, \'latest\' points to the latest (stable) tag')
141+@click.argument('flavour')
142+def update_data(rev: str, flavour: str):
143+ """Update data.nix for a selected flavour"""
144+ r = _flavour2gitlabrepo(flavour)
145+
146+ if rev == 'latest':
147+ # filter out pre and re releases
148+ rev = next(filter(lambda x: not ('rc' in x or x.endswith('pre')), r.tags))
149+ logger.debug(f"Using rev {rev}")
150+
151+ version = r.rev2version(rev)
152+ logger.debug(f"Using version {version}")
153+
154+ data_file_path = pathlib.Path(__file__).parent / 'data.json'
155+
156+ _update_data_json(filename=data_file_path.as_posix(),
157+ repo=r,
158+ rev=rev,
159+ flavour=flavour)
160+
161+
162+@cli.command('update-rubyenv')
163+@click.argument('flavour')
164+def update_rubyenv(flavour):
165+ """Update rubyEnv-${flavour}"""
166+ if flavour not in ['ce', 'ee']:
167+ raise Exception(f"unknown gitlab flavour: {flavour}, needs to be ce or ee")
168+
169+ r = _flavour2gitlabrepo(flavour)
170+ rubyenv_dir = pathlib.Path(__file__).parent / f"rubyEnv-{flavour}"
171+
172+ # load rev from data.json
173+ data = _get_data_json()
174+ rev = data[flavour]['rev']
175+
176+ for fn in ['Gemfile.lock', 'Gemfile']:
177+ with open(rubyenv_dir / fn, 'w') as f:
178+ f.write(r.get_file(fn, rev))
179+
180+ subprocess.check_output(['bundix'], cwd=rubyenv_dir)
181+
182+
183+@cli.command('update-gitaly')
184+def update_gitaly():
185+ """Update gitaly"""
186+ data = _get_data_json()
187+ gitaly_server_version = data['ce']['passthru']['GITALY_SERVER_VERSION']
188+ r = GitLabRepo('gitlab-org', 'gitaly')
189+ rubyenv_dir = pathlib.Path(__file__).parent / 'gitaly'
190+
191+ for fn in ['Gemfile.lock', 'Gemfile']:
192+ with open(rubyenv_dir / fn, 'w') as f:
193+ f.write(r.get_file(f"ruby/{fn}", f"v{gitaly_server_version}"))
194+
195+ subprocess.check_output(['bundix'], cwd=rubyenv_dir)
196+ # currently broken, as `gitaly.meta.position` returns
197+ # pkgs/development/go-modules/generic/default.nix
198+ # so update-source-version doesn't know where to update hashes
199+ # _call_update_source_version('gitaly', gitaly_server_version)
200+ gitaly_hash = r.get_git_hash(f"v{gitaly_server_version}")
201+ click.echo(f"Please update gitaly/default.nix to version {gitaly_server_version} and hash {gitaly_hash}")
202+
203+
204+
205+@cli.command('update-gitlab-shell')
206+def update_gitlab_shell():
207+ """Update gitlab-shell"""
208+ data = _get_data_json()
209+ gitlab_shell_version = data['ce']['passthru']['GITLAB_SHELL_VERSION']
210+ _call_update_source_version('gitlab-shell', gitlab_shell_version)
211+
212+
213+@cli.command('update-gitlab-workhorse')
214+def update_gitlab_workhorse():
215+ """Update gitlab-shell"""
216+ data = _get_data_json()
217+ gitlab_workhorse_version = data['ce']['passthru']['GITLAB_WORKHORSE_VERSION']
218+ _call_update_source_version('gitlab-workhorse', gitlab_workhorse_version)
219+
220+
221+@cli.command('update-all')
222+@click.pass_context
223+def update_all(ctx):
224+ """Update gitlab ce and ee data.nix and rubyenvs to the latest stable release"""
225+ for flavour in ['ce', 'ee']:
226+ ctx.invoke(update_data, rev='latest', flavour=flavour)
227+ ctx.invoke(update_rubyenv, flavour=flavour)
228+ ctx.invoke(update_gitaly)
229+ ctx.invoke(update_gitlab_shell)
230+ ctx.invoke(update_gitlab_workhorse)
231+
232+
233+if __name__ == '__main__':
234+ cli()
pkgs/top-level/all-packages.nix+3−3
@@ -2890,11 +2890,11 @@ with pkgs;
28902890
28912891 gitlab-runner = callPackage ../development/tools/continuous-integration/gitlab-runner { };
28922892
2893− gitlab-shell = callPackage ../applications/version-management/gitlab-shell { };
2893+ gitlab-shell = callPackage ../applications/version-management/gitlab/gitlab-shell { };
28942894
2895− gitlab-workhorse = callPackage ../applications/version-management/gitlab-workhorse { };
2895+ gitlab-workhorse = callPackage ../applications/version-management/gitlab/gitlab-workhorse { };
28962896
2897− gitaly = callPackage ../applications/version-management/gitaly { };
2897+ gitaly = callPackage ../applications/version-management/gitlab/gitaly { };
28982898
28992899 gitstats = callPackage ../applications/version-management/gitstats { };
29002900