File TODO changed (mode: 100644) (index 2585d29..187ac6d) |
1 |
1 |
== Where I stopped last time == |
== Where I stopped last time == |
2 |
|
[ ] hook_update.sh is not working right. |
|
3 |
|
[ ] phase1: Friends will need a way to register an account with a full account type. |
|
4 |
|
Find a way to distribute this code and a way to support it in rg. |
|
5 |
|
Probably I will allow only one plan (Friends) till they all create |
|
6 |
|
accounts. After this, I will remove this plan? |
|
|
2 |
|
[ ] Add a Terms of Services. Added, but check the link and the create |
|
3 |
|
account form. |
7 |
4 |
[ ] phase1: In mail, ar trebui adaugata si misiunea acestui proiect. |
[ ] phase1: In mail, ar trebui adaugata si misiunea acestui proiect. |
8 |
5 |
Eventual un FAQ care sa contina si cum vom sustine acest proiect |
Eventual un FAQ care sa contina si cum vom sustine acest proiect |
9 |
6 |
din punct de vedere financiar. Nu uita de repo-uri privat/publice. |
din punct de vedere financiar. Nu uita de repo-uri privat/publice. |
10 |
7 |
[ ] phase1: add in mail a text like: "...any info ... reply to this e-mail" |
[ ] phase1: add in mail a text like: "...any info ... reply to this e-mail" |
11 |
8 |
[ ] phase1: In mail trebuie sa existe un link catre site-ul principal. |
[ ] phase1: In mail trebuie sa existe un link catre site-ul principal. |
12 |
|
[ ] Se pare ca sesiunea expira, indifierent daca e activa (apas butoane)! |
|
13 |
|
[ ] Accessing a file with '"' inside, is not working. |
|
14 |
|
See rocketgit.com/user/catalinux/test1/source/tree/blob/"xx\"yy" |
|
15 |
9 |
[ ] First page: our mission, how do I install it etc.? |
[ ] First page: our mission, how do I install it etc.? |
16 |
|
[ ] themes/default/repo/bug/note_add.html. @@note@@ is correct? |
|
17 |
|
[ ] Seems we are stuck processing events in events.php daemon because we are |
|
18 |
|
stuck in 'accept'. We should keep processing the events queue. |
|
|
10 |
|
[ ] phase1: Probably I will define a single plan. |
|
11 |
|
|
|
12 |
|
[ ] Se pare ca sesiunea expira, indifierent daca e activa (apas butoane)! |
|
13 |
|
Unit test? |
19 |
14 |
[ ] Check 'description_nice' and apply this everywhere. Maybe we should unset |
[ ] Check 'description_nice' and apply this everywhere. Maybe we should unset |
20 |
15 |
'description', so people will not be tempted to use it. |
'description', so people will not be tempted to use it. |
21 |
|
Maybe just overwrite 'description'. And then continue with 'note' |
|
22 |
|
unit testing. |
|
|
16 |
|
Maybe just overwrite 'description'. |
23 |
17 |
Planul este sa auditez peste tot dca folosesc variabile luate cu |
Planul este sa auditez peste tot dca folosesc variabile luate cu |
24 |
18 |
rg_var_str, rg_var_re & rg_var_cookie_re. si le trintesc pe |
rg_var_str, rg_var_re & rg_var_cookie_re. si le trintesc pe |
25 |
19 |
output fara a le trece prin template sau rg_xss_safe. |
output fara a le trece prin template sau rg_xss_safe. |
|
27 |
21 |
Nu e OK. Trebuie doar pentru anumite cazuri: la o descriere pe pagina |
Nu e OK. Trebuie doar pentru anumite cazuri: la o descriere pe pagina |
28 |
22 |
proiectului, e nevoie. Dar intr-un form, in textarea, nu e nevoie. |
proiectului, e nevoie. Dar intr-un form, in textarea, nu e nevoie. |
29 |
23 |
Apoi as putea elimina description_nice. |
Apoi as putea elimina description_nice. |
30 |
|
[ ] Test closing a bug/watch/unwatch/etc. |
|
31 |
24 |
[ ] Security: Link-uri + xss (Ionut) |
[ ] Security: Link-uri + xss (Ionut) |
32 |
25 |
[ ] |
[ ] |
33 |
26 |
|
|
34 |
27 |
== BEFORE NEXT RELEASE == |
== BEFORE NEXT RELEASE == |
|
28 |
|
[ ] Add a "Stats" menu per repo: at least disk size. |
|
29 |
|
[ ] Seems we are stuck processing events in events.php daemon because we are |
|
30 |
|
stuck in 'accept'. We should keep processing the events queue. |
|
31 |
|
I think this was because we did not signal the daemon. Can be closed? |
|
32 |
|
[ ] Accessing a file with '"' inside, is not working. |
|
33 |
|
See rocketgit.com/user/catalinux/test1/source/tree/blob/"xx\"yy" |
|
34 |
|
[ ] Build a vm image to offer for download. |
|
35 |
|
[ ] Add an option to specify a licence for the projects. |
|
36 |
|
[ ] Present bugs as a git repo, so we easily add a new one by push? |
|
37 |
|
[ ] Configuration: a number of months to keep history (see slaves). |
|
38 |
|
[ ] vagrant install? |
|
39 |
|
[ ] If I generated some activity on an object, do not notify myself. |
35 |
40 |
[ ] Show the age of a repo/user/bug/etc. |
[ ] Show the age of a repo/user/bug/etc. |
36 |
41 |
[ ] We should update the size of the repos only if is dirty (something pushed). |
[ ] We should update the size of the repos only if is dirty (something pushed). |
37 |
42 |
[ ] Before custom hooks, allow enforcing a custom regex for a commit. |
[ ] Before custom hooks, allow enforcing a custom regex for a commit. |
File inc/watch.inc.php changed (mode: 100644) (index 0dc1937..3817a05) |
... |
... |
function rg_watch_del($db, $type, $login_uid, $obj_id1, $obj_id2) |
137 |
137 |
|
|
138 |
138 |
$ret = FALSE; |
$ret = FALSE; |
139 |
139 |
while (1) { |
while (1) { |
|
140 |
|
$params = array("login_uid" => $login_uid, |
|
141 |
|
"obj_id1" => $obj_id1, |
|
142 |
|
"obj_id2" => $obj_id2); |
|
143 |
|
|
140 |
144 |
if (strcmp($type, "bug") == 0) { |
if (strcmp($type, "bug") == 0) { |
141 |
145 |
$sql = "DELETE FROM watch_bug" |
$sql = "DELETE FROM watch_bug" |
142 |
|
. " WHERE uid = $login_uid" |
|
143 |
|
. " AND repo_id = $obj_id1" |
|
144 |
|
. " AND bug_id = $obj_id2"; |
|
|
146 |
|
. " WHERE uid = @@login_uid@@" |
|
147 |
|
. " AND repo_id = @@obj_id1@@" |
|
148 |
|
. " AND bug_id = @@obj_id2@@"; |
145 |
149 |
} else if (strcmp($type, "repo") == 0) { |
} else if (strcmp($type, "repo") == 0) { |
146 |
150 |
$sql = "DELETE FROM watch_repo" |
$sql = "DELETE FROM watch_repo" |
147 |
|
. " WHERE uid = $login_uid" |
|
148 |
|
. " AND repo_id = $obj_id1"; |
|
|
151 |
|
. " WHERE uid = @@login_uid@@" |
|
152 |
|
. " AND repo_id = @@obj_id1@@"; |
149 |
153 |
} else { |
} else { |
150 |
154 |
rg_internal_error("Invalid watch type!"); |
rg_internal_error("Invalid watch type!"); |
151 |
155 |
break; |
break; |
152 |
156 |
} |
} |
153 |
|
$res = rg_sql_query($db, $sql); |
|
|
157 |
|
$res = rg_sql_query_params($db, $sql, $params); |
154 |
158 |
if ($res === FALSE) |
if ($res === FALSE) |
155 |
159 |
break; |
break; |
156 |
160 |
rg_sql_free_result($res); |
rg_sql_free_result($res); |
File tests/http_bug.php changed (mode: 100644) (index d9547d0..35aae2e) |
... |
... |
$sql = 'SELECT * FROM bugs WHERE repo_id = ' . $repo['repo_id']; |
60 |
60 |
$res = rg_sql_query($db, $sql); |
$res = rg_sql_query($db, $sql); |
61 |
61 |
$row = rg_sql_fetch_array($res); |
$row = rg_sql_fetch_array($res); |
62 |
62 |
rg_sql_free_result($res); |
rg_sql_free_result($res); |
|
63 |
|
if ($row['bug_id'] != 1) { |
|
64 |
|
rg_log("Seems the bugs do not start at 1, but " . $row['bug_id']); |
|
65 |
|
exit(1); |
|
66 |
|
} |
63 |
67 |
if ($row['assigned_uid'] != $rg_ui2['uid']) { |
if ($row['assigned_uid'] != $rg_ui2['uid']) { |
64 |
68 |
rg_log('assigned_uid is not ' . $rg_ui2['uid'] |
rg_log('assigned_uid is not ' . $rg_ui2['uid'] |
65 |
69 |
. ', but ' . $row['assigned_uid'] . '!'); |
. ', but ' . $row['assigned_uid'] . '!'); |
|
... |
... |
if ($row['state'] != 1) { |
69 |
73 |
rg_log('State is not 1 but ' . $row['state'] . '!'); |
rg_log('State is not 1 but ' . $row['state'] . '!'); |
70 |
74 |
exit(1); |
exit(1); |
71 |
75 |
} |
} |
72 |
|
$bug_id = $row['bug_id']; |
|
73 |
76 |
$sql = 'SELECT * FROM bug_labels WHERE repo_id = ' . $repo['repo_id'] |
$sql = 'SELECT * FROM bug_labels WHERE repo_id = ' . $repo['repo_id'] |
74 |
|
. ' AND bug_id = ' . $bug_id; |
|
|
77 |
|
. ' AND bug_id = 1'; |
75 |
78 |
$res = rg_sql_query($db, $sql); |
$res = rg_sql_query($db, $sql); |
76 |
79 |
$g = array(); |
$g = array(); |
77 |
80 |
while (($row = rg_sql_fetch_array($res))) { |
while (($row = rg_sql_fetch_array($res))) { |
|
... |
... |
if (strcmp($p1, $p2) != 0) { |
89 |
92 |
|
|
90 |
93 |
rg_log("Testing adding a note"); |
rg_log("Testing adding a note"); |
91 |
94 |
|
|
92 |
|
rg_log("Loading note form..."); |
|
|
95 |
|
rg_log("Loading bug/note form..."); |
93 |
96 |
$url = "/user/" . $rg_ui['username'] . "/" . $repo['name'] . "/bug/1"; |
$url = "/user/" . $rg_ui['username'] . "/" . $repo['name'] . "/bug/1"; |
94 |
97 |
$data = array(); |
$data = array(); |
95 |
98 |
$r = do_req($test_url . $url, $data, $headers); |
$r = do_req($test_url . $url, $data, $headers); |
|
... |
... |
if ($r === FALSE) { |
109 |
112 |
exit(1); |
exit(1); |
110 |
113 |
} |
} |
111 |
114 |
$sql = 'SELECT * FROM bug_notes WHERE repo_id = ' . $repo['repo_id'] |
$sql = 'SELECT * FROM bug_notes WHERE repo_id = ' . $repo['repo_id'] |
112 |
|
. ' AND bug_id = ' . $bug_id; |
|
|
115 |
|
. ' AND bug_id = 1'; |
113 |
116 |
$res = rg_sql_query($db, $sql); |
$res = rg_sql_query($db, $sql); |
114 |
117 |
$row = rg_sql_fetch_array($res); |
$row = rg_sql_fetch_array($res); |
115 |
118 |
rg_sql_free_result($res); |
rg_sql_free_result($res); |
|
... |
... |
if ($row['uid'] != $rg_ui['uid']) { |
122 |
125 |
exit(1); |
exit(1); |
123 |
126 |
} |
} |
124 |
127 |
|
|
|
128 |
|
|
|
129 |
|
// Test closing a bug |
|
130 |
|
$token = $r['token']; |
|
131 |
|
rg_log("Posting close bug form..."); |
|
132 |
|
$data = array('token' => $token, |
|
133 |
|
'close_reopen' => 1, |
|
134 |
|
'state' => 2); |
|
135 |
|
$r = do_req($test_url . $url, $data, $headers); |
|
136 |
|
if ($r === FALSE) { |
|
137 |
|
rg_log('Cannot post bug request.'); |
|
138 |
|
exit(1); |
|
139 |
|
} |
|
140 |
|
$sql = 'SELECT * FROM bugs WHERE repo_id = ' . $repo['repo_id'] |
|
141 |
|
. ' AND bug_id = 1'; |
|
142 |
|
$res = rg_sql_query($db, $sql); |
|
143 |
|
$row = rg_sql_fetch_array($res); |
|
144 |
|
rg_sql_free_result($res); |
|
145 |
|
if ($row['state'] != 2) { |
|
146 |
|
rg_log('Seems we could not close the bug; state= [' . $row['state']); |
|
147 |
|
exit(1); |
|
148 |
|
} |
|
149 |
|
|
|
150 |
|
|
|
151 |
|
// Test re-opening a bug |
|
152 |
|
$token = $r['token']; |
|
153 |
|
rg_log("Posting re-open bug form..."); |
|
154 |
|
$data = array('token' => $token, |
|
155 |
|
'close_reopen' => 1, |
|
156 |
|
'state'=> 1); |
|
157 |
|
$r = do_req($test_url . $url, $data, $headers); |
|
158 |
|
if ($r === FALSE) { |
|
159 |
|
rg_log('Cannot post bug request.'); |
|
160 |
|
exit(1); |
|
161 |
|
} |
|
162 |
|
$sql = 'SELECT * FROM bugs WHERE repo_id = ' . $repo['repo_id'] |
|
163 |
|
. ' AND bug_id = 1'; |
|
164 |
|
$res = rg_sql_query($db, $sql); |
|
165 |
|
$row = rg_sql_fetch_array($res); |
|
166 |
|
rg_sql_free_result($res); |
|
167 |
|
if ($row['state'] != 1) { |
|
168 |
|
rg_log('Seems we could not re-open the bug;' |
|
169 |
|
. ' state= [' . $row['state'] . ']!'); |
|
170 |
|
exit(1); |
|
171 |
|
} |
|
172 |
|
|
|
173 |
|
|
|
174 |
|
rg_log("Testing deleting a bug"); |
|
175 |
|
for ($i = 0; $i <= 1; $i++) { |
|
176 |
|
$token = $r['token']; |
|
177 |
|
rg_log("Posting delete bug form..."); |
|
178 |
|
$data = array('token' => $token, |
|
179 |
|
'del_undel' => $i + 1); |
|
180 |
|
$r = do_req($test_url . $url, $data, $headers); |
|
181 |
|
if ($r === FALSE) { |
|
182 |
|
rg_log('Cannot post bug request.'); |
|
183 |
|
exit(1); |
|
184 |
|
} |
|
185 |
|
$sql = 'SELECT * FROM bugs WHERE repo_id = ' . $repo['repo_id'] |
|
186 |
|
. ' AND bug_id = 1'; |
|
187 |
|
$res = rg_sql_query($db, $sql); |
|
188 |
|
$row = rg_sql_fetch_array($res); |
|
189 |
|
rg_sql_free_result($res); |
|
190 |
|
if ($i == 0) |
|
191 |
|
$test = $row['deleted'] > 0; |
|
192 |
|
else |
|
193 |
|
$test = $row['deleted'] == 0; |
|
194 |
|
if (!$test) { |
|
195 |
|
rg_log('i=' . $i . ': Seems we could not delete/undelete the bug;' |
|
196 |
|
. ' deleted= [' . $row['deleted'] . ']!'); |
|
197 |
|
exit(1); |
|
198 |
|
} |
|
199 |
|
if ($row['deleted_who'] != $rg_ui['uid']) { |
|
200 |
|
rg_log('i=' . $i . ': Seems the deleted_who was not updated;' |
|
201 |
|
. ' deleted_who= [' . $row['deleted_who'] . ']!'); |
|
202 |
|
exit(1); |
|
203 |
|
} |
|
204 |
|
} |
|
205 |
|
|
|
206 |
|
|
|
207 |
|
// Test watching a bug - we need to login as a different user |
|
208 |
|
$r = test_login($test_url, $rg_ui2, $good_sid); |
|
209 |
|
if ($r === FALSE) |
|
210 |
|
exit(1); |
|
211 |
|
$headers = array("Cookie: sid=" . $good_sid); |
|
212 |
|
|
|
213 |
|
// We are already in the watch list because the asignee is automatically added |
|
214 |
|
for ($i = 0; $i <= 1; $i++) { |
|
215 |
|
rg_log("Loading bug form (i=$i)..."); |
|
216 |
|
$data = array(); |
|
217 |
|
$r = do_req($test_url . $url, $data, $headers); |
|
218 |
|
if ($r === FALSE) { |
|
219 |
|
rg_log('Cannot load bug form.'); |
|
220 |
|
exit(1); |
|
221 |
|
} |
|
222 |
|
$token = $r['token']; |
|
223 |
|
|
|
224 |
|
rg_log("Posting (un)watch bug form..."); |
|
225 |
|
$data = array('token' => $token, 'watch' => $i, 'unwatch' => 1 - $i); |
|
226 |
|
$r = do_req($test_url . $url, $data, $headers); |
|
227 |
|
if ($r === FALSE) { |
|
228 |
|
rg_log('Cannot post watch bug request.'); |
|
229 |
|
exit(1); |
|
230 |
|
} |
|
231 |
|
$sql = 'SELECT uid FROM watch_bug WHERE repo_id = ' . $repo['repo_id'] |
|
232 |
|
. ' AND bug_id = 1'; |
|
233 |
|
$res = rg_sql_query($db, $sql); |
|
234 |
|
$rows = rg_sql_num_rows($res); |
|
235 |
|
$row = array(); |
|
236 |
|
while (($r = rg_sql_fetch_array($res))) |
|
237 |
|
$row[] = $r; |
|
238 |
|
rg_sql_free_result($res); |
|
239 |
|
|
|
240 |
|
if ($i == 0) { // unwatch - only rg_ui[uid] should be present |
|
241 |
|
if (($rows != 1) || ($row[0]['uid'] != $rg_ui['uid'])) { |
|
242 |
|
rg_log_ml('Seems we could not watch the bug; row:' |
|
243 |
|
. print_r($row, TRUE)); |
|
244 |
|
exit(1); |
|
245 |
|
} |
|
246 |
|
} else { |
|
247 |
|
$_l = array($rg_ui['uid'], $rg_ui2['uid']); |
|
248 |
|
for ($j = 0; $j <= 1; $j++) { |
|
249 |
|
if (!in_array($row[$j]['uid'], $_l)) { |
|
250 |
|
rg_log('Seems I cannot unwatch a bug' |
|
251 |
|
. ' (' . $row[$j]['uid'] |
|
252 |
|
. ' is not in the expected list)!'); |
|
253 |
|
exit(1); |
|
254 |
|
} |
|
255 |
|
} |
|
256 |
|
} |
|
257 |
|
} |
|
258 |
|
|
|
259 |
|
|
125 |
260 |
rg_prof_log(); |
rg_prof_log(); |
126 |
261 |
rg_log("OK!"); |
rg_log("OK!"); |
127 |
262 |
?> |
?> |