Subject | Hash | Author | Date (UTC) |
---|---|---|---|
Fixed the unit tests (minor) | 0e9cfc3911aba7119bb57140ecfa51ad6e3983bf | Catalin(ux) M. BOIE | 2016-07-14 05:05:37 |
Fixed e-mail confirmation logic. | dd5b4be2e8e49aa612ddf7557e8ef0b1e0268822 | Catalin(ux) M. BOIE | 2016-07-11 21:09:19 |
Do more tests and resync some with the reality | db9bb136ff176006cbb8f8848309b8adbf98d630 | Catalin(ux) M. BOIE | 2016-07-11 04:07:38 |
Improved user cache to not have null elements in JSON | d6b75a2cc4830cfb8dfb92e911f1e5a41c2023bc | Catalin(ux) M. BOIE | 2016-07-11 04:06:25 |
Allow rights to have numbers and _ in name | 4f5c38389bc98e2dcb60d36359917c33820e5779 | Catalin(ux) M. BOIE | 2016-07-11 04:05:40 |
Allow strange chars in cache names | 00b05d99d3d3cf0229249718d2482af40f063972 | Catalin(ux) M. BOIE | 2016-07-11 04:04:08 |
Small improvements to builder and worker | 08f9bc668f7f192af61868bebd644bea64b6aedd | Catalin(ux) M. BOIE | 2016-07-11 04:01:47 |
SELinux improvements to support the builder | a2b52360b43be53786ee5d68c9fcb2db14f29c0c | Catalin(ux) M. BOIE | 2016-07-11 04:00:57 |
Document docker on Download web section | 5d4ece50d6b4dc3d4902afd9264a45834ceb3592 | Catalin(ux) M. BOIE | 2016-07-11 03:54:31 |
Doc: restore context for rc.local | eb5fa1cab84737e3440cfbca147d50859b8f9a53 | Catalin(ux) M. BOIE | 2016-07-07 04:09:23 |
Fixed small bug preventing e-mail to show in report | 26d884b3a332f3c3b241c194912b9653749a9427 | Catalin(ux) M. BOIE | 2016-07-07 03:37:23 |
Do not clobber the cron file | 5c68384676d9b8087255dda3b62e3588fc50e6c7 | Catalin(ux) M. BOIE | 2016-07-06 22:03:58 |
When using rg_json_encode, no quotes needed. | c4b7693a81e593918f8c06408f16b4884a92773b | Catalin(ux) M. BOIE | 2016-07-06 05:21:00 |
Remove summary from tables because violates HTML5 specs. :( | 11865f18e979f3849dbb265e5c5350f4a638088b | Catalin(ux) M. BOIE | 2016-07-06 05:00:11 |
Bump version to 0.55 | 58652b8250a867c0f4e9e3a9c76737443f242b36 | Catalin(ux) M. BOIE | 2016-07-06 04:48:24 |
Big commit of a lot of unrelated changes. Shame on me! | e503666df79ef1553d0bb7ffd1d12a6b62748b1c | Catalin(ux) M. BOIE | 2016-07-06 04:44:43 |
Do not free resources if query fails. | 57baca81e9087a00a8e2e1807c932de2fb9769c4 | Catalin(ux) M. BOIE | 2016-06-26 11:47:09 |
Packaging changes: prepared for Debian build | c32cb09dc84615f4984ce5f8fac4064accbeeb28 | Catalin(ux) M. BOIE | 2016-06-12 05:59:14 |
webhooks - rename Name to Type | 7d774d4818950b3d3916e834b0dde3081b90960e | Catalin(ux) M. BOIE | 2016-05-08 11:36:45 |
Correct license for spec file (Affero -> A) | 3635ec1e7b416524ad15e06c884b4546600d68e4 | Catalin(ux) M. BOIE | 2016-05-08 11:09:01 |
File | Lines added | Lines deleted |
---|---|---|
tests/hook_update.sh | 0 | 1 |
tests/hook_update_help.php | 7 | 8 |
tests/http_forgot.php | 3 | 2 |
tests/pr_anon.php | 44 | 9 |
File tests/hook_update.sh changed (mode: 100755) (index 7561080..cfe9a8d) | |||
... | ... | tests=`pwd` | |
4 | 4 | ||
5 | 5 | export ROCKETGIT_CONF_FILE="`pwd`/config.php" | export ROCKETGIT_CONF_FILE="`pwd`/config.php" |
6 | 6 | export ROCKETGIT_LOGIN_UID=1234 | export ROCKETGIT_LOGIN_UID=1234 |
7 | export ROCKETGIT_LOGIN_USERNAME=cutu | ||
8 | 7 | export ROCKETGIT_REPO_ID=5678 | export ROCKETGIT_REPO_ID=5678 |
9 | 8 | export ROCKETGIT_IP="127.0.0.1" | export ROCKETGIT_IP="127.0.0.1" |
10 | 9 | export ROCKETGIT_REPO_PATH="`pwd`/hook_update_dest.git" | export ROCKETGIT_REPO_PATH="`pwd`/hook_update_dest.git" |
File tests/hook_update_help.php changed (mode: 100644) (index 97d4e86..6ba47e8) | |||
... | ... | if ($repo_uid === FALSE) | |
31 | 31 | $uid = getenv("ROCKETGIT_LOGIN_UID"); | $uid = getenv("ROCKETGIT_LOGIN_UID"); |
32 | 32 | if ($uid === FALSE) | if ($uid === FALSE) |
33 | 33 | $uid = 1234; | $uid = 1234; |
34 | $username = getenv("ROCKETGIT_LOGIN_USERNAME"); | ||
35 | if ($username === FALSE) | ||
36 | $username = 'cutu'; | ||
37 | 34 | $rights = getenv("ROCKETGIT_REPO_RIGHTS"); | $rights = getenv("ROCKETGIT_REPO_RIGHTS"); |
38 | 35 | if ($rights === FALSE) | if ($rights === FALSE) |
39 | 36 | $rights = ""; | $rights = ""; |
40 | 37 | rg_log("repo_id=$repo_id repo_uid=$repo_uid uid=$uid rights=$rights"); | rg_log("repo_id=$repo_id repo_uid=$repo_uid uid=$uid rights=$rights"); |
41 | 38 | ||
42 | $rg_ui = array("uid" => $uid, | ||
43 | "username" => "user-hook-update", | ||
44 | "email" => "hook_update_help@embedromix.ro", | ||
45 | "organization" => 0, | ||
46 | "confirmed" => 1); | ||
39 | $rg_ui = array( | ||
40 | 'uid' => $uid, | ||
41 | 'username' => 'user-hook-update', | ||
42 | 'email' => 'hook_update_help@embedromix.ro', | ||
43 | 'organization' => 0, | ||
44 | 'confirmed' => time() | ||
45 | ); | ||
47 | 46 | ||
48 | 47 | $a = array(); | $a = array(); |
49 | 48 | $a['right_id'] = 100; | $a['right_id'] = 100; |
File tests/http_forgot.php changed (mode: 100644) (index c0779b4..686cf12) | |||
... | ... | if ($rows > 0) | |
54 | 54 | $row = rg_sql_fetch_array($res); | $row = rg_sql_fetch_array($res); |
55 | 55 | rg_sql_free_result($res); | rg_sql_free_result($res); |
56 | 56 | if ($rows != 1) { | if ($rows != 1) { |
57 | rg_log("Seems the token is not in the database or there are multiple ones!"); | ||
57 | rg_log("Seems the token is not in the database or there are multiple" | ||
58 | . " ones (rows=" . $rows . ")!"); | ||
58 | 59 | exit(1); | exit(1); |
59 | 60 | } | } |
60 | 61 | $db_token = $row['token']; | $db_token = $row['token']; |
... | ... | rg_log_exit(); | |
63 | 64 | ||
64 | 65 | rg_log(''); | rg_log(''); |
65 | 66 | rg_log_enter('Loading token from mail...'); | rg_log_enter('Loading token from mail...'); |
66 | $k = 'DEBUG::nouid::mail'; | ||
67 | $k = 'DEBUG::0::mail'; | ||
67 | 68 | $c = rg_cache_get($k); | $c = rg_cache_get($k); |
68 | 69 | if (($c === FALSE) || !isset($c['body'])) { | if (($c === FALSE) || !isset($c['body'])) { |
69 | 70 | rg_log_ml(print_r($c, TRUE)); | rg_log_ml(print_r($c, TRUE)); |
File tests/pr_anon.php changed (mode: 100644) (index 9ab4a67..cd0af1e) | |||
... | ... | rg_log_exit(); | |
81 | 81 | ||
82 | 82 | rg_log(''); | rg_log(''); |
83 | 83 | rg_log_enter('Preparing repo...'); | rg_log_enter('Preparing repo...'); |
84 | system('rm -rf _pr_anon.git'); | ||
85 | system('git init _pr_anon.git'); | ||
86 | system('cd _pr_anon.git; git remote add origin_ssh ' | ||
84 | system('rm -rf _pr_anon.git 2>/dev/null'); | ||
85 | $r = rg_exec('git init _pr_anon.git'); | ||
86 | if ($r['ok'] != 1) { | ||
87 | rg_log_ml('r: ' . print_r($r, TRUE)); | ||
88 | rg_log('Could not init repo!'); | ||
89 | exit(1); | ||
90 | } | ||
91 | $r = rg_exec('cd _pr_anon.git; git remote add origin_ssh ' | ||
87 | 92 | . ' ssh://rocketgit@' . $rg_ssh_host . ':' . $rg_ssh_port | . ' ssh://rocketgit@' . $rg_ssh_host . ':' . $rg_ssh_port |
88 | 93 | . '/user/' . escapeshellarg($rg_ui['username']) . '/' | . '/user/' . escapeshellarg($rg_ui['username']) . '/' |
89 | 94 | . escapeshellarg($repo['name'])); | . escapeshellarg($repo['name'])); |
90 | system('cd _pr_anon.git; git remote add origin_git ' | ||
95 | if ($r['ok'] != 1) { | ||
96 | rg_log_ml('r: ' . print_r($r, TRUE)); | ||
97 | rg_log('Could not add ssh remote!'); | ||
98 | exit(1); | ||
99 | } | ||
100 | $r = rg_exec('cd _pr_anon.git; git remote add origin_git ' | ||
91 | 101 | . ' git://' . $rg_git_host . ':' . $rg_git_port | . ' git://' . $rg_git_host . ':' . $rg_git_port |
92 | 102 | . '/user/' . escapeshellarg($rg_ui['username']) . '/' | . '/user/' . escapeshellarg($rg_ui['username']) . '/' |
93 | 103 | . escapeshellarg($repo['name'])); | . escapeshellarg($repo['name'])); |
104 | if ($r['ok'] != 1) { | ||
105 | rg_log_ml('r: ' . print_r($r, TRUE)); | ||
106 | rg_log('Could not add git remote!'); | ||
107 | exit(1); | ||
108 | } | ||
94 | 109 | rg_log_exit(); | rg_log_exit(); |
95 | 110 | ||
96 | 111 | ||
97 | 112 | rg_log(''); | rg_log(''); |
98 | 113 | rg_log_enter('Do an non-anonymous push...'); | rg_log_enter('Do an non-anonymous push...'); |
99 | system('export GIT_SSH_COMMAND="ssh -o IdentityFile=../keys/pr_anon";' | ||
114 | $r = rg_exec('export GIT_SSH_COMMAND="ssh -o IdentityFile=../keys/pr_anon";' | ||
100 | 115 | . 'cd _pr_anon.git; echo "change1" > a;' | . 'cd _pr_anon.git; echo "change1" > a;' |
101 | 116 | . 'git add a; git commit -m "change1 desc";' | . 'git add a; git commit -m "change1 desc";' |
102 | 117 | . 'echo "change2" > a; git commit -a -m "change2 desc";' | . 'echo "change2" > a; git commit -a -m "change2 desc";' |
103 | 118 | . 'git push origin_ssh master'); | . 'git push origin_ssh master'); |
119 | if ($r['ok'] != 1) { | ||
120 | rg_log_ml('r: ' . print_r($r, TRUE)); | ||
121 | rg_log('Non-anonymous push was rejected!'); | ||
122 | exit(1); | ||
123 | } | ||
104 | 124 | rg_log_exit(); | rg_log_exit(); |
105 | 125 | ||
106 | 126 | ||
107 | 127 | rg_log(''); | rg_log(''); |
108 | 128 | rg_log_enter('Do an anonymous push...'); | rg_log_enter('Do an anonymous push...'); |
109 | system('cd _pr_anon.git; echo "change3" >> a;' | ||
129 | $r = rg_exec('cd _pr_anon.git; echo "change3" >> a;' | ||
110 | 130 | . 'git add a; git commit -m "anon change1 desc";' | . 'git add a; git commit -m "anon change1 desc";' |
111 | 131 | . 'echo "change4" >> a; git commit -a -m "anon change2 desc";' | . 'echo "change4" >> a; git commit -a -m "anon change2 desc";' |
112 | 132 | . 'git push origin_git master'); | . 'git push origin_git master'); |
133 | if ($r['ok'] != 1) { | ||
134 | rg_log_ml('r: ' . print_r($r, TRUE)); | ||
135 | rg_log('Anonymous push was rejected!'); | ||
136 | exit(1); | ||
137 | } | ||
113 | 138 | rg_log_exit(); | rg_log_exit(); |
114 | 139 | ||
115 | 140 | ||
116 | 141 | rg_log(''); | rg_log(''); |
117 | rg_log_enter('Check if merge is in db and is agains correct branch...'); | ||
142 | rg_log_enter('Check if merge is in db and is against correct branch...'); | ||
118 | 143 | $mri = rg_test_mr_in_db($db, $repo['repo_id']); | $mri = rg_test_mr_in_db($db, $repo['repo_id']); |
119 | 144 | if (strcmp($mri['refname'], 'refs/heads/master') != 0) { | if (strcmp($mri['refname'], 'refs/heads/master') != 0) { |
120 | 145 | rg_log_ml('mri: ' . print_r($mri, TRUE)); | rg_log_ml('mri: ' . print_r($mri, TRUE)); |
... | ... | rg_log_exit(); | |
183 | 208 | ||
184 | 209 | rg_log(''); | rg_log(''); |
185 | 210 | rg_log_enter('Now, try to see what happens when a merge is with conflicts...'); | rg_log_enter('Now, try to see what happens when a merge is with conflicts...'); |
186 | system('cd _pr_anon.git;' | ||
211 | $r = rg_exec('cd _pr_anon.git;' | ||
187 | 212 | . 'git pull origin_git master;' | . 'git pull origin_git master;' |
188 | 213 | . 'echo "change2" > a;' | . 'echo "change2" > a;' |
189 | 214 | . 'git commit -a -m "conflict1b";' | . 'git commit -a -m "conflict1b";' |
190 | 215 | . 'git push origin_git master'); | . 'git push origin_git master'); |
191 | system('export GIT_SSH_COMMAND="ssh -o IdentityFile=../keys/pr_anon";' | ||
216 | if ($r['ok'] != 1) { | ||
217 | rg_log_ml('r: ' . print_r($r, TRUE)); | ||
218 | rg_log('Could not pull/commit/push by git proto!'); | ||
219 | exit(1); | ||
220 | } | ||
221 | $r = rg_exec('export GIT_SSH_COMMAND="ssh -o IdentityFile=../keys/pr_anon";' | ||
192 | 222 | . 'cd _pr_anon.git;' | . 'cd _pr_anon.git;' |
193 | 223 | . 'git reset --hard HEAD^1;' | . 'git reset --hard HEAD^1;' |
194 | 224 | . ' echo "change1" > a;' | . ' echo "change1" > a;' |
195 | 225 | . 'git commit -a -m "conflict1a";' | . 'git commit -a -m "conflict1a";' |
196 | 226 | . 'git push origin_ssh master'); | . 'git push origin_ssh master'); |
227 | if ($r['ok'] != 1) { | ||
228 | rg_log_ml('r: ' . print_r($r, TRUE)); | ||
229 | rg_log('Could not reset/commit/push by ssh proto!'); | ||
230 | exit(1); | ||
231 | } | ||
197 | 232 | $mri = rg_test_mr_in_db($db, $repo['repo_id']); | $mri = rg_test_mr_in_db($db, $repo['repo_id']); |
198 | 233 | $data = array(); | $data = array(); |
199 | 234 | $headers = array("Cookie: sid=" . $good_sid); | $headers = array("Cookie: sid=" . $good_sid); |