-
Notifications
You must be signed in to change notification settings - Fork 5
/
ballot-github-issue.sh
executable file
·116 lines (96 loc) · 2.45 KB
/
ballot-github-issue.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
#!/usr/bin/bash
ISSUE=$1
ISSUE=${ISSUE/#https:\/\/github.com\/oasis-tcs\/virtio-spec\/issues\//}
if
./virtio-github.pl -p t $ISSUE > /tmp/summary
then
TITLE=$(cat /tmp/summary)
else
exit 1
fi
echo -n "Resolve Issue #$ISSUE: $TITLE" > /tmp/title
if
./virtio-github.pl -p f $ISSUE > /tmp/fixVersions
then
versions="specification version(s) "
for v in "$(cat /tmp/fixVersions)"
do
versions="$versions\"$v\", "
done
versions="${versions}and "
else
versions=""
fi
cat > /tmp/question << EOF
Should the TC accept changes listed in the description to resolve issue $ISSUE,
for inclusion in ${versions}future versions of the specification?
EOF
if
./virtio-github.pl -p d $ISSUE > /tmp/prob
then
prob=1
else
exit 2
fi
if
./virtio-github.pl -p p $ISSUE > /tmp/proposal
then
res=1
else
exit 3
fi
cat > /tmp/description <<EOF
Please vote Yes if you agree with all of the following.
If you disagree, please vote No.
If you don't have an opinion, please vote Abstain.
I move that:
The TC agrees to resolve the following specification issue:
Issue #$ISSUE: $TITLE
--------------------------------------
EOF
cat /tmp/prob >> /tmp/description
cat >> /tmp/description <<EOF
--------------------------------------
The TC accepts the following proposed changes to the specification:
--------------------------------------
EOF
cat /tmp/proposal >> /tmp/description
cat >> /tmp/description <<EOF
--------------------------------------
The TC agrees to include the above change(s) in ${versions}future versions of the
specification.
--------------------------------------
Reminder: A Voting Member must be active in a TC to maintain voting rights. As
the Virtio TC has adopted a standing rule to conduct business only by
electronic ballot, without Meetings, a Voting Member who fails to cast a ballot
in two consecutive Work Product Ballots loses his or her voting rights at the
close of the second ballot missed.
--------------------------------------
EOF
vim /tmp/title
c=`wc -c </tmp/title`
if
test $c -lt 6
then
echo NO TITLE: ABORTING
exit 4
fi
vim /tmp/question
c=`wc -c </tmp/question`
if
test $c -lt 6
then
echo NO QUESTION: ABORTING
exit 5
fi
vim /tmp/description
c=`wc -c </tmp/description`
if
test $c -lt 6
then
echo NO DESCRIPTION: ABORTING
exit 6
fi
./virtio-ballot.pl "$(cat /tmp/title)" "$(cat /tmp/question)" "$(cat /tmp/description)" | tee /tmp/ballot-issue-log
ballot=$(grep 'BALLOT CREATED' /tmp/ballot-issue-log)
./virtio-github.pl -comment "$ballot" $ISSUE