Initial add of defaria.com
[clearscm.git] / defaria.com / blogs / Status / archives / week_2005_10_16.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml" id="sixapart-standard">
4 <head>
5    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6    <meta name="generator" content="Movable Type 5.2.3" />
7
8    <link rel="stylesheet" href="http://defaria.com/blogs/Status/styles-site.css" type="text/css" />
9    <link rel="alternate" type="application/atom+xml" title="Atom" href="http://defaria.com/blogs/Status/atom.xml" />
10    <link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="http://defaria.com/blogs/Status/index.xml"$>" />
11
12    <title>Status for Andrew DeFaria: October 16, 2005 - October 22, 2005 Archives</title>
13
14    <link rel="start" href="http://defaria.com/blogs/Status/" title="Home" />
15    <link rel="prev" href="http://defaria.com/blogs/Status/archives/week_2005_10_09.html" title="October  9, 2005 - October 15, 2005" />
16    <link rel="next" href="http://defaria.com/blogs/Status/archives/week_2005_10_23.html" title="October 23, 2005 - October 29, 2005" />
17 </head>
18 <body class="layout-one-column">
19    <div id="container">
20       <div id="container-inner" class="pkg">
21
22          <div id="banner">
23             <div id="banner-inner" class="pkg">
24                <h1 id="banner-header"><a href="http://defaria.com/blogs/Status/" accesskey="1">Status for Andrew DeFaria</a></h1>
25                <h2 id="banner-description">Searchable status reports and work log</h2>
26             </div>
27          </div>
28
29          <div id="pagebody">
30             <div id="pagebody-inner" class="pkg">
31                <div id="alpha">
32                   <div id="alpha-inner" class="pkg">
33                      
34                      <p class="content-nav">
35                         <a href="http://defaria.com/blogs/Status/archives/week_2005_10_09.html">&laquo; October  9, 2005 - October 15, 2005</a> |
36                         <a href="http://defaria.com/blogs/Status/">Main</a>
37                         | <a href="http://defaria.com/blogs/Status/archives/week_2005_10_23.html">October 23, 2005 - October 29, 2005 &raquo;</a>
38                      </p>
39                      
40                      
41                      
42
43                      <h2 class="date-header">October 22, 2005</h2>
44                      <a id="a000458"></a>
45                      <div class="entry" id="entry-458">
46                         <h3 class="entry-header">PQA Dynamic Lists</h3>
47                         <div class="entry-content">
48                            <div class="entry-body">
49                               <ul>
50   <li>Changed Dynamic Lists to properly handle bad data</li>
51 </ul>
52                               
53                               <h2>Dynamic Lists and Bad Data</h2>
54
55 <p>I now have pqamerge properly creating Dynamic Lists. In the past I would call SetFieldChoiceList, which would allow validate and commit to work, but which wouldn't actually add a member to the Dynamic List. I've since changed that.</p>
56
57 <p>The first problem I hit was that Clearquest would treat "1.A" as the same as "1.a". So when pqamerge attempted to add "1.a" to the Dynamic List it would fail. I needed to compare ignoring case. In Perl usually one uses a regex for that and specifies "i" to ignore case.</p>
58
59 <div class="code"><pre>
60 if ($var =~ /^$pattern$/i) {
61   &lt;<i>matched ignoring case</i>&gt;
62 } # if
63 </pre></div>
64
65 <p>But some of the values of the various Dynamic Lists contain regex meta characters (e.g. "?" or "(") which caused me problems. I've fixed those now.</p>
66
67 <div class="code"><pre>
68 if ("\L$var\E" eq "\L$pattern\E") {
69   &lt;<i>matched ignoring case</i>&gt;
70 } # if
71 </pre></div>
72
73 <p>The above basically says to downshift characters between the "\L" and the "\E". Then a regular eq is used so as to avoid problems with interpreting regex meta characters.</p>
74                               
75                               <p class="entry-footer">
76                                  <span class="post-footers">Posted by  at  1:50 PM</span> <span class="separator">|</span> <a class="permalink" href="http://defaria.com/blogs/Status/archives/000458.html">Permalink</a>
77                                  
78                                  
79                               </p>
80                            </div>
81                         </div>
82                      </div>
83                      
84                      
85
86                      <h2 class="date-header">October 21, 2005</h2>
87                      <a id="a000457"></a>
88                      <div class="entry" id="entry-457">
89                         <h3 class="entry-header">AddListMember</h3>
90                         <div class="entry-content">
91                            <div class="entry-body">
92                               <ul>
93   <li>Fixed bug in pqamerge so that it now properly adds new entries to dynamic lists</li>
94 </ul>
95                               
96                               <h2>AddListMember</h2>
97
98 <p>I was dynamically adding to Dynamic lists by calling SetFieldChoiceList. This allowed validate and commit to work and for the record to be added however it doesn't actually add to the Dynamic list! You can see this later by attempting to modify a record. It's dynamic list items will show in red and you will not be able to apply the changes because it will state that the value is not a valid choice of that dynamic list.</p>
99
100 <p>This is quite a surprise to me. I found that I need to call AddListMember to actually get this to add to the Dynamic list. This appears to be working so I need to redo the merge again.</p>
101
102                               
103                               <p class="entry-footer">
104                                  <span class="post-footers">Posted by  at  1:51 PM</span> <span class="separator">|</span> <a class="permalink" href="http://defaria.com/blogs/Status/archives/000457.html">Permalink</a>
105                                  
106                                  
107                               </p>
108                            </div>
109                         </div>
110                      </div>
111                      
112                      
113
114                      <h2 class="date-header">October 20, 2005</h2>
115                      <a id="a000456"></a>
116                      <div class="entry" id="entry-456">
117                         <h3 class="entry-header">enable_ldap/Another PQA Merge</h3>
118                         <div class="entry-content">
119                            <div class="entry-body">
120                               <ul>
121   <li>Wrote and enable_ldap Perl script</li>
122
123   <li>Vinh Ton has provided me with yet another schema and corresponding databases</li>
124 </ul>
125                               
126                               <h2>Another Merge</h2>
127
128 <p>Performing yet another merge so I will once again document the steps I take:</p>
129
130 <ul>
131   <li>Restored the databases CQSchema03, CQ_Controller_Test and CQ_Controller_Prod. Doing so wipes out the old data</li>
132
133   <li>When importing you must go into the CQSchema03 tables for master_dbs and change the server to p4test. Otherwise you will be effecting the data on the other server!</li>
134
135   <li>Enter Clearquest Designer and mark the following fields as optional:</li>
136
137     <ul>
138       <li>Submitter</li>
139
140       <li>Submit_Date</li>
141
142       <li>Audit_Log</li>
143
144       <li>old_id</li>
145    </ul>
146
147   <li>Change commitmentLevel_Value_Changed hook to simply return</li>
148
149   <li>Test Work, Check in Schema and Upgrade Database</li>
150
151   <li>Import OEMUsers.cqu and Users.cqu</li>
152
153   <li>Upgrade Database</li>
154
155   <li>Run pqamerge</li>
156
157   <li>Test</li>
158
159   <li>Reverse the schema changes performed above and apply the changes</li>
160
161   <li>Backup new CQSchema03, CQ_Controller_Test and CQ_Controller_Prod</li>
162 </ul>
163
164 <p>Use the following for a Check in Comment:</p>
165
166 <blockquote>
167   <p>Changing Submitter, Submit_Date, Audit_Log and old_id to be optional for data conversion</p>
168
169   <p>Also changed commitmentLevel_ValueChanged hook to return before sending email.</p>
170 </blockquote>
171                               
172                               <p class="entry-footer">
173                                  <span class="post-footers">Posted by  at  6:19 PM</span> <span class="separator">|</span> <a class="permalink" href="http://defaria.com/blogs/Status/archives/000456.html">Permalink</a>
174                                  
175                                  
176                               </p>
177                            </div>
178                         </div>
179                      </div>
180                      
181                      
182
183                      <h2 class="date-header">October 19, 2005</h2>
184                      <a id="a000455"></a>
185                      <div class="entry" id="entry-455">
186                         <h3 class="entry-header">Most PQA Issues resolved...</h3>
187                         <div class="entry-content">
188                            <div class="entry-body">
189                               <ul>
190   <li>Resolved most of the remaining issues with PQA Merge Vinh Ton</li>
191 </ul>
192                               
193                               <h2>Remaining Issues</h2>
194
195 <p>I have incorporated all of your changes and have imported your CQ_Controller_Prod, CQ_Controller_Test and CQSchema03 databases. I don't see any new users. Weren't they in the CQAllUsers database?</p>
196
197 <p>In any event here's how I proceeded:</p>
198 <ul>
199   <li>Made changes to pqamerge. This included handling a few new fields that I didn't notice before as well as adjustments to accommodate the changes in your last email. Also set <b>Cont:old_id</b> = the old id from the <b>TO</b> or <b>Prod</b>. Now we have a cross reference field. You will need to change your form to expose this field to the users.</li>
200
201   <li>Imported CQ_Controller_Prod, CQ_Controller_Test and CQSchema03. I see the changes that you've made to the schema.</li> 
202
203   <li>Imported OEMUsers.cqu and Users.cqu.</li>
204
205   <li>Changed <b>Submitter</b>, <b>Submit_Date</b>, <b>Audit_Log</b>,
206 and <b>old_id</b> to be optional</li>
207
208   <li>Changed <b>Global Script:</b> <i>RecordHistory</i> to simply <tt>Exit Function</tt></li>
209   <li>Changed <i>CommitmentLevel_ValueChanged</i> to <tt>Exit Sub</tt>
210 before sending email.</li>
211
212   <li>Added <b>delete</b> action to defect record for admin only. This
213 is needed for <tt>pqaclean</tt> to work.</li>
214
215   <li>Ran <tt>pqamerge</tt></li>
216 </ul>
217
218 <p>By and large this worked! There was a user who was missing. This user, <i>tngo</i>,
219 was not listed as being subscribed to either TO nor Prod, rather to BT. I suspect that he used to be subscribed to Prod but then later was removed. If there are more users like this then there will be similar errors.</p>
220
221                               
222                               <p class="entry-footer">
223                                  <span class="post-footers">Posted by  at  5:23 PM</span> <span class="separator">|</span> <a class="permalink" href="http://defaria.com/blogs/Status/archives/000455.html">Permalink</a>
224                                  
225                                  
226                               </p>
227                            </div>
228                         </div>
229                      </div>
230                      
231                      
232
233                      <h2 class="date-header">October 18, 2005</h2>
234                      <a id="a000454"></a>
235                      <div class="entry" id="entry-454">
236                         <h3 class="entry-header">PQA Merge: User Issues</h3>
237                         <div class="entry-content">
238                            <div class="entry-body">
239                               <ul>
240   <li>Starting to look into user accounts issues</li>
241
242   <li>Send out form for LDAP Authentication Information</li>
243
244   <li>Coded up pong.sh and pong.tcl to check and see if ccase-rmna-3 is up or down</li>
245
246   <li>Created initial set of PQA User/Group Account files</li>
247 </ul>
248                               
249                               <h2>PQA User/Group Account Files</h2>
250
251 <p>Here's what I did for user accounts. I've attached all the files and
252 will refer to them by name here.</p>
253
254 <h3>OEM Users</h3>
255
256 <p>First I took the export list from Clearquest (<tt>userinfo.txt.orig</tt>).
257 This is the untouched original export file.</p>
258
259 <p>Next I extracted user names that begin with "oem" -&gt; <tt>OEMUsers.cqu</tt>. Then I noticed that some of these users only appeared to be subscribed to NAS or BT. I then separated those out to <tt>OldOEMUsers.cqu</tt>.</p>
260
261 <h3>New Groups</h3>
262
263 <p>Patterning off of <tt>userinfo.txt.orig</tt> file for groups I created <tt>NewGroups.cqu</tt> to match the new groups you describe on your Users tab of the Excel Workbook. The group records from  <tt>userinfo.txt.orig</tt> I stored off in <tt>Groups.cqu</tt> and then separated off groups that were only NAS or BT to <tt>OldGroups.cqu</tt>.</p>
264
265 <h3>Other Users</h3>
266
267 <p>This left me with all of the other users which were split up into <tt>Users.cqu</tt> and <tt>RemovedUsers.cqu</tt> based on whether they
268 subscribed to Prod or TO.</p>
269
270 <h3>Changing databases= line</h3>
271
272 <p>For all files I made the following assumption: If the databases= line
273 contained no values then that means "all databases". So any users or
274 groups with a databases= line with no values I assume subscribed to TO
275 or Prod. I left these databases= lines alone.</p>
276
277 <p>For other users or groups, if TO or Prod appeared in the databases=
278 line I removed all values and put in Cont.</p>
279
280 <p>Please let me know if this comes close to what you wanted WRT users and groups.</p>
281
282                               
283                               <p class="entry-footer">
284                                  <span class="post-footers">Posted by  at  3:22 PM</span> <span class="separator">|</span> <a class="permalink" href="http://defaria.com/blogs/Status/archives/000454.html">Permalink</a>
285                                  
286                                  
287                               </p>
288                            </div>
289                         </div>
290                      </div>
291                      
292                      
293
294                      <h2 class="date-header">October 17, 2005</h2>
295                      <a id="a000453"></a>
296                      <div class="entry" id="entry-453">
297                         <h3 class="entry-header">PQA Merge Issues/Pong</h3>
298                         <div class="entry-content">
299                            <div class="entry-body">
300                               <ul>
301   <li>Documented remaining <a href="http://intranet.broadcom.com/~adefaria/Clearquest/">PQA Conversion Issues</a></li>
302
303   <li>Audit_Log is not handled properly currently. Querying Vinh</li>
304
305   <li>Resolved problem with Submitter and Submit_Date. Need to change schema to make those fields OPTIONAL as well as add return statements to the Perl action hooks</li>
306
307   <li>Investigated using LDAP authentication with Clearquest</li>
308
309   <li>Wrote a simple expect script (pong) and bash script to verify that a machine is up and send email if it isn't. Problem is ccase-rmna-1 lacks expect!</li>
310 </ul>
311                               
312                               <h2>Audit_Log</h2>
313
314 <p>As it stands <b>Audit_Log</b> is probably not being handled the way you think it should be. My investigation seems to indicate that <b>Audit_Log</b> is, as its name suggest, an auditing of what changes were made. In transferring from the old databases to the new one, the new <b>Audit_Log</b> is essentially a blank slate. It is the responsbility of the Action Script <tt>RecordHistory</tt> to update the <b>Audit_Log</b>. Thus the only recording in <b>Audit_Log</b> for the transfer is that the record was added! In    other words all history is lost! I don't think that's what you want. We will need to similarly change <b>Audit_Log</b> to be a simple <i>OPTIONAL</i> field with no Action Scripts in order for <tt>pqamerge</tt> to transfer the Audit_Log</b>.</p>
315
316 <h2>LDAP Authentication</h2>
317
318 <p>Regarding LDAP authentication: There is a whole new chapter in the Clearquest Admin Guide about this and we'll need to coordinate this with an <i>LDAP Administrator</i> (Ray, who's our LDAP Administrator?). On the plus side users would no longer have to remember separate  usernames/passwords for Clearquest. In fact, new users would not even need to be added because if they are in the ActiveDirectory then they have a login from Clearquest. Of course I suspect that security is then achieved by Clearquest groupings, which, as far as I can tell, are still manually created in Clearquest Designer's User Administration screen. Additionally, LDAP permitting, other fields will be instantaneously mapped properly like Full Name, Phone Number and the ever popular Email Address! In other words, LDAP authentication is doable but a little complicated, requires coordination with the LDAP administrator and requires a number of carefully executed commands.</p>
319
320 <p>One issue or thing to test would be if older Clearquest clients can
321 still authenticate with LDAP. If not then the user community would need
322 to update their Clearquest.</p>
323
324 <h2>Pong</h2>
325
326 <p>I now have a script called pong.sh (and a corresponding expect script called pong.tcl) that will "pong" a system and send email if it does not respond. By "pong" I mean it will telnet to the machine, attempt to login as vobadm and check for a "proper" prompt. If it fails then email is sent to the members of our project (Ray is working on a bona fide email alias...).</p>
327
328 <p>I planned on running this from ccase-rmna-1 in vobadm's crontab (BTW: There was a blank line in the crontab, which causes Solaris to complain (Other OSes are this picky. I removed that blank line).</p>
329
330 <p>The problem now is that ccase-rmna-1 lacks expect! :-( </p>
331                               
332                               <p class="entry-footer">
333                                  <span class="post-footers">Posted by  at  8:00 PM</span> <span class="separator">|</span> <a class="permalink" href="http://defaria.com/blogs/Status/archives/000453.html">Permalink</a>
334                                  
335                                  
336                               </p>
337                            </div>
338                         </div>
339                      </div>
340                      
341                      
342
343                      <h2 class="date-header">October 16, 2005</h2>
344                      <a id="a000452"></a>
345                      <div class="entry" id="entry-452">
346                         <h3 class="entry-header">PQA Clearquest:: Spacing out</h3>
347                         <div class="entry-content">
348                            <div class="entry-body">
349                               <ul>
350   <li>Fixed minor problems with trailing spaces on fields</li>
351
352   <li>Fixed minor problem with space filled <b>Software_Revision</b></li>
353
354   <li>Fixed problem where field names were reversed.</li>
355
356   <li><b>Submitter</b> and <b>Submit_Date</b> are set by action hooks to the current username and current date/time. We'll need to turn
357  this off if we want the old <b>Submitter</b> and <b>Submit_Date</b>.</li>
358
359   <li>Implemented <i>Attachment Handling</i></li>
360 </ul>
361
362
363                               
364                               <h3>Trailing spaces</h3>
365
366 <p>There are some minor problems with the data involving spaces. For example, a <b>Prod:HUT_Version</b> is set to "<i>BCM95704CA40 v1.0 revA0 </i>" - Note that it has a trailing space. Well <b>AddToFieldChoiceList()</b> attempts to add this value but the Clearquest API trims the trailing space! This results in a validation error as "<i>BCM95704CA40 v1.0 revA0 </i>" is <b>not</b> equal to "<i>BCM95704CA40 v1.0 revA0</i>". The solution here is to trim the trailing space before calling <b>AddToFieldChoiceList()</b>.</p>
367
368 <h3>Space filled Software_Revision</h3>
369
370 <p><b>Prod:Software_Version</b> would sometimes come in as " " instead of "". My code was only checking for "" and changing that to "N/A". It now also checks for " ".</p>
371
372 <h3>Field name reversal</h3>
373
374 <p>Some fields, for example <b>ReportedBy</b>, were supposed to be renamed to another field name, i.e. <b>Reported_By</b>, in the destination database but my code reversed the field naming change. It's odd that Clearquest was OK with adding <b>ReportedBy</b> field to <b>Cont</b> as there was no <b>ReportedBy</b> field in <b>Cont</b>. Adding the correct field name solved a problem with <b>Visibility</b> and its action hook.</p>
375
376 <h3>Attachments take time!</h3>
377
378 <p>While the <i>TransferAttachments()</i> routine now works, it adds a significant amount of time to the processing of defects with attachments. Some attachments are as large as 82 Meg! There are zip files, Excel spreadsheets, screen dumps in the very inefficient BMP file format and Ethreal dumps and even tape I/O dumps. <i>TransferAttachments()</i> operates by extracting the files from the source database to disk then calling <i>AddAttachment()</i> to copy the files back into the new DB. While not the most efficient way to do this I see no other way given the current Clearquest API.</p>
379
380 <p>As a measure, previously it took 16 minutes and 44 seconds to merge 1382 defect records from <b>TO</b> -> <b>Cont</b>, with attachments it took <b>4 hours and 11 minutes!!!</b></p>
381
382 <p>Ah, figured out why it took so long. I was using a snapshot view that was housed on my laptop. So the attachment files were being written to the current working directory, my snapshot view on the laptop. So those writes and reads were over the network. To make matters worse my laptop was not even at Broadcom, rather it was at my house. So those 82 meg files had to travel from Broadcom though my small DSL connection and even through a VPN! No wonder it took so long!</p>
383
384 <p>Now running it in ~vobadm/My Documents on the server and it's much quicker... Only 25 minutes and 21 seconds.</p>
385                               
386                               <p class="entry-footer">
387                                  <span class="post-footers">Posted by  at 12:57 PM</span> <span class="separator">|</span> <a class="permalink" href="http://defaria.com/blogs/Status/archives/000452.html">Permalink</a>
388                                  
389                                  
390                               </p>
391                            </div>
392                         </div>
393                      </div>
394                      
395                   </div>
396                </div>
397             </div>
398          </div>
399       </div>
400    </div>
401 </body>
402 </html>