RSS

Precis – from the book “Powerful Proposals”

The book “Powerful Proposals” by David G.Pugh & Terry R.Bacon seems to be a must read for those who start Proposal writing or Proposal Management or Business development. Especially this book demystifies basics of proposal writing and management from both the sides…precisely talks about the buyers, evaluation process, proposal lifecycle & quality indicators of a proposal etc.. guess below précis could benefit those who can’t read the complete book…Precis-Proposal writing

 

Tags: ,

Classic Build Maturity path

Often there are some questions from the management with respect to build management space, especially when code promotions/release take more time, late night fire fighting over a period or build promotion flunked and QA team raises concerns

1. What is my build maturity?

2. Where does it stand against industry best practices?

3. My build engineer says we have the best process but still it fails often, takes longer duration and I feel some gap….

I tried putting together a classic build maturity path which could help us to comprehend the current state and best state too…I certainly think the maturity could vary based on the application/product architecture and there could be genuine reasons towards some of the current facts … however, I trust this could be a starting point when we stand clueless

I categorize them from Stage 0 thru Stage 4 as shown below

If you are following Agile methodology, I swear anything lesser than Stage 4 is affecting your delivery, quality & productivity. There are plenty of tools in the market which could help you to uplift from wherever you are today and reach Stage 4 fairly in about 6 months time.

Hope this post is useful.

Thanks!!

 

Tags: , ,

Track TFS group membership changes

TFS provides quite a few automated notifications out of the box. For example, you can right click on the team project from team explorer and navigate to Project Alerts to view and set the available alerts.

Typically we see following options to set alerts


Should we need additional notifications, we can always extend TFS & utilize the event service. TFS offers the option to register, subscribe for event notifications and process the captured events. For detailed documentation on event subscription, please navigate
here.

And also there is an event subscription tool available in
Codeplex.

However, if we look at the available events, there is no solution to track TFS group membership changes. This is one of the critical needs during auditing. So, below is an attempt to address this partially.

The approach that I’ve outlined below would capture the event, process the Sequence Id to read more details on that specific sequence id and log an entry in your event viewer.

First let’s create an event handler

1. Create a web service project



Code behind the Web Service

using System;

using System.Xml;

using System.Net;

using System.Linq;

using System.IO;

using System.Diagnostics;

using System.Security.Principal;

using System.Collections.Generic;

using System.Web;

using System.Web.Services;

using System.Web.Services.Protocols;

using Microsoft.TeamFoundation;

using Microsoft.TeamFoundation.Server;

using Microsoft.TeamFoundation.Client;

Add above references.

Change the Namespace and class name as needed. Here I’ve changed the Namespace to “My_TFSEventCapture” and class to “DataChangedEvent”

namespace TFSDataChangedEventCatch

{


///
<summary>


/// Summary description for Service1


///
</summary>

[WebService(Namespace = "My_TFSEventCapture")]

[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]

[System.ComponentModel.ToolboxItem(false)]


// To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.


// [System.Web.Script.Services.ScriptService]


public
class
DataChangedEvent : System.Web.Services.WebService

{

[SoapDocumentMethod(Action =
"http://schemas.microsoft.com/TeamFoundation/2005/06/Services/Notification/03/Notify",
RequestNamespace="http://schemas.microsoft.com/TeamFoundation/2005/06/Services/Notification/03")]

 

Following Web method should contain logic to process the event notification. Typically eventXml contains notification data. In our case the eventXml will have a Sequence ID and Data type.

Example:
    
<?xml
version=1.0
encoding=utf-16?>

<DataChangedEvent
xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance
xmlns:xsd=http://www.w3.org/2001/XMLSchema>


<
DataType>IDENTITY</DataType>

<SeqId>194</SeqId>

</DataChangedEvent>

Need to validate the Data type and ensure its IDENTITY then process the Sequence Id.

[WebMethod]


public
void Notify(string eventXml, string tfsIdentityXml)

{


//Write your custom code here


//Use eventXml to extract event related fields and their values


XmlDocument myXmlDocument = new
XmlDocument();

myXmlDocument.LoadXml(eventXml);


XmlNode node;

node = myXmlDocument.DocumentElement;


int SeqId = int.Parse(node.SelectSingleNode(“SeqId”).InnerText) – 1;

Now, pass the SequenceId & get the identity changes from IGroupSecurityService2.


foreach (XmlNode node2 in node.ChildNodes)

{


if (node2.Name == “DataType” && SeqId != 0 && node2.InnerText == “IDENTITY”)

{

TfsTeamProjectCollection tpc = new
TfsTeamProjectCollection(new
Uri(“http://TFSDemo:8080/tfs2010″), new
NetworkCredential(“user”, “password”, “domain”));

//try catch here

tpc.EnsureAuthenticated();


IGroupSecurityService2 gss3 = tpc.GetService<IGroupSecurityService2>();


var ChangedIdentities = gss3.GetChangedIdentities(SeqId);

WriteTrace(“IdentityChanges” + “\\n” + ChangedIdentities);

ProcessChangedIdentities(ChangedIdentities);

}

}

}

GetChangedIdentities returns a string like
<?xml version=”1.0″ encoding=”utf-16″?><IdentityChanges MaxSequence=”194″ fMore=”0″><Identities><Identity SID=”S-1-5-21-919044463-614821983-2752388159-1014″ AccountName=”Visitor” DisplayName=”Visitor” DistinguishedName=”WinNT://TFSDemo/Visitor” Domain=”Demo” MailAddress=”" SpecialType=”Generic” Type=”WindowsUser” Deleted=”False” /><Identity SID=”S-1-9-1551374245-4271671090-1142510150-2272580956-3725988686-1-1830461201-1958035529-2898280848-1812300448″ AccountName=”Contributors” DisplayName=”[SampleAgile]\Contributors” DistinguishedName=”" Domain=”vstfs:///Classification/TeamProject/9eb7de28-b3d3-4afe-9ea4-6da938d0c46c” MailAddress=”" SpecialType=”Generic” Type=”ApplicationGroup” Deleted=”False”><Members><Member SID=”S-1-5-21-919044463-614821983-2752388159-1014″ /><Member SID=”S-1-5-21-919044463-614821983-2752388159-1000″ /></Members></Identity></Identities></IdentityChanges>

The result string should be analyzed to determine the type of operation. Key nodes to grasp from the resultant string

1. SID

2. Account name

3. Type (WindowsUser, ApplicationGroup etc)

4. Deleted (True, False)

Typically, the resultant string contains 2 Identities.

For delete operation Deleted will reflect True, False otherwise.

Following logic should construct a message like “User ADDED to SomeGroup” or “User DELETED from SomeGroup”


private
void ProcessChangedIdentities(string ChangedIdentities)

{


string message = null;


XmlDocument myXmlDocument = new
XmlDocument();

myXmlDocument.LoadXml(ChangedIdentities);


XmlNodeList xnList = myXmlDocument.SelectNodes(“/IdentityChanges/Identities/Identity”);

WriteTrace(“Identity change Count “ + xnList.Count);


if (xnList.Count == 2)

{


if ((string)xnList[0].Attributes["Type"].InnerText == “WindowsUser” && (string)xnList[0].Attributes["Deleted"].InnerText == “True”)

{

message = (string)xnList[0].Attributes["DisplayName"].InnerText + ” DELETED from “ + (string)xnList[1].Attributes["DisplayName"].InnerText;

}


else

{

message = (string)xnList[0].Attributes["DisplayName"].InnerText + ” ADDED to “ + (string)xnList[1].Attributes["DisplayName"].InnerText;

}

}


else

{


//something wrong – exception

}

WriteToEventLog(message);

}

Below method is written to write the message to the event viewer into Application node.


private
void WriteToEventLog(string message)

{


//you need to adjust registry settings


//http://social.msdn.microsoft.com/forums/en-US/windowsgeneraldevelopmentissues/thread/00a043ae-9ea1-4a55-8b7c-d088a4b08f09/

WriteTrace(“Attempting to write eventlog”);

WriteTrace(message);


string sSource = “TFS Group membership change”;


string sLog = “Application”;


if (!EventLog.SourceExists(sSource))


EventLog.CreateEventSource(sSource, sLog);


EventLog.WriteEntry(sSource, message, EventLogEntryType.Information);

}

}

}

2. Deploy the Web Service

3. Subscribe to DataChangedEvent

    Use BisSubscribe.exe

    Key inputs to be given

    1. Event type – DataChangedEvent

    2. Address – webservice URL

    3. Server – TFS middle tier URL

    4. Collection – your collection URI

With this, we should be able to record any group membership changes in eventviewer and write another utility to filter, show and export…


 
Leave a comment

Posted by on March 8, 2011 in TFS, Uncategorized

 

Tags:

Why can’t I use WScript in my MSI Custom action?

This post gives insight why can’t we use WScript within the MSI….

http://bonemanblog.blogspot.com/2004/08/why-cant-i-use-wscript-in-my-msi.html

But how can we use values read from the custom UI screens or from the msiexec commandline?

Use Session.Property(“CustomActionData”)

Example:

Imagine you are reading values from 4 boxes, do the following

  1. Create a custom action, add the .vbs file
  2. Edit properties of that .vbs custom action

3. CustomActionData has your values with ; delimited
4. Below is the tiny .vbs script to realize these values, values are read from Session.Property

CuActionData = split(Session.Property(“CustomActionData”),”;”)

Msgbox CuActionData(0)

Msgbox CuActionData(1)

Msgbox CuActionData(2)

Msgbox CuActionData(3)

 
1 Comment

Posted by on September 19, 2010 in Uncategorized

 

Tags: ,

Find and replace a content in Web.Config using MSBuild….

If you wonder how to read & update a specific node in web.config(or any other xml file) using MsBuild, here is a sample…

This is very handy for automatic, unattended deployments…

You need to have Tigris MSBuild Community tasks installed ….. this script uses XMLRead & XMLUpdate tasks from that MSBuild extension….

You need to have .NET FWK 3.5 installed too…

——————————————————————————————————————————————————————

<Project

xmlns=”http://schemas.microsoft.com/developer/msbuild/2003″ ToolsVersion =”3.5″ InitialTargets=”FindReplace”>
<!– Required Import to use MSBuild Community Tasks –>
<UsingTask AssemblyFile=”$(MSBuildExtensionsPath)\MSBuildCommunityTasks\MSBuild.Community.Tasks.dll”
TaskName=”MSBuild.Community.Tasks.XmlRead”/>
<UsingTask AssemblyFile=”$(MSBuildExtensionsPath)\MSBuildCommunityTasks\MSBuild.Community.Tasks.dll”
TaskName=”MSBuild.Community.Tasks.XmlUpdate”/>
<!– *********************  Target to read the xml file ********************************–>
<Target Name=”Read”>
<!– Read Test Service end point –>
<XmlRead
Namespace=”http://schemas.microsoft.com/.NetConfiguration/v2.0″
XPath=”//configuration/appSettings/add[@key='TestService']/@value”
XmlFileName=”Web.config”>
<Output TaskParameter=”Value” PropertyName=”TestServiceEndPoint” />
</XmlRead>
<Message Text=”$(TestServiceEndPoint)”/>
<!– Read ConnectionString –>
<XmlRead
Namespace=”http://schemas.microsoft.com/.NetConfiguration/v2.0″
XPath=”//configuration/connectionStrings/add[@name='DevConnection']/@connectionString”
XmlFileName=”Web.config”>
<Output TaskParameter=”Value” PropertyName=”ConnectionString” />
</XmlRead>
<Message Text=”(ConnectionString)”/>
</Target>
<!– *********************  Target to find and replace a value within the xml file *************–>
<Target Name =”FindReplace”>
<XmlUpdate
Namespace=”http://schemas.microsoft.com/.NetConfiguration/v2.0″
XmlFileName=”Web.config”
XPath=”//configuration/connectionStrings/add[@name='DevConnection']/@connectionString”
Value=”CrapCrapCrap123456″ />
</Target>
</Project>
 

Tags: , ,

TFS 2010 – a quick sneak peek

There are plenty of new interesting features are being released with TFS 2010…. here is a quick sneak peek..TFS 2010

 

 

Add build steps in TFS 2005

<BuildStep Msbuild task is not supported in TFS 2005. If you wonder how to update the build step with your custom messages, here is a Power Shell script… pretty easy …

# load the required dll
[void][System.Reflection.Assembly]::LoadWithPartialName(“Microsoft.TeamFoundation.Client”);
[void][System.Reflection.Assembly]::LoadWithPartialName(“Microsoft.Build.Framework”);
[void][System.Reflection.Assembly]::LoadWithPartialName(“Microsoft.TeamFoundation.Build.Common”);
[void][System.Reflection.Assembly]::LoadWithPartialName(“Microsoft.TeamFoundation.Build.Proxy”);

# create networkcredential object instance with (“username”,”pass”,”domain”)
$netcredential=new-object system.net.networkcredential (“BuildSvcID”,”*****”,”Self”);
$tfs=new-object Microsoft.TeamFoundation.Client.teamfoundationServer(“
http://Demo-TFS:8080″,$netcredential);
Write-Host $tfs;
$Buildstore=$tfs.getService([Microsoft.TeamFoundation.Build.Proxy.BuildStore]);
#construct the build uri – provide team project name and build number as parameters
[string]$builduri=$buildstore.getbuilduri($teamProject,$buildNumber);
Write-Host $builduri;
#add build step….
$buildstore.addbuildstep($builduri,”custom build step-TFS 2005″,”custom build step message”);
#to update the build step status
$now=get-date;
$buildstore.updatebuildstep($builduri, “custom build step-TFS2005″, $now, “failed”);

 

Host WCF 4.0 Services on IIS 7.5 with SSL

Very useful link….

http://www.dotnetcurry.com/ShowArticle.aspx?ID=487&utm_source=feedburner&utm_medium=email&utm_campaign=Feed:+netCurryRecentArticles+(.NET+Curry:+Recent+Microsoft+ASP.NET,+Silverlight,+WinForms,+Vista,+C%23,+VB.NET+Articles)&AspxAutoDetectCookieSupport=1

 

Tags:

TEAM FOUNDATION BUILD: BRIEF INTRO

Team Foundation Build is a build orchestrator, part of Microsoft Application Lifecycle Management suite. Tightly integrated with other Visual Studio Team System components such as version control, work-item tracking, testing and reporting.

Team Build is built on top of the Microsoft Build Engine (MSBuild). Team Build consists of the Team Build Service layered on top of the MSBuild build system. MSBuild is responsible for the build itself, while the Team Build Service is responsible for communicating with the TFS application-tier.

Features highlights:

  • Facilitates out of box build process for most the of .NET applications
  • 5 steps out of box end-end build process
    • Retrieve the code from Team Foundation Source Control
    • Compile, Run tests, static code analysis against compiled code
    • Release the builds onto a file server
    • Create/update work items appropriately
    • Publish the build reports
  • Supports executing build on multiple build machines without any script changes
  • Efficient retention policy to delete old builds
  • Locking mechanism to keep the build forever
  • Provides the capability for public and private or desktop builds
  • Provides APIs for extension
  • Ability to build projects/solutions in parallel fashion
  • Beyond build process, other parts of software lifecycle like packaging, deploy could be integrated with Team Build

Refer the high level Architecture here

Team Foundation Build logical flow:

Build types, build creation, execution and viewing results are largely wizard driven and straight forward – let’s move on to the actual Build Process flow

List of customizable Team Build Targets – If you wish to extend, tailor Team Foundation Build according to your project needs

For full information on this specific topic – have a look at this

BeforeEndToEndIteration BeforeCompileConfiguration
AfterEndToEndIteration BeforeCompileSolution
BeforeInitializeWorkspace AfterCompileSolution
AfterInitializeWorkspace AfterCompileConfiguration
BuildNumberOverrideTarget AfterCompile
BeforeClean BeforeGetChangesetsAndUpdateWorkItems
AfterClean AfterGetChangesetsAndUpdateWorkItems
BeforeGet BeforeTest
AfterGet BeforeTestConfiguration
BeforeLabel AfterTestConfiguration
AfterLabel AfterTest
BeforeCompile BeforeDropBuild
AfterDropBuild BeforeOnBuildBreak
BeforeCreateWorkItem AfterOnBuildBreak
AfterCreateWorkItem GenerateDocumentation

List of customizable Team Build Properties

Full information

CustomPropertiesForClean LabelName
CustomPropertiesForBuild OutDir
SkipClean UpdateAssociatedWorkItemsOnBuildBreak
IncrementalGet StopOnFirstFailure
IncrementalBuild SkipGet
CleanCompilationOutputOnly SkipLabel
SkipGetChangesetsUpdateWorkItems SkipInitializeWorkspace
SolutionRoot SkipInvalidConfigurations
BinariesRoot SkipPostBuild
LabelComment SkipDropBuild
CustomizablePublishDir SkipWorkItemCreation
CustomizableOutDir
 

Tags: ,

Essential build management for modern day software development

Some of the items that we should be watchful inorder to make configuration & build management more productive and useful for the whole SDLC….
here are some common challenges and after effects if we ignore to take care of them….

Repeatability & reliability

Repeatability
-Is about being able to do the same thing over and over
-Is something repeatable after  say 6 months
-Do developers have the ability to pullout a code and assembly which is in live production today

Reliability
-Does the process produces correct and accurate results every time
-Are you confident that the code is being delivered into the build has the defect,  not the build/package/deploy process itself

Lack of ‘Repeatability & reliability’

Low defect fix rate
-Not able to repeat the build which is in production already..
-Do we have the ability to reconstruct the development environment with the PROD code, fix a defect and ship a patch quickly
-How long does it take to reconstruct matching code and assembly on a developer box? Should be in minutes…
-Inaccurate fixes

Nonstop issues with reliability of build execution
-When a defect found,  are you sure the problem is with the code or could it be the build process
Management lost confidence on build process

Traceability & completeness

Traceability
-Ways to understand the complete life cycle of  defect/feature that goes into a build….

Completeness
-Ability to trace it back completely and figure out whether the build contains all of what was intended…
-Does it add any value towards the program goals and objectives
- Why and What are we delivering in this build

Lack of ‘traceability and completeness’

–Not being able to say exactly what is in the build…. 
    ->what new features, enhancement, defects have been added and why?
 –Incomplete builds  & Missing builds 
    ->
Missing some artifacts
    ->Post deploy manual hacks/changes on the environments beyond build process
    ->Sometimes builds are missing from the source control
–Not being able to say where the build is being used? 
   ->Where the build has been deployed? Is it being testing on different environments? What version do I have currently on different environments?
–Not being able to say how the build was carried out…. 
  ->Did the source got baselined?
  ->With or without third party assemblies? What version of 3rd party assemblies used?
  ->Was it environment specific build? Any configuration items change based on the environment?
  ->Were there any special compiler/packaging options, instructions followed?

Speed, Agility 

Speed
-Is about how quickly a developer can integrate defects and test his changes?
-How fast and integrated is the build process
-Is the process efficient & has absolutely essential steps
-Is it an unattended build/package and deploy process – if manual process is essential, that’s a big bottle neck

Agility
-Is about having the build/deploy process in which changes can be integrated
  ->quickly
  ->efficiently
  ->independently, as and when needed
 

Lack of ‘speed, agility’

Late integration, long builds…. late night firefighting…

–High possibility of incomplete build
– features/enhancements/defects may not meet the entry criteria
–Uncertain defect quality
–Possibility of ‘high defect re-open rates’
–Not being able to integrate changes quickly
-Does the build process take so long – results in weekly build rather than CI builds– what if that build fails
-Travelling with a hidden tiger until next build
–Deferred testing puts the milestone in risk
–Lack of confidence on scheduled build
– not sure what can/can’t go
–Risk of missing milestones in the wake of late integrated testing
–Risk of late night fire fighting towards the end of development cycle – team morale will go down 

So how can the process be improved?

Following high level goals could make you better
–Implement Continuous Integration
•Define a build once in 30-45 mins interval to make sure source code is syntatically correct and produces binary
–Write light weight tools to encourage teams working on Source Control every single minute
•Create some tools to quickly refresh source & assembly based on build number– improve developer productivity
–Envision efficient check in policy & make developer life easy
•like gated checkins to ensure a change is built along with the latest content from the source tree automatically prior to check in
–Automate and make unattended build/package/deploy/sanity testing
•Use best and authentic tools to ensue maximum benefits from automation
–Ensure build process is simple, transparent, fast and easy
•Anyone should be able to initiate and manage the build process with no or negligible training
-Try to adopt Application Life cycle Management model - Integrate tools suite right from Requirements thru testing..

 
 

Tags: , ,

 
Follow

Get every new post delivered to your Inbox.