Merge lp:~rbalint/merge-o-matic/merge-o-matic-comment into lp:merge-o-matic

Proposed by Balint Reczey
Status: Merged
Merged at revision: 295
Proposed branch: lp:~rbalint/merge-o-matic/merge-o-matic-comment
Merge into: lp:merge-o-matic
Diff against target: 108 lines (+19/-11)
4 files modified
cron.daily (+10/-8)
manual-status.py (+3/-1)
merge-status.py (+3/-1)
pack-archive.sh (+3/-1)
To merge this branch: bzr merge lp:~rbalint/merge-o-matic/merge-o-matic-comment
Reviewer Review Type Date Requested Status
Ubuntu Core Development Team Pending
Review via email: mp+323327@code.launchpad.net

Description of the change

* Show empty comment textbox in white on merge status
  It is not nice but it reflects that it is painfully empty. Fill it with
  a BTS bug number in which the delta is forwarded! :-)
  Closes: LP: #1686640

* Consolidate hard-coded /srv/patches.ubuntu.com paths

I need to test the last <%..%> replacements, but otherwise this seems to be working.
If someone could test those quickly that would be nice.

To post a comment you must log in.
295. By Balint Reczey

Show empty comment textbox in white on merge status

It is not nice but it reflects that it is painfully empty. Fill it with
a BTS bug number in which the delta is forwarded! :-)

Closes: LP: #1686640

296. By Balint Reczey

Consolidate hard-coded /srv/patches.ubuntu.com paths

Revision history for this message
Brian Murray (brian-murray) wrote :

We tested this on merges.ubuntu.com and discovered that the indent of the req.write() ended up causing and error.

https://merges.ubuntu.com/main-new.html

Revision history for this message
Balint Reczey (rbalint) :

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'cron.daily'
2--- cron.daily 2016-01-09 17:25:53 +0000
3+++ cron.daily 2017-06-09 00:45:42 +0000
4@@ -19,12 +19,14 @@
5 set -e
6 umask 002
7
8+MOMLIB_ROOT=/srv/patches.ubuntu.com
9+
10 if [ "$DEBUG" = "y" ]; then
11 QUIET=""
12 else
13 QUIET="-q"
14
15- if ! mkdir /srv/patches.ubuntu.com/.lock 2>/dev/null; then
16+ if ! mkdir $MOMLIB_ROOT/.lock 2>/dev/null; then
17 # Only produce cronspam if running from a terminal or the
18 # lock has been held for more than three hours.
19 age () {
20@@ -34,7 +36,7 @@
21 echo "$(($now - $mtime))"
22 }
23 if [ -t 0 ] || \
24- [ "$(age /srv/patches.ubuntu.com/.lock)" -gt \
25+ [ "$(age $MOMLIB_ROOT/.lock)" -gt \
26 $((3 * 60 * 60)) ]; then
27 echo "LOCKED (another one running?)"
28 exit 1
29@@ -42,19 +44,19 @@
30 exit 0
31 fi
32 fi
33- trap "rmdir /srv/patches.ubuntu.com/.lock" 0
34+ trap "rmdir $MOMLIB_ROOT/.lock" 0
35 fi
36
37-cd /srv/patches.ubuntu.com/code
38+cd $MOMLIB_ROOT/code
39 #bzr update
40
41-cp addcomment.py /srv/patches.ubuntu.com/merges
42+cp addcomment.py $MOMLIB_ROOT/merges
43
44 # Update the blacklist
45-wget -q -O/srv/patches.ubuntu.com/sync-blacklist.txt http://people.canonical.com/~ubuntu-archive/sync-blacklist.txt
46+wget -q -O$MOMLIB_ROOT/sync-blacklist.txt http://people.canonical.com/~ubuntu-archive/sync-blacklist.txt
47
48 # Update the package to team mapping
49-wget -q -O/srv/patches.ubuntu.com/code/package-team-mapping.json http://people.canonical.com/~ubuntu-archive/package-team-mapping.json
50+wget -q -O$MOMLIB_ROOT/code/package-team-mapping.json http://people.canonical.com/~ubuntu-archive/package-team-mapping.json
51
52 # Download new packages
53 ./update-pool.py $QUIET debian ubuntu
54@@ -88,4 +90,4 @@
55 ./expire-pool.py $QUIET
56
57 # ?! untidy
58-rm -rf /srv/patches.ubuntu.com/unpacked/*
59+rm -rf $MOMLIB_ROOT/unpacked/*
60
61=== modified file 'manual-status.py'
62--- manual-status.py 2016-11-18 21:42:52 +0000
63+++ manual-status.py 2017-06-09 00:45:42 +0000
64@@ -351,9 +351,11 @@
65 file=status)
66 print("<%%\n\
67 the_comment = \"\"\n\
68+the_color = \"white\"\n\
69 if \"%s\" in comment:\n\
70 the_comment = comment[\"%s\"]\n\
71-req.write(\"<input type=\\\"text\\\" style=\\\"border-style: none; background-color: %s\\\" name=\\\"comment\\\" value=\\\"%%s\\\" title=\\\"%%s\\\" />\" %% (the_comment, the_comment))\n\
72+ the_color = \"%s\"\n\
73+ req.write(\"<input type=\\\"text\\\" style=\\\"border-style: none; background-color: %%s\\\" name=\\\"comment\\\" value=\\\"%%s\\\" title=\\\"%%s\\\" />\" %% (the_color, the_comment, the_comment))\n\
74 %%>" % (package, package, COLOURS[colour_idx]), file=status)
75 print("</form></td>", file=status)
76 print("<td rowspan=2>", file=status)
77
78=== modified file 'merge-status.py'
79--- merge-status.py 2016-11-18 21:42:52 +0000
80+++ merge-status.py 2017-06-09 00:45:42 +0000
81@@ -368,9 +368,11 @@
82 print("<input type=\"hidden\" name=\"package\" value=\"%s\" />" % package, file=status)
83 print("<%%\n\
84 the_comment = \"\"\n\
85+the_color = \"white\"\n\
86 if \"%s\" in comment:\n\
87 the_comment = comment[\"%s\"]\n\
88-req.write(\"<input type=\\\"text\\\" style=\\\"border-style: none; background-color: %s\\\" name=\\\"comment\\\" value=\\\"%%s\\\" title=\\\"%%s\\\" />\" %% (the_comment, the_comment))\n\
89+ the_color = \"%s\"\n\
90+ req.write(\"<input type=\\\"text\\\" style=\\\"border-style: none; background-color: %%s\\\" name=\\\"comment\\\" value=\\\"%%s\\\" title=\\\"%%s\\\" />\" %% (the_color, the_comment, the_comment))\n\
91 %%>" % (package, package, COLOURS[colour_idx]), file=status)
92 print("</form></td>", file=status)
93 print("<td rowspan=2>", file=status)
94
95=== modified file 'pack-archive.sh'
96--- pack-archive.sh 2012-01-30 17:19:42 +0000
97+++ pack-archive.sh 2017-06-09 00:45:42 +0000
98@@ -3,7 +3,9 @@
99 set -e
100 umask 002
101
102-cd /srv/patches.ubuntu.com
103+MOMLIB_ROOT=/srv/patches.ubuntu.com
104+
105+cd $MOMLIB_ROOT
106
107 find changes -name "*.changes" -mtime +182 -print0 | xargs -0r bzip2
108 find diffs -name "*.patch" -mtime +182 -print0 | xargs -0r bzip2

Subscribers

People subscribed via source and target branches

to status/vote changes: