Sunday, June 29, 2025

Adding a Feature to Deployinator using GitHub Copilot's Agent Mode



Walk through of GitHub Copilot’s agent mode to add a feature to Deployinator 2022 for VS.

Apologies that this was "written" in Word and just pasted here in an attempt to find a better way to share it.


The prompt:

The initial response broken down:


Seems like a good plan and noticing right away it’s using phrases from comments in my code like “If a path is not viable (e.g., does not exist or is otherwise invalid)” in new context.

This is still part of the initial response:


The build error was indeed not due to the new code as it stated.

I noticed two things in the new code (this is about 2/3 of the new it created):


It decided to only use up to 3 suggested new target paths. It struck me as wrong initially but, on further thought, I decided this was a good idea.

It used a hash set to detect potential duplication but then also used another collection to keep the results. This seemed a bit newb’ish to me.

It didn’t trust SuggestNextTargetAsync to not return duplicates.

So I asked:



And asked:


I expected the first answer but not the second. Still, I think I’d just clear the collection on start.

Taking some action:

I highlighted the bit about making it clear if duplicates are returned by SuggestNextTargetAsync despite me saying to trust it. It turned my points against each other in a reasonable way.

So, now, I decided to really see what it could do:

The initial response comes in rather quickly:

and it continues by doing the necessary recon:

and continues to make the changes:

When I first read this, I thought it was done here but no:

I was pretty intrigued with the selection handling for the radio buttons. I think I have always done this with a simple model for the selection which is probably why I don’t [didn’t] have an EqualityToBooleanConverter.

I decided just to run the code and hope for the best but:


Let’s see what it does if I just tell it what’s happening:


In the end, the use of a converter and multibinding seems to have gotten more complex than using a simple model especially considering me wanting to also show the original path in red or something to highlight the fact that it is bad.

That said, it works:


It amazes me how far I got so quickly and perhaps I'll egg it into converting to a model approach for the list of paths and continue to act as a sort of technical product manager to get this feature into Deployinator.

No comments:

Post a Comment