Wednesday, 8 May 2019

Why is my TeamCity build not being cleaned up?

We recently had an issue that was causing our builds to seemingly never be cleaned up. After a bit of digging this is how we discovered the issue:

  • In the build history there is an icon that shows you if TeamCity thinks there is a build dependency:
  • If you click on this you will see the build chain for the build and on that you can see what builds depend on this build in the chain.
For us however there were no dependent builds further down the chain so why was the build showing as being a dependency?

There is another tab of dependencies here. The delivered artifacts page. When we looked at this we saw that there was another build from the same build definition using this build as a dependency!

Why was this happening? In our build we were using the build definition credentials (%system.teamcity.auth.userId%, %system.teamcity.auth.password%) to download the artifacts of the last successful build for comparison. TeamCity seems to have seen this happening and marked the previous build as a dependency. Over time this means that every successful build has been a dependency of the next successful build and nothing could be deleted!

For us we were able to remove the artifact download from the script and after a few days the clean kicked in as expected and saved us a lot of disk space!

The other option is to ensure the Do not prevent clean-up option is set in the cleanup policy. Note that this does not affect builds that are snapshot dependencies: https://youtrack.jetbrains.com/issue/TW-59344

Thursday, 4 August 2016

Collection iteration cheat sheet

Having not found a great cheat sheet between Linq and JavaScript Array methods I thought I would create one. The JS Array methods I have included here are supported from IE9 so I imagine most applications should be able to use them (and if not the Mozilla Developer Network provides some polyfills).

Be aware that chaining methods on the Array prototype will cause the collection to be iterated many times (unlike LINQ which will iterate once when the collection is enumerated). This is because each method returns a new array.

Underscore allows single iteration chaining by using the chain and value methods.

LINQ JS Array (ES6) Underscore (ES6) jQuery (ES6)
Any some some N/A
All every every N/A
Selectmap map map
Wherefilter filter grep
First/FirstOrDefault find find N/A

forEach each each
Max N/A max N/A
Min N/A min N/A
ToDictionary N/A groupBy N/A
Contains includes contains N/A
N/A findIndex indexOf inArray
Reverse reverse N/A N/A
String.Join ["One", "Two"].join(", ") N/A N/A

If I have missed anything please comment below and I will update the list.

Saturday, 15 February 2014

Turning Windows 8.1 Into a Desktop Operating System

If like me you love Windows 8 for its super quick booting but hate it for Metro here are a few tricks to turn it back into a desktop operating system. Almost...

1. Boot to Desktop

I think this is pretty well known now but just in case:
  1. Press Windows* + D and behold your desktop.
  2. Right click on the task bar (thing at the bottom with your active programs on).
  3. Select Properties
  4. Select the Navigation Tab
  5. Tick 'When I sign in or close ... got to the desktop instead.'
  6. You may also be interested in some of the other boxes on this page that tweak other metro features.

2. Always launch IE in Desktop Mode

Fed up with IE loading differently depending on how you opened it? Whether you want it in metro or desktop mode follow these steps:
  1. Install a better browser...
Or
  1. Open IE in desktop mode (Press Windows* + R, type iexplore and press Enter if you are struggling)
  2. Press the cog in the top right corner (not the X)
  3. Select Internet Options
  4. Select the Programs tab
  5. Under 'Opening Internet Explorer' select 'Always in ... the desktop'
  6. Also check the check box underneath.
  7. Click Apply.
My drop down is disabled as IE is not my default browser.

3. Open Images and Videos in Desktop Mode

If you don't want to have to wait 30 seconds to see each picture or want to watch your videos in something that can actually play them do this:
  1. Open the Control Panel (Windows* + X, P)
  2. Search for Default Programs in the top right.
  3. Click on 'Set your default programs'
  4. Select 'Windows Photo Viewer' (or your image viewer of choice) in the list on the left.
  5. Click 'Set this program as default'
  6. Repeat for Windows Media Player (or your movie/music player of choice). If you want to be more specific you can pick the types of file individually by clicking 'Choose defaults for this program'

4. Turn it Off Quicker

There is actually a second start menu in Windows 8. You get to it by right clicking on the start button (or pressing Windows* + X). This menu basically gives you all the stuff from the Windows 7 start menu that isn't a program. Take a moment to read the options here. I have been digging around in the charms menu for months because I didn't. 

At the bottom of this menu you will find 'Shut down or sign out' which will let you do just that. Now you know that you can go back to my tip 1 and turn off those annoying charm menus too!

5. Clean up the New Start Menu

This will take a little more patience than the other tips so far but I think it is well worth it.

It seems that the new Metro start menu is not so detached from the Windows 7 one as it first appears. We can break down the Windows 7 start menu into 3 parts. The recent and pinned list that you see when it pops up, the 'All Programs' menu which holds everything installed on your computer and you probably don't really use, and everything else that isn't a program.

Well we know the 'everything else' is now in its own menu (Windows* + X) and the pinned stuff is obviously what appears as tiles on the Metro menu. This means that the everything else menu is now the third part of the menu - you get to it via a down arrow in the bottom left that is only visible after you move the mouse if you haven't found it.

Most people when they see this menu probably dismiss it as useless. It probably is in the state you first see it in as it is cluttered up with all sorts:
  • Gimmicky metro apps like Alarms and Finance that you will never use.
  • All the accessibility and obsolete communication tools that are normally buried in the All Programs menu.
  • A whole load of uninstallers and read me files for the programs you have installed that were designed for a system with a very different menu structure.
If you are looking for a quick way to make this menu more useful:
You can sort the applications by recently used which will bring the ones you care about to the top.
If you want to sort it out properly then continue reading:

Uninstall the Metro Apps

Except the Store!
  1. Open the menu and order the apps by name (top of the screen next to 'Apps'). 
  2. The metro apps will mostly float to the left as they are not in a sub folder. Right click on one you don't like.
  3. Don't press uninstall yet! Do it in bulk and save your precious time. Click on every other metro app that you don't want. Don't include Store as I don't know how you get it back!
  4. Click uninstall and confirm you want to remove them all.

Clean up the computer Start Menu

The start menu is split up into a shared menu and your own personal menu. You will want to clean up both.
  1. Open a file browser window (Windows* + E)
  2. Enter the following in the address bar and press EnterC:\ProgramData\Microsoft\Windows\Start Menu\Programs
    • If this doesn't work go to the apps menu, right click on 'Character Map' and select 'Open file location'. Then go up the directories until you are in one called Programs
  3. This is the root of your shared 'Apps' menu. Everything that is in this directory or below it will appear on your start menu.
  4. Back it up!
    • Copy and paste everything in this folder to a backup folder somewhere so that you can recover anything you didn't mean to delete.
    • Note that these files are shortcuts so you won't actually be removing programs from your computer. Except Store!
  5. Clean it up!
    • Note that the start menu is a combination of the shared and your private menu. If you delete something and it doesn't go it may also be on your private menu.
    • It also seems to take a while for the start menu to realize there has been a change!
  6. Repeat for the folder: C:\Users\YourUserName\AppData\Roaming\Microsoft\Windows\Start Menu\Programs
    • If this doesn't work go to the apps menu, right click on the icon you want to remove and select 'Open file location'. Delete it from the directory that opens.
I suggest:
  • Getting rid of Accessories (excluding Calculator)
  • Getting rid Windows System/Management as all these things can be accessed via Windows + X
  • Getting rid of anything that is called uninstall or read me.
  • Sorting the applications into meaningful folders rather than having folders for each application.
* The Windows key is is the one on your keyboard with the Windows logo on it. Between Ctrl and Alt. When I say press Windows + D I mean press this key and the D key at the same time. If there is a comma and then another key press that after the other 2. If you didn't know about the windows key before checkout these:
  1. Windows + D: Takes you back to your Desktop. It minimizes all your open programs. Press it again to get back to how you were.
  2. Windows + ←: Snaps the active window to fill the left half of the screen.
  3. Windows + ↑: Snaps the active window to fill the whole screen.
  4. Windows + →: Snaps the active window to fill the right half of the screen.
  5. Windows + S: Opens the computer search thing.
  6. Windows + E: Opens a new file browser window.
  7. Windows + X, A: Opens the command prompt as administrator.
  8. Windows + X, U, R: Restarts your computer.

Tuesday, 5 March 2013

Monday, 29 October 2012

Committing to Software Trials

As you will be able to see if you go back a few posts in my Blog I have an unhealthy dislike for TFS. Most of it comes from a belief, that rubbed off on me in a previous position, that if a product is not easy and enjoyable to use people will not use it. TFS issue tracking is not easy to use. It is really little more than a single database table that you can define custom queries against. I am pretty sure that you could achieve 90% of the functionality using Microsoft Access. So imagine my joy when I finally managed to get my boss to give JIRA a try.

JIRA is both fun and easy to use provided you use their workflows. With the GreenHopper plugin you can move things around in the backlog just by dragging them (you can do this in TFS 2012 but that's not what we're using), drag tasks around the workflow to indicate progress, drag issues from one release to another and so on and so forth. All the charts you really need are also bundled in with the Green Hopper plugin including a real-time burn down (not just a daily summary like TFS), cumulative flow and more. There are also easy prioritisation and voting tools to help project managers prioritise work.

Despite the awesomeness of JIRA I am not enjoying our trial. Unfortunately for Atlassian it is not their fault and there is not a lot they can do about it. You see the original plan for the trial was to switch our small team from TFS to JIRA for a sprint so that everyone could marvel at it's wonder. Being an eager beaver I was on it from the start and had the next sprint of items from the backlog into JIRA in no time. But then things went wrong. Product Management were not aware we were using the new tool and there was a hold up getting usernames out to the other developers. This lead to the abysmal  situation of me, and the other developers as they joined, having to keep both JIRA and TFS up-to-date with progress. It also meant that there were 2 places to look for activity feeds (my twitter like group and the feeds in JIRA) and that if a PM made a change it was in TFS not in JIRA. So now the development team are left disliking JIRA because it is just more work for them to do, project management are still oblivious to it's existence and the whole thing has really been a waste of time.

This is actually a common mistake with trialling new procedures and software. If you are trying something new you should just go for it. Don't try out a new system while maintaining and old one because even if you spend 90% of the effort maintaining the old system you will dislike the new one for giving you more work. I see this a lot when I recommend ReSharper to people too. They don't trust the quick fixes and hints so they don't use them. If they don't use them they just see them as cluttering up their environment and completely miss the point of the product!

Thursday, 4 October 2012

Visual Studio 2012 - At a Glance

I saw someone else install Visual Studio 2012 today - yes I quite literally mean a glance - and I felt so strongly about it that I am writing this blog post. I am warning you now that this is really just me grumbling so don't expect to be enlightened.

I suppose I have to start with the lovely grey interface that has been the talk of the town since it was released. I know that the world and his wife has already had their 2 cents about this but I really don't understand why they made this decision. I have heard it said that the reason they chose it is because they think that the colourful nature of previous versions is too distracting. I honestly don't know who they were observing to draw this conclusion. It is simply ridiculous. Go into any UK office on a grey day and I would bet that everyone is glummer than they are on a sunny day. I generally see that if people are happier they work better and grey things do not make people happy. So in my eyes all that they have achieved is to make office life that little bit more miserable. Luckily for me I can make it pretty with a plugin so I will survive - although it doesn't change the icons.
Does anyone else see the resemblance?

Loading times appear to be just as slow as, if not slower than, 2010. It also crashed after we opened it the first time so we had to sit through it twice. The creation of an MVC project took a whole second to add each file that would be in the new project before we could do anything. I could tell because there were handy status notifications for each one. I am starting to think that this is a trend with Microsoft products. The main difference I noticed between Office 2007 and 2010 seems to be that the later takes twice as long to load. They have tried to disguise this by giving you status updates on how loading the application is coming along but I am not fooled. But who cares about load times anyway? It's not like we need to open and close Visual Studio all day so I think I could let it off for that.

The thing that I really don't like, and you are welcome to call me petty, is the shouty capitals. If the colourful icons were too distracting then I am sure being constantly shouted at will be too. I really hate them. Luckily you can turn them off so that one shouldn't be a problem either.

So now I have got that out of my system all I need to do is get over it and start using it because lets face it... I don't have much choice.

Sunday, 30 September 2012

Computing talks in Herts

The British Computer Society are putting on a series of free talks in Hertfordshire that may be of interest to anyone who lives around the area who works in the indusrty.