Thursday, August 16, 2018

Does pro grammatically check-in the best practice?

Does pro grammatically check-in the best practice?


From time to time I receive request to add check-in step to build definition. In general this is simple operation: some step change file(s), and customer need that this files put to source control.
But is it good scenario, and what a risk will you receive after this implementation? Let's discuss it in this article.




Why we need check-in file automatically?


As I said,   basically developers what get latest version and already have in latest changes something, which was changes in build definitions. Very often it is connect with nuget packages in .net project, or similar way to update packages.

Is it problem with architecture?


Usual developer ask: if you change automatically code, how do you make sure that build changes nothing broke? It is a good question. There are many cases, when devops configure check-in from build definitions. But does it have a risks? Yes...and

Microsoft pay your attention, that this is dangerous!


If you download via TFS market extension to allow you check-in from build definition, first what you will see: it is warning: that it is a big risk to broke your code!
And from my perspective of view: it will create big problem under not control check-in.
Of course, if code is legacy and architecture problem impossible resolve in good practice, it is only one way to use this task.
 But my advice to you: don't use this task, if you can't quick resolve broken code! This process can broke code in any time!

What else can be broken?

Imagine case: you use TFVC. And put check-in task to build definitions with Gated Check-in trigger. It automatically denied to you check-in files, which you predefined in build definition. When you tried, this task successfully check-in changes. But in the end your build through exception:

A newer version of $/some.file exists on the server.

Unfortunately it is need create powershell script or what ever script do you use, to make workaround. It need avoid check-in files, if someone check-in this from shelvset.

I wish you to avoid such errors and successful builds!

No comments:

Post a Comment