<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-AU" xmlns:media="http://search.yahoo.com/mrss/">
  <id>https://david.gardiner.net.au/feed.xml</id>
  <title type="html">David Gardiner</title>
  <updated>2026-11-15T22:00:00.000Z</updated>
  <subtitle>A blog of software development, .NET and other interesting things</subtitle>
  <rights>Copyright 2026 David Gardiner</rights>
  <icon>https://www.gravatar.com/avatar/37edf2567185071646d62ba28b868fab?s=64</icon>
  <logo>https://www.gravatar.com/avatar/37edf2567185071646d62ba28b868fab?s=256</logo>
  <generator uri="https://github.com/flcdrg/astrojs-atom" version="3">astrojs-atom</generator>
  <author>
    <name>David Gardiner</name>
  </author>
  <link href="https://david.gardiner.net.au/feed.xml" rel="self" type="application/atom+xml"/>
  <link href="https://flcdrg.superfeedr.com" rel="hub"/>
  <link href="https://pubsubhubbub.appspot.com/" rel="hub"/>
  <link href="https://david.gardiner.net.au/" rel="alternate" type="text/html" hreflang="en-AU"/>
  <category term=".NET"/>
  <category term="Software Development"/>
  <category term="Azure"/>
  <category term="DevOps"/>
  <entry>
    <id>https://david.gardiner.net.au/2026/11/closed-hierarchies</id>
    <updated>2026-11-16T08:30:00.000+10:30</updated>
    <title>C# 15 - Closed hierarchies</title>
    <link href="https://david.gardiner.net.au/2026/11/closed-hierarchies" rel="alternate" type="text/html" title="C# 15 - Closed hierarchies"/>
    <category term=".NET"/>
    <published>2026-11-16T08:30:00.000+10:30</published>
    <summary type="html">Closed hierarchies and the &apos;closed&apos; keyword are new to C# 15</summary>
    <content type="html">&lt;p&gt;&apos;Hierarchy&apos; is one of those words that for some reason I need to stop and think about how it is spelled - does it follow the &quot;i after e except after c&quot; or is it an exception? I think I got it right this time.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://david.gardiner.net.au/_astro/csharp-128.CRIswx_k_2rFxdS.webp&quot; alt=&quot;C# logo&quot; /&gt;&lt;/p&gt;
&lt;p&gt;So enough of spelling, let&apos;s look at another new language feature introduced in C# 15 - &lt;a href=&quot;https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/proposals/csharp-15.0/closed-hierarchies&quot;&gt;Closed Hierarchies&lt;/a&gt;. By using the &lt;a href=&quot;https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/closed&quot;&gt;&lt;code&gt;closed&lt;/code&gt; modifier&lt;/a&gt;, we can now indicate that a class (including &lt;code&gt;record&lt;/code&gt; classes) is a &quot;closed hierarchy&quot;. Given this closed type:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;public closed record Season
{
    public virtual int Rainfall { get; set; }
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;We can then declare other subtypes of that class in the same assembly in the usual way:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;public record Winter : Season;
public record Summer(int BushfireRisk) : Season;
public record Spring(int PollenCount) : Season;
public record Autumn : Season;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;If we use these types in a &lt;code&gt;switch&lt;/code&gt; expression, then the compiler knows all the possible types and can tell if the expression covers all the direct descendants.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;static string SummariseSeason(Season season) =&amp;gt; season switch
{
    Summer s =&amp;gt; $&quot;It&apos;s summer. Bushfire alert level {s.BushfireRisk}&quot;,
    Winter w =&amp;gt; &quot;It&apos;s winter&quot;,
    Spring sp =&amp;gt; $&quot;It&apos;s spring. Pollen count {sp.PollenCount}&quot;,
    Autumn a =&amp;gt; &quot;It&apos;s autumn&quot;,
};
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The above code doesn&apos;t need a default case. Creating a &lt;code&gt;Summer&lt;/code&gt; instance of &lt;code&gt;Season&lt;/code&gt; and calling that method like this:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;Season season = new Summer(5);
Console.WriteLine(SummariseSeason(season));
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Outputs: &lt;code&gt;It&apos;s summer. Bushfire alert level 5&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Note that if &lt;code&gt;Season&lt;/code&gt; was nullable, then you would need to handle the &lt;code&gt;null&lt;/code&gt; case.&lt;/p&gt;
&lt;h2&gt;Implications of closed types&lt;/h2&gt;
&lt;h3&gt;You can&apos;t inherit from that type in another assembly&lt;/h3&gt;
&lt;p&gt;If this code was declared in a different assembly to the closed type, it will not compile:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;// Invalid code
public record ChickenSalt : closed_base.Season
{
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Fails with compiler error:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;error CS9382: &apos;ChickenSalt&apos;: cannot use a closed type &apos;Season&apos; from another assembly as a base type.
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;The closed class is implicitly abstract&lt;/h3&gt;
&lt;p&gt;You can&apos;t instantiate a closed type directly:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;// Invalid code
var class1 = new Season();
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Fails with:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;error CS0144: Cannot create an instance of the abstract type or interface &apos;Season&apos;
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Closed is different to sealed&lt;/h3&gt;
&lt;p&gt;The &lt;a href=&quot;https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/sealed&quot;&gt;&lt;code&gt;sealed&lt;/code&gt; modifier&lt;/a&gt; can be applied to a class, or a method or property that overrides a base class&apos;s virtual method or property.&lt;/p&gt;
&lt;p&gt;Once something is sealed, it cannot be inherited from or overridden in a subtype.&lt;/p&gt;
&lt;h3&gt;A subtype of a closed type defaults to being open&lt;/h3&gt;
&lt;p&gt;A subtype of a closed type is not also closed automatically. This means you &lt;strong&gt;can&lt;/strong&gt; inherit from the subtype in another assembly. This code is valid if it was in another assembly:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;public record BushfireRisk : closed_base.Summer
{
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;A subtype can be closed only if you also add the &lt;code&gt;closed&lt;/code&gt; modifier to it.&lt;/p&gt;
&lt;h3&gt;The compiler will warn you about incomplete switch expressions&lt;/h3&gt;
&lt;p&gt;If you had the following code:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;static string IncompleteSummariseSeason(Season season) =&amp;gt; season switch
{
    Summer s =&amp;gt; $&quot;It&apos;s summer. Bushfire alert level {s.BushfireRisk}&quot;,
    Winter w =&amp;gt; &quot;It&apos;s winter&quot;,
    Spring sp =&amp;gt; $&quot;It&apos;s spring. Pollen count {sp.PollenCount}&quot;
};
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The compiler will emit the following warning:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;warning CS8509: The switch expression does not handle all possible values of its input type (it is not exhaustive). For example, the pattern &apos;closed_base.Autumn&apos; is not covered
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Using &lt;code&gt;closed&lt;/code&gt; can be a breaking change&lt;/h3&gt;
&lt;p&gt;Adding &lt;code&gt;closed&lt;/code&gt; to an existing class makes it implicitly abstract. This could break code that instantiates it or inherits from it in another assembly.&lt;/p&gt;
&lt;p&gt;Adding a new subtype to an existing closed hierarchy could also impact downstream consumers; For example, any existing switch expressions
they had could now be non-exhaustive and will emit compiler warnings.&lt;/p&gt;
&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;Using closed hierarchies allows the compiler to reason about switch expressions and generate warnings if you&apos;ve missed a case.&lt;/p&gt;
&lt;p&gt;Full code samples can be found in &lt;a href=&quot;https://github.com/flcdrg/csharp15/&quot;&gt;this repo&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Also, I think after writing this post, I&apos;m getting better at spelling &apos;hierarchy&apos; 😀&lt;/p&gt;
</content>
    <media:thumbnail url="https://david.gardiner.net.au/_astro/csharp-128.CRIswx_k.png" width="128" height="128"/>
    <media:content medium="image" url="https://david.gardiner.net.au/_astro/csharp-128.CRIswx_k.png" width="128" height="128"/>
  </entry>
  <entry>
    <id>https://david.gardiner.net.au/2026/11/union-types</id>
    <updated>2026-11-13T09:30:00.000+10:30</updated>
    <title>C# 15 - Union types</title>
    <link href="https://david.gardiner.net.au/2026/11/union-types" rel="alternate" type="text/html" title="C# 15 - Union types"/>
    <category term=".NET"/>
    <published>2026-11-13T09:30:00.000+10:30</published>
    <summary type="html">C# finally has union types</summary>
    <content type="html">&lt;p&gt;This is something some people have been wanting in C# for a really long time.&lt;/p&gt;
&lt;p&gt;Up until now, if you wanted an object that could be one of a limited number of types, you might have resorted to inheritance like this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;public abstract record Pet;
public record Dog : Pet;
public record Cat : Pet;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The downside of this is that you&apos;re implying there&apos;s a hierarchy.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/union&quot;&gt;Union types&lt;/a&gt; solve this problem. Here are a couple of union types for &lt;code&gt;Drill&lt;/code&gt; and &lt;code&gt;Tool&lt;/code&gt;.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;public enum HammerType
{
    Claw,
    Sledge
}
public record Hammer(HammerType Type);

public enum ScrewdriverType
{
    Flathead,
    Phillips
}
public record Screwdriver(ScrewdriverType Type);

public record PowerDrill(bool Hammer, bool Reversible, bool Cordless);
public record ManualDrill();

public union Drill(PowerDrill, ManualDrill);

public union Tool(Hammer, Screwdriver, Drill);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;A &lt;code&gt;Drill&lt;/code&gt; can be either &lt;code&gt;PowerDrill&lt;/code&gt; or &lt;code&gt;ManualDrill&lt;/code&gt;. They don&apos;t have any common properties so there&apos;s no need to make one inherit from the other, or have a common base class.&lt;/p&gt;
&lt;p&gt;Using union types is straightforward:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Tool myTool = new Drill(new PowerDrill(true, true, false));

switch (myTool)
{
    case Hammer h:
        Console.WriteLine($&quot;Hammer: {h.Type}&quot;);
        break;
    case Screwdriver s:
        Console.WriteLine($&quot;Screwdriver: {s.Type}&quot;);
        break;
    case Drill d:
        switch (d)
        {
            case PowerDrill pd:
                Console.WriteLine($&quot;PowerDrill: Hammer={pd.Hammer}, Reversible={pd.Reversible}, Cordless={pd.Cordless}&quot;);
                break;
            case ManualDrill md:
                Console.WriteLine(&quot;ManualDrill&quot;);
                break;
        }
        break;
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Note that the &lt;code&gt;Tool&lt;/code&gt; type doesn&apos;t directly include all the types that make up the &lt;code&gt;Drill&lt;/code&gt; type.&lt;/p&gt;
&lt;p&gt;If you use a switch expression with a union type and don&apos;t cover all possible types, the compiler can detect this and generate a warning:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;var t = myTool switch
{
    Hammer h =&amp;gt; $&quot;Hammer: {h.Type}&quot;,
    Screwdriver s =&amp;gt; $&quot;Screwdriver: {s.Type}&quot;,
    Drill d =&amp;gt; d switch
    {
        PowerDrill pd =&amp;gt; $&quot;PowerDrill: Hammer={pd.Hammer}, Reversible={pd.Reversible}, Cordless={pd.Cordless}&quot;,
        //ManualDrill md =&amp;gt; &quot;ManualDrill&quot;
    }
};
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Causes this warning:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;warning CS8509: The switch expression does not handle all possible values of its input type (it is not exhaustive). For example, the pattern &apos;ManualDrill&apos; is not covered
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Kinds of Union types&lt;/h2&gt;
&lt;p&gt;&lt;a href=&quot;https://en.wikipedia.org/wiki/Union_type&quot;&gt;Union types&lt;/a&gt; exist in a number of programming languages, and there are apparently two kinds - &lt;a href=&quot;https://en.wikipedia.org/wiki/Tagged_union&quot;&gt;&quot;tagged&quot; (also known as discriminated)&lt;/a&gt; and &quot;untagged&quot;.&lt;/p&gt;
&lt;p&gt;I did a bit of reading up to understand the difference:&lt;/p&gt;
&lt;h3&gt;Untagged unions&lt;/h3&gt;
&lt;p&gt;This is what C# 15 provides. C# union types are &quot;unions of types&quot;.&lt;/p&gt;
&lt;p&gt;You check the type to identify what it is.&lt;/p&gt;
&lt;h3&gt;Tagged or discriminated unions&lt;/h3&gt;
&lt;p&gt;F# has these.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;type ApiResult =
    | Success of body: string
    | Failure of statusCode: int * message: string

type PersonName =
    | FirstName of string
    | LastName of string
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Note how a discriminated union allows you to define a type which is either of two strings. The &apos;discriminator&apos; (or &apos;tag&apos;) is separate to the value&apos;s type.&lt;/p&gt;
&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;I think union types provide the opportunity to be much more expressive and precise when defining the shape of the data structures you&apos;re working with in C#. It also means you can &apos;lean on the compiler&apos; to ensure a union type&apos;s possible values are all handled correctly.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <id>https://david.gardiner.net.au/2026/11/collection-expression-arguments</id>
    <updated>2026-11-12T09:30:00.000+10:30</updated>
    <title>C# 15 - Collection expression arguments</title>
    <link href="https://david.gardiner.net.au/2026/11/collection-expression-arguments" rel="alternate" type="text/html" title="C# 15 - Collection expression arguments"/>
    <category term=".NET"/>
    <published>2026-11-12T09:30:00.000+10:30</published>
    <summary type="html">A new language feature for C# 15 to simplify creating and initialising collections</summary>
    <content type="html">&lt;p&gt;Collections have been a part of .NET since the very beginning, and there have been both incremental and significant enhancements since then. Likewise C# has evolved to improve how it works with collections.&lt;/p&gt;
&lt;p&gt;Consider an array of strings like this:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;string[] days = [&quot;Monday&quot;, &quot;Tuesday&quot;, &quot;Wednesday&quot;, &quot;Thursday&quot;, &quot;Friday&quot;, &quot;Saturday&quot;, &quot;Sunday&quot;];
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Not something we always think about, but it&apos;s a good practice to set the capacity of collections if you know ahead of time how large they need to be. Memory can be allocated up front, rather than incrementally (and depending on the kind of collection it may also avoid needing to reallocate a larger data structure as it grows).&lt;/p&gt;
&lt;p&gt;Up until now, you might do that like this for a list that you know will eventually need to hold 7 items, even though initially you&apos;re creating it with 3.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;var simpleDayList1 = new List&amp;lt;string&amp;gt;(days.Length);
simpleDayList1.AddRange(days[0..3]);
Console.WriteLine($&quot;Capacity of simpleDayList1: {simpleDayList1.Capacity}, Count: {simpleDayList1.Count}&quot;);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The &lt;code&gt;Capacity&lt;/code&gt; will be 7.&lt;/p&gt;
&lt;p&gt;But what if you&apos;re using collection expressions? Collection expressions are when you use &lt;code&gt;[]&lt;/code&gt; to create a collection. The first array above is using them.&lt;/p&gt;
&lt;p&gt;Now with &lt;a href=&quot;https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/operators/collection-expressions#collection-expression-arguments&quot;&gt;C# 15 collection expression arguments&lt;/a&gt;, you can include a &lt;code&gt;with()&lt;/code&gt; element as part of the collection expression to set constructor arguments, like this:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;List&amp;lt;string&amp;gt; dayList = [with(capacity: days.Length), ..days[0..3]];
Console.WriteLine($&quot;Capacity of dayList: {dayList.Capacity}, Count: {dayList.Count}&quot;);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The result is the same, but with a more compact syntax.&lt;/p&gt;
&lt;p&gt;One thing that confused me at first - I couldn&apos;t figure out how that code was working, as there are 3 constructors defined for &lt;code&gt;List&amp;lt;T&amp;gt;&lt;/code&gt; and none of them take a capacity &lt;em&gt;and&lt;/em&gt; the items.&lt;/p&gt;
&lt;p&gt;I used dotPeek to disassemble the compiled code and this is what it gave me (I had to delete the .pdb otherwise dotPeek was too clever and just showed me the original code!):&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;List&amp;lt;string&amp;gt; equivalentDayList = new List&amp;lt;string&amp;gt;(days.Length);
equivalentDayList.AddRange((IEnumerable&amp;lt;string&amp;gt;)days[0..3]);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;It chose the &lt;code&gt;List&amp;lt;T&amp;gt;(int capacity)&lt;/code&gt; constructor. The &lt;a href=&quot;https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/operators/collection-expressions#conversions&quot;&gt;conversions reference&lt;/a&gt; suggests it will call the &lt;code&gt;Add()&lt;/code&gt; method to add the items to the collection. I assume there&apos;s an optimisation that will use &lt;code&gt;AddRange()&lt;/code&gt; if it is available.&lt;/p&gt;
&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;Collection expression arguments are a nice &apos;syntactic sugar&apos; incremental improvement to C#&apos;s support for collections.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <id>https://david.gardiner.net.au/2026/11/dotnet11-csharp15</id>
    <updated>2026-11-11T09:30:00.000+10:30</updated>
    <title>.NET 11 and C# 15</title>
    <link href="https://david.gardiner.net.au/2026/11/dotnet11-csharp15" rel="alternate" type="text/html" title=".NET 11 and C# 15"/>
    <category term=".NET"/>
    <published>2026-11-11T09:30:00.000+10:30</published>
    <summary type="html">.NET 11 is out, with a heap of new features, including C# 15</summary>
    <content type="html">&lt;p&gt;This week is &lt;a href=&quot;https://www.dotnetconf.com&quot;&gt;.NET Conf&lt;/a&gt; at which the general availability of .NET 11 will be announced.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://david.gardiner.net.au/_astro/dotnet.DQUHciW5_24pCaQ.webp&quot; alt=&quot;.NET logo&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://learn.microsoft.com/en-au/dotnet/core/whats-new/dotnet-11/overview&quot;&gt;.NET 11 includes updates&lt;/a&gt; to the &lt;a href=&quot;https://learn.microsoft.com/en-au/dotnet/core/whats-new/dotnet-11/runtime&quot;&gt;runtime&lt;/a&gt;, &lt;a href=&quot;https://learn.microsoft.com/en-au/dotnet/core/whats-new/dotnet-11/libraries&quot;&gt;libraries&lt;/a&gt;, &lt;a href=&quot;https://learn.microsoft.com/en-au/dotnet/core/whats-new/dotnet-11/sdk&quot;&gt;SDK&lt;/a&gt;, &lt;a href=&quot;https://learn.microsoft.com/en-us/aspnet/core/release-notes/aspnetcore-11?view=aspnetcore-11.0&quot;&gt;ASP.NET Core&lt;/a&gt;, &lt;a href=&quot;https://learn.microsoft.com/en-us/ef/core/what-is-new/ef-core-11.0/whatsnew&quot;&gt;EF Core&lt;/a&gt;, &lt;a href=&quot;https://github.com/dotnet/extensions/releases&quot;&gt;Extension libraries&lt;/a&gt;, &lt;a href=&quot;https://learn.microsoft.com/en-us/dotnet/desktop/winforms/whats-new/net110&quot;&gt;Windows Forms&lt;/a&gt;, &lt;a href=&quot;https://learn.microsoft.com/en-us/dotnet/desktop/wpf/whats-new/net110&quot;&gt;WPF&lt;/a&gt;, &lt;a href=&quot;https://learn.microsoft.com/en-au/dotnet/fsharp/whats-new/fsharp-11&quot;&gt;F# 11&lt;/a&gt; and &lt;a href=&quot;https://learn.microsoft.com/en-au/dotnet/csharp/whats-new/csharp-15&quot;&gt;C# 15&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Speaking of C#, here&apos;s the full list of new language features in C# 15:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;/2026/11/collection-expression-arguments&quot;&gt;Collection expression arguments&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;/2026/11/union-types&quot;&gt;Union types&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;/2026/11/closed-hierarchies&quot;&gt;Closed hierarchies&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Extension indexers&lt;/li&gt;
&lt;li&gt;Labelled break and continue&lt;/li&gt;
&lt;li&gt;Non-virtual static interface members for older runtimes&lt;/li&gt;
&lt;li&gt;Memory safety (preview)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Over the next few days I&apos;m going to be digging into what I think are the more interesting ones. I&apos;ll see you shortly!&lt;/p&gt;
</content>
    <media:thumbnail url="https://david.gardiner.net.au/_astro/dotnet.DQUHciW5.png" width="456" height="456"/>
    <media:content medium="image" url="https://david.gardiner.net.au/_astro/dotnet.DQUHciW5.png" width="456" height="456"/>
  </entry>
  <entry>
    <id>https://david.gardiner.net.au/2026/11/ai-policy</id>
    <updated>2026-11-07T15:30:00.000+10:30</updated>
    <title>My AI policy for this blog</title>
    <link href="https://david.gardiner.net.au/2026/11/ai-policy" rel="alternate" type="text/html" title="My AI policy for this blog"/>
    <category term="AI"/>
    <category term="Blogging"/>
    <published>2026-11-07T15:30:00.000+10:30</published>
    <summary type="html">I don&apos;t use AI to write blog posts, but I do use it for other things</summary>
    <content type="html">&lt;p&gt;I thought it was worth mentioning that this is my blog, and these are my words that (for better or worse) are written by me. I have my own quirky, distinct style that I hope is appreciated by those of you who stop by for a read.&lt;/p&gt;
&lt;p&gt;I am using AI tools for assisting me with software development, both &lt;a href=&quot;https://handbook.sixpivot.com.au/how-we-work/policies/responsible-use-of-ai/ai-assisted-software-development&quot;&gt;at work&lt;/a&gt; and for personal projects. I have used them to help with improvements to the &lt;a href=&quot;https://github.com/flcdrg/astro-blog-engine&quot;&gt;code that runs this blog&lt;/a&gt;, but I don&apos;t use them to write blog posts. If I do ever reference or quote content that is AI-generated then I will endeavour to indicate that clearly.&lt;/p&gt;
&lt;p&gt;I use Visual Studio Code to write these posts in Markdown. I don&apos;t have GitHub Copilot enabled to suggest content or completions while editing these files for the same reason.&lt;/p&gt;
&lt;p&gt;I do often make use of Copilot Code Review to do a proofread of new blog posts as part of the pull request process for publishing them. It&apos;s quite handy at spotting dumb typos (like like this!), spelling mistakes and some grammatical suggestions. My current workflow with any comments it creates is to consider each one individually and then manually edit the post as I see fit - not just blindly accepting its suggestions.&lt;/p&gt;
&lt;p&gt;So yeah, this is me, writing stuff primarily for future me, and because sometimes it&apos;s just good to dump stuff out of your brain and into written words. And if others enjoy it or find it useful, then that&apos;s a bonus.&lt;/p&gt;
&lt;h2&gt;Postscript&lt;/h2&gt;
&lt;p&gt;And in case you&apos;re wondering, here&apos;s what Copilot Code Review thought of the first draft of this post. Curious that it did spot the duplicated &quot;like&quot; but somehow decided it didn&apos;t need fixing 😀&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://david.gardiner.net.au/_astro/copilot-code-review-approved.DilgoJ1a_ZVKl2L.webp&quot; alt=&quot;Screenshot of GitHub Copilot&apos;s review of this post&quot; /&gt;&lt;/p&gt;
</content>
  </entry>
  <entry>
    <id>https://david.gardiner.net.au/2026/10/az-401</id>
    <updated>2026-10-31T08:00:00.000+10:30</updated>
    <title>Exam AZ-401: Designing and Implementing Microsoft Agentic DevOps Solutions (beta)</title>
    <link href="https://david.gardiner.net.au/2026/10/az-401" rel="alternate" type="text/html" title="Exam AZ-401: Designing and Implementing Microsoft Agentic DevOps Solutions (beta)"/>
    <category term="AI"/>
    <category term="Azure DevOps"/>
    <category term="GitHub Actions"/>
    <category term="Training and Certification"/>
    <published>2026-10-31T08:00:00.000+10:30</published>
    <summary type="html">I took the new AZ-401 exam but the experience as I was trying to sign in for the exam left a lot to be desired.</summary>
    <content type="html">&lt;p&gt;Yesterday I took the exam &lt;a href=&quot;https://learn.microsoft.com/en-us/credentials/certifications/exams/az-401/&quot;&gt;AZ-401: Designing and Implementing Microsoft Agentic DevOps Solutions&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://david.gardiner.net.au/_astro/az-401.DDDCH0XQ_1NPGyx.webp&quot; alt=&quot;Microsoft Certified: Agentic DevOps Engineer Expert - new exam AZ-401 beta&quot; /&gt;&lt;/p&gt;
&lt;p&gt;It&apos;s a &apos;beta&apos; exam which means that a) I used a special code to get a discounted price and b) I don&apos;t find out if I&apos;ve passed for a few more weeks - probably around the time that the exam becomes generally available.&lt;/p&gt;
&lt;p&gt;When Microsoft &lt;a href=&quot;https://techcommunity.microsoft.com/blog/skills-hub-blog/new-microsoft-certified-agentic-devops-engineer-expert/4528356&quot;&gt;announced the availability of AZ-401&lt;/a&gt; they did mention that &quot;Exam AZ-400: Designing and Implementing Microsoft DevOps Solutions and  Microsoft Certified: DevOps Engineer Expert will retire on February 1, 2027&quot;&lt;/p&gt;
&lt;p&gt;Passing AZ-401 along with either &lt;a href=&quot;https://learn.microsoft.com/en-us/credentials/certifications/github-copilot/?source=recommendations&amp;amp;practice-assessment-type=certification&quot;&gt;GH-300: GitHub Copilot&lt;/a&gt; or &lt;a href=&quot;https://learn.microsoft.com/credentials/certifications/azure-administrator/?source=recommendations&amp;amp;practice-assessment-type=certification&quot;&gt;AZ-104: Microsoft Azure Administrator&lt;/a&gt; is a prerequisite for gaining the Microsoft Certified: Agentic DevOps Engineer Expert certification.&lt;/p&gt;
&lt;p&gt;If you look at the &lt;a href=&quot;https://learn.microsoft.com/en-au/credentials/certifications/resources/study-guides/az-401&quot;&gt;study guide&lt;/a&gt; for this exam, you might not be surprised to learn that it&apos;s quite similar to &lt;a href=&quot;https://learn.microsoft.com/en-au/credentials/certifications/resources/study-guides/az-400&quot;&gt;AZ-400&lt;/a&gt;, with just a bit more AI thrown in.&lt;/p&gt;
&lt;p&gt;I &lt;a href=&quot;/2022/02/passed-az400&quot;&gt;previously passed AZ-400&lt;/a&gt; and as it turned out I recently got an email saying the renewal test for that certification was available. I did that earlier in the week as a useful form of preparation for AZ-401 (though obviously it didn&apos;t cover any AI subjects).&lt;/p&gt;
&lt;h2&gt;Not a good start&lt;/h2&gt;
&lt;p&gt;I&apos;ve done quite a few certifications before and I write about most of them here. The last one I did was &lt;a href=&quot;/2025/10/ai-102&quot;&gt;AI-102&lt;/a&gt; 12 months ago, so I thought I was prepared for signing in to do the exam. Turns out I was not.&lt;/p&gt;
&lt;p&gt;Pearson VUE runs the exams, and you can take them either in-person at an exam centre, or online at a suitable place of your choosing (eg. in your home). My previous experience was that as part of signing in you would need to upload photos of the room where you intended to take the exam via your phone, and then usually a proctor would talk to you via video call (as part of the exam software) and ask you to move your webcam around the room and desk just to confirm that everything was fine, including that any additional monitors are not just turned away, but cords are physically detached.&lt;/p&gt;
&lt;p&gt;The exam registration email from Pearson VUE after booking the exam includes this line:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;One display screen only. Secondary displays must be disconnected, and touch screens are not permitted.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;My desk usually has three external monitors mounted on monitor arms, so I had disconnected the others like I did last time in anticipation of a smooth onboarding experience.&lt;/p&gt;
&lt;p&gt;What changed was that now there seems to be some AI checking of those photos (as it happens quite quickly while you&apos;re still on your phone) and it will automatically flag anything it thinks is dodgy.&lt;/p&gt;
&lt;p&gt;For me it was saying I had additional monitors - well yeah I do, but they were all disconnected and powered off. The problem is it doesn&apos;t seem to be able to tell that. It also seemed to flag a TV and a whiteboard in the room. There is a TV behind me but it was turned off. I don&apos;t have a whiteboard so I have no idea what it was looking at there.&lt;/p&gt;
&lt;p&gt;The big problem is this is all automated - there&apos;s no button to click to say &apos;Check with a human&apos;.&lt;/p&gt;
&lt;p&gt;I was frantically running around the house trying to find a pair of pliers and a screwdriver so I could disconnect the two extra monitors from their monitor arms and remove them from the room entirely, and throwing blankets over the TV, in the hope that this would placate the AI, and crossing my fingers that it would decide I really didn&apos;t have a whiteboard.&lt;/p&gt;
&lt;p&gt;The other annoying thing is the both the exam desktop application, and the web page you launch on your phone seem to have timeouts while you&apos;re in the signing-in stage - both would disappear after a few minutes (while I was disconnecting monitors) so then you have to go through the whole &apos;relaunch the desktop app, skip through the hardware checks, then scan the QR code with your phone and re-submit room photos&apos; dance.&lt;/p&gt;
&lt;p&gt;That was quite stressful, and not what you need just before you&apos;re about to do an exam.&lt;/p&gt;
&lt;p&gt;I get that Pearson VUE needs to be vigilant against cheating, but it feels like the pendulum is swinging too far, and especially without any way for human review or oversight (like how it worked for my previous exam) is a backwards step.&lt;/p&gt;
&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;I can&apos;t tell you about the questions in the exam - go take a look at the study guide.&lt;/p&gt;
&lt;p&gt;One side-benefit I&apos;ve found in doing exams is that often there are one or two questions on topics that you are less confident about or have had no experience with. I&apos;m pretty strong on the DevOps side of things, having done a lot of Azure DevOps and GitHub work for a number of years now. Less so with the agentic side of DevOps mentioned in the study guide for this exam. I need to dig into these topics a bit more in the future:&lt;/p&gt;
&lt;h3&gt;Monitor Azure workloads by using AI agents&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Deploy and configure Azure Copilot Observability Agent&lt;/li&gt;
&lt;li&gt;Deploy and configure Azure SRE Agent&lt;/li&gt;
&lt;li&gt;Investigate and resolve issues raised by Azure SRE Agent&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Analyze metrics from instrumentation by using AI agents&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Analyze infrastructure performance indicators, including CPU, memory, disk, and network&lt;/li&gt;
&lt;li&gt;Analyze application performance by using telemetry and instrumentation data&lt;/li&gt;
&lt;li&gt;Analyze distributed tracing by using Azure Monitor Application Insights&lt;/li&gt;
&lt;li&gt;Configure and collection and management of GitHub Copilot agent logs&lt;/li&gt;
&lt;li&gt;Interrogate logs by using natural language queries or basic Kusto Query Language (KQL) queries&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;And as for the exam, I&apos;ll be interested to see how I went!&lt;/p&gt;
</content>
    <media:thumbnail url="https://david.gardiner.net.au/_astro/az-401.DDDCH0XQ.png" width="640" height="360"/>
    <media:content medium="image" url="https://david.gardiner.net.au/_astro/az-401.DDDCH0XQ.png" width="640" height="360"/>
  </entry>
  <entry>
    <id>https://david.gardiner.net.au/2026/10/kia-ev5-towing</id>
    <updated>2026-10-24T19:00:00.000+10:30</updated>
    <title>Towing with a Kia EV5</title>
    <link href="https://david.gardiner.net.au/2026/10/kia-ev5-towing" rel="alternate" type="text/html" title="Towing with a Kia EV5"/>
    <category term="Energy"/>
    <category term="Family"/>
    <published>2026-10-24T19:00:00.000+10:30</published>
    <summary type="html">We&apos;d ordered a towbar to be fitted to our new Kia EV. But given it&apos;s only the base model what is the experience trying to tow a trailer?</summary>
    <content type="html">&lt;p&gt;Our previous car had a towbar, and we own a trailer. So when we were ordering &lt;a href=&quot;/2026/08/kia-ev5&quot;&gt;our new Kia EV5&lt;/a&gt; I enquired about getting a towbar fitted. The only slight hitch (pun intended) was that when the car was ready to pick up, the dealer apologised that the towbar was still on backorder and they&apos;d let me know when it came in. It was probably a couple of months later when they called back to say it had arrived. I organised that it was fitted when the car went in for its first scheduled service.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://david.gardiner.net.au/_astro/kia-ev5-towbar.GsPwc0q9_Z2no3xY.webp&quot; alt=&quot;Closeup of towbar with tow ball attached&quot; /&gt;&lt;/p&gt;
&lt;p&gt;The towing specifications for the Kia EV5 (from the &lt;a href=&quot;https://www.kia.com/content/dam/kwcms/au/en/images/pdf/ev5/kia-ev5-brochure.pdf&quot;&gt;2026 model brochure&lt;/a&gt;) are as follows:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Towing Capacity&lt;/th&gt;
&lt;th&gt;Air 2WD SR&lt;/th&gt;
&lt;th&gt;Air 2WD LR, Earth AWD LR, GT-Line AWD LR&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;&lt;tr&gt;
&lt;td&gt;Towing Capacity Unbraked (Kg)&lt;/td&gt;
&lt;td&gt;300&lt;/td&gt;
&lt;td&gt;750&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Towing Capacity Braked (Kg)&lt;/td&gt;
&lt;td&gt;300&lt;/td&gt;
&lt;td&gt;1,250&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Max. Towball Download (Kg)&lt;/td&gt;
&lt;td&gt;50&lt;/td&gt;
&lt;td&gt;100&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;p&gt;We have the base model - an Air 2WD SR, so it is rated to tow but has the lowest capacity. As I understand it, the main reason for the other models having higher capacity is down to the extra weight (and power) of the batteries that those models come with.&lt;/p&gt;
&lt;p&gt;I don&apos;t need to tow anything like a caravan or a boat. Our trailer is just a standard &quot;6x4&quot; - quite handy for getting a load of mulch for the garden, or transporting something that&apos;s too big to fit in the car.&lt;/p&gt;
&lt;p&gt;Even so, I was wondering how the EV5 would go even just towing a regular trailer with a light load. Would it struggle? Would it turn out that the only thing we could use it for is a bike rack? I was keen to find out.&lt;/p&gt;
&lt;h2&gt;The towing experience&lt;/h2&gt;
&lt;p&gt;When you attach a trailer to the EV5, it displays a notification on the infotainment display:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://david.gardiner.net.au/_astro/kia-ev5-dash-towbar-detected.BWgeRCCr_Z1n0Wuy.webp&quot; alt=&quot;Photo of dashboard showing a prompt &apos;The trailer is connected to the vehicle. Do you want to check the trailer checklist?&apos;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;The checklist is just that - a list of steps that you should be aware of when preparing to tow something with the car. You can step through it, or just ignore it. It&apos;s just informational.&lt;/p&gt;
&lt;p&gt;The other interesting thing is that the car essentially switches to &quot;towing&quot; mode. You can tell this because a new icon appears on the driver&apos;s dashboard:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://david.gardiner.net.au/_astro/kia-ev5-towing-icon.CVJ58PqR_19GTsQ.webp&quot; alt=&quot;Photo of towing indicator on car dashboard&quot; /&gt;&lt;/p&gt;
&lt;p&gt;It also automatically reduces the estimated range. Notice that my battery is charged at 100%, and yet the range shows as 321km (without the trailer our EV5 would show a range of ~460km when fully charged).&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://david.gardiner.net.au/_astro/kia-ev5-dash-capacity.CYRBGYP__Z2b0sst.webp&quot; alt=&quot;Photo of EV5 dashboard showing range of 321km and 100% charge&quot; /&gt;&lt;/p&gt;
&lt;p&gt;That&apos;s a bit of a surprise at first - where did all our power go? Well nowhere. It&apos;s still there (and if you disconnected the trailer it would jump back up to the normal number). But it makes sense - the car knows it has to pull some extra weight, and that will draw down on the batteries, and use up the charge at a faster rate. (It defaults to an automatic ratio, but you can override this in the Settings menu if you want to).&lt;/p&gt;
&lt;p&gt;But how much impact would it have? That was what I was unsure about.&lt;/p&gt;
&lt;p&gt;The very first time I hooked up our trailer to the car and took it for a test drive around the block, the car started dinging and these alerts kept appearing warning me that the trailer&apos;s turning signal lights weren&apos;t working! I&apos;d checked the lights before departing so that was a surprise. I got out a wire brush and gave the trailer&apos;s electrical plug (and the adapter) a good clean, hoping that removing dust and cobwebs might do the trick. Pleasingly it did. That&apos;s a nice feature that the car is monitoring the lighting circuits to the trailer and letting you know if it thinks there&apos;s a problem.&lt;/p&gt;
&lt;p&gt;The next day we towed a load of furniture wit our trailer and had to drive up a longish hill. That was interesting, as while the car handled the load well, it was obviously using more power to do so - you could literally see the range reducing every few seconds. Fortunately once at the top of the hill the road evened out, and so did the electricity consumption. Once you&apos;re on the flat then it doesn&apos;t use much extra to pull the trailer along at all - momentum is a good thing sometimes.&lt;/p&gt;
&lt;p&gt;Going back down the same hill was the opposite - the regenerative breaking was working overtime as now the car had the trailer pushing it slightly from behind (not that you&apos;ll ever generate more power than you use).&lt;/p&gt;
&lt;p&gt;In the end I became comfortable that we could do a few trips up and down the hill and we&apos;d still have plenty of capacity to get home.&lt;/p&gt;
&lt;h2&gt;Sensors&lt;/h2&gt;
&lt;p&gt;One other difference when the car goes into &quot;towing&quot; mode is that it disables a number of the sensors that you normally benefit from. The systems that warn you about cars passing you either side are disabled - presumably because otherwise they&apos;d get confused by this trailer that&apos;s following close behind you.&lt;/p&gt;
&lt;p&gt;Likewise the reversing sensor (obviously) is also disabled. So you just need to be a little more alert when driving - some of those safety systems that you&apos;re used to won&apos;t be active.&lt;/p&gt;
&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;While at first I was wondering whether the Kia EV5 base model would be able to tow anything at all, the good news is that yes it can, and does just fine.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://david.gardiner.net.au/_astro/kia-ev5-with-trailer.CsbW3nkN_atNBi.webp&quot; alt=&quot;Kia EV5 towing a trailer&quot; /&gt;&lt;/p&gt;
</content>
    <media:thumbnail url="https://david.gardiner.net.au/_astro/kia-ev5-towbar.GsPwc0q9.jpg" width="477" height="344"/>
    <media:content medium="image" url="https://david.gardiner.net.au/_astro/kia-ev5-towbar.GsPwc0q9.jpg" width="477" height="344"/>
  </entry>
  <entry>
    <id>https://david.gardiner.net.au/2026/10/websub</id>
    <updated>2026-10-17T22:30:00.000+10:30</updated>
    <title>WebSub notifications when my blog has new content</title>
    <link href="https://david.gardiner.net.au/2026/10/websub" rel="alternate" type="text/html" title="WebSub notifications when my blog has new content"/>
    <category term="Blogging"/>
    <category term="GitHub Actions"/>
    <published>2026-10-17T22:30:00.000+10:30</published>
    <summary type="html">Using the WebSub protocol to notify interested parties that there&apos;s new content on my blog</summary>
    <content type="html">&lt;p&gt;When I write a new post here on my blog, it updates the Atom (RSS) feed. But how does anyone know that the feed has changed?&lt;/p&gt;
&lt;p&gt;If you&apos;re using some kind of desktop RSS Feed reader, then it may just check all the RSS feeds when you open it, or maybe at a specified interval. Likewise if you use an online service like &lt;a href=&quot;https://feedly.com/homepage&quot;&gt;Feedly&lt;/a&gt;, then presumably they also are checking feeds regularly. I imagine they&apos;re probably watching how often a feed changes and then adjusting the frequency of checking.&lt;/p&gt;
&lt;p&gt;But wouldn&apos;t it be nice if I could just tell Feedly (or anyone else for that matter) that I&apos;ve published this new post, and then anyone who was interested could then retrieve the latest content immediately?&lt;/p&gt;
&lt;p&gt;I wondered if Feedly might have some kind of endpoint that I could ping. I found &lt;a href=&quot;https://docs.feedly.com/article/212-how-often-does-feedly-update&quot;&gt;this page&lt;/a&gt; in their documentation that mentioned something called &quot;PuSH protocol&quot;. I did find &lt;a href=&quot;https://push.org/docs/&quot;&gt;https://push.org/docs/&lt;/a&gt; but that&apos;s something to do with blockchain and I didn&apos;t think was related.&lt;/p&gt;
&lt;p&gt;I then resorted to asking Copilot and it suggested that &quot;PuSH&quot; was &quot;short for PubSubHubbub, now standardised as WebSub&quot;.&lt;/p&gt;
&lt;p&gt;PubSubHubbub can still be found at &lt;a href=&quot;https://github.com/pubsubhubbub&quot;&gt;https://github.com/pubsubhubbub&lt;/a&gt;, and the W3C specification for WebSub is at &lt;a href=&quot;https://www.w3.org/TR/websub/&quot;&gt;https://www.w3.org/TR/websub/&lt;/a&gt;. It&apos;s amazing that this is not brand new - it&apos;s been around for at least 10 years!&lt;/p&gt;
&lt;p&gt;The WebSub specification describes a system with &quot;publishers&quot;, &quot;subscribers&quot; and &quot;hubs&quot;. Publishers tell the hub when their content has changed. The hub then notifies all subscribers of that content that there&apos;s been a change.&lt;/p&gt;
&lt;p&gt;The two most popular hubs seem to be &lt;a href=&quot;https://superfeedr.com/&quot;&gt;Superfeedr&lt;/a&gt; and &lt;a href=&quot;https://pubsubhubbub.appspot.com/&quot;&gt;Google PubSubHubbub Hub&lt;/a&gt;. It turns out I already had an account with Superfeedr - I think I might have created it a few years ago when I was researching alternatives to Feedburner.&lt;/p&gt;
&lt;p&gt;Superfeedr don&apos;t charge for publishers, but they do for subscribers. I&apos;m only a publisher so that&apos;s fine.&lt;/p&gt;
&lt;p&gt;Google&apos;s site looks like it hasn&apos;t changed in 10 years, and you never can tell with Google how long they&apos;re going to keep running something. But it doesn&apos;t hurt to cover my bases, so after originally just using Superfeedr I decided to also add Google&apos;s hub too.&lt;/p&gt;
&lt;p&gt;There were two things I needed to change in my blog to support WebSub:&lt;/p&gt;
&lt;h2&gt;Update Atom feed&lt;/h2&gt;
&lt;p&gt;The Atom feed for my blog needs to have &lt;code&gt;link&lt;/code&gt; elements added to the &lt;code&gt;feed&lt;/code&gt; section. You need one with &lt;code&gt;rel=&quot;self&quot;&lt;/code&gt; that points to your feed, and then you need a &lt;code&gt;rel=&quot;hub&quot;&lt;/code&gt; for each hub that you want to act as a publisher for:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;link href=&quot;https://david.gardiner.net.au/feed.xml&quot; rel=&quot;self&quot; type=&quot;application/atom+xml&quot;/&amp;gt;
&amp;lt;link href=&quot;https://flcdrg.superfeedr.com&quot; rel=&quot;hub&quot;/&amp;gt;
&amp;lt;link href=&quot;https://pubsubhubbub.appspot.com/&quot; rel=&quot;hub&quot;/&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Ping the hub(s)&lt;/h2&gt;
&lt;p&gt;With that in place you then need to ping the hubs each time your feed changes. As I&apos;m using GitHub Action workflows I added these jobs to do that:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;  ping_superfeedr:
    runs-on: ubuntu-latest
    needs: publish_to_cloudflare
    name: Ping Superfeedr

    steps:
      - shell: pwsh
        if: github.event_name == &apos;push&apos; &amp;amp;&amp;amp; github.ref == &apos;refs/heads/main&apos;
        run: |
          $url = &quot;https://david.gardiner.net.au/feed.xml&quot;
          Write-Host &quot;Pinging Superfeedr with URL: $url&quot;

          $response = Invoke-WebRequest -Method Post -Uri &quot;https://flcdrg.superfeedr.com&quot; -Body @{ &quot;hub.mode&quot; = &quot;publish&quot;; &quot;hub.url&quot; = $url }
          Write-Host &quot;Response: $($response.StatusCode)&quot;

  ping_pubsubhubbub:
    runs-on: ubuntu-latest
    needs: publish_to_cloudflare
    name: Ping PubSubHubbub

    steps:
      - shell: pwsh
        if: github.event_name == &apos;push&apos; &amp;amp;&amp;amp; github.ref == &apos;refs/heads/main&apos;
        run: |
          $url = &quot;https://david.gardiner.net.au/feed.xml&quot;
          Write-Host &quot;Pinging PubSubHubbub with URL: $url&quot;

          $response = Invoke-WebRequest -Method Post -Uri &quot;https://pubsubhubbub.appspot.com/&quot; -Body @{ &quot;hub.mode&quot; = &quot;publish&quot;; &quot;hub.url&quot; = $url }
          Write-Host &quot;Response: $($response.StatusCode)&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;It&apos;s interesting that Superfeedr creates a custom domain for your account to use &lt;a href=&quot;https://flcdrg.superfeedr.com/&quot;&gt;https://flcdrg.superfeedr.com/&lt;/a&gt;, whereas Google just have their main domain that is used by everyone.&lt;/p&gt;
&lt;p&gt;You can see both of these jobs in the context of my blog&apos;s full workflow &lt;a href=&quot;https://github.com/flcdrg/astro-blog-engine/blob/main/.github/workflows/main.yml#L490-L519&quot;&gt;here&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;Summary&lt;/h2&gt;
&lt;p&gt;The end result is that now Feedly shows my post almost immediately after it is published. Any other subscribers will have the same experience.&lt;/p&gt;
&lt;p&gt;Nice!&lt;/p&gt;
&lt;p&gt;Now if only I could get &lt;a href=&quot;/2026/05/google-search-indexing&quot;&gt;Google to resume indexing my blog again&lt;/a&gt;. It suddenly stopped doing it back in May and everything I&apos;ve tried so far since has not changed that. At least &lt;a href=&quot;https://www.bing.com/&quot;&gt;Bing&lt;/a&gt; and by extension &lt;a href=&quot;https://duckduckgo.com&quot;&gt;DuckDuckGo&lt;/a&gt; still like me.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <id>https://david.gardiner.net.au/2026/10/verify-cli-github-action</id>
    <updated>2026-10-12T22:30:00.000+10:30</updated>
    <title>Verify.Cli GitHub Action</title>
    <link href="https://david.gardiner.net.au/2026/10/verify-cli-github-action" rel="alternate" type="text/html" title="Verify.Cli GitHub Action"/>
    <category term="GitHub Actions"/>
    <category term="Testing"/>
    <published>2026-10-12T22:30:00.000+10:30</published>
    <summary type="html">A GitHub Action for doing snapshot testing against files directly in your workflow</summary>
    <content type="html">&lt;p&gt;I&apos;ve &lt;a href=&quot;/2025/07/verify-cli&quot;&gt;previously written&lt;/a&gt; about the command line tool I created for snapshot testing files without needing a unit test framework - &lt;a href=&quot;https://github.com/flcdrg/Verify.Cli&quot;&gt;Verify.Cli&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;I&apos;ve been making good use of this tool as I continue to make changes and improvements to my blog. The underlying &quot;engine&quot; of my blog lives in my &lt;a href=&quot;https://github.com/flcdrg/astro-blog-engine/&quot;&gt;astro-blog-engine&lt;/a&gt; repo, and it contains a small subset of my blog posts that I use for testing any changes before merging to my full blog repo. The latter repo is private.&lt;/p&gt;
&lt;p&gt;Up until now I&apos;ve had these wired up in my blog engine repo&apos;s GitHub Actions workflow like this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;      - name: Verify post
        id: verify_post
        if: github.event_name == &apos;pull_request&apos; || github.repository == &apos;flcdrg/astro-blog-engine&apos;
        run: docker run --rm --user &quot;$(id -u):$(id -g)&quot; -v $PWD:/tmp flcdrg/verify-cli --file /tmp/dist/2025/07/azure-pipeline-template-expression.html --verified-dir /tmp/verified --scrub-inline-pattern &apos;(?&amp;lt;prefix&amp;gt;&quot;)/_astro/[^&quot;]+(?&amp;lt;suffix&amp;gt;&quot;)&apos; --scrub-inline-pattern &apos;(?&amp;lt;prefix&amp;gt;title=&quot;)[^&quot;]+(?&amp;lt;suffix&amp;gt;&quot;)&apos; --scrub-inline-remove &apos; data-image-component=&quot;true&quot;&apos; --scrub-inline-pattern &apos;(?&amp;lt;prefix&amp;gt;meta name=&quot;generator&quot; content=&quot;Astro v)[\d\.]+(?&amp;lt;suffix&amp;gt;&quot;)&apos; --verbosity detailed

      - name: Diff post if error
        if: failure() &amp;amp;&amp;amp; steps.verify_post.outcome == &apos;failure&apos;
        run: |
          ls -al verified/
          echo &quot;&quot;
          diff -u verified/azure-pipeline-template-expression.html.verified.html verified/azure-pipeline-template-expression.html.received.html
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Just this week I discovered I&apos;d accidentally messed up the &lt;a href=&quot;https://david.gardiner.net.au/tags&quot;&gt;Tags&lt;/a&gt; page on my blog. A recent change had mixed up the tag name and the count for the number of pages with that tag, which caused all the links to be broken.&lt;/p&gt;
&lt;p&gt;I realised that page didn&apos;t have a covering snapshot test in the engine repo, so some copy/paste ensued. In doing that it occurred to me that I really should extract out the common logic and make it a reusable GitHub Action. So that&apos;s what I&apos;ve done.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://github.com/marketplace/actions/verify-cli&quot;&gt;verify-cli&lt;/a&gt; is now listed in the GitHub Actions marketplace, and the source is at &lt;a href=&quot;https://github.com/flcdrg/verify-cli-action&quot;&gt;https://github.com/flcdrg/verify-cli-action&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I can now simplify my blog&apos;s workflow file by using this new action:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;      - name: Verify post
        if: github.event_name == &apos;pull_request&apos; || github.repository == &apos;flcdrg/astro-blog-engine&apos;
        uses: flcdrg/verify-cli-action@v1
        with:
          file: dist/2025/07/azure-pipeline-template-expression.html
          verified-directory: verified
          working-directory: .
          scrub-inline-pattern: |
            (?&amp;lt;prefix&amp;gt;&quot;)/_astro/[^&quot;]+(?&amp;lt;suffix&amp;gt;&quot;)
            (?&amp;lt;prefix&amp;gt;title=&quot;)[^&quot;]+(?&amp;lt;suffix&amp;gt;&quot;)
            (?&amp;lt;prefix&amp;gt;meta name=&quot;generator&quot; content=&quot;Astro v)[\d\.]+(?&amp;lt;suffix&amp;gt;&quot;)
          scrub-inline-remove: &apos; data-image-component=&quot;true&quot;&apos;
          verbosity: detailed
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Failing example&lt;/h2&gt;
&lt;p&gt;Here&apos;s an example (based on the test workflow in the verify-cli-action repo) to show what it looks like if the received file doesn&apos;t match the verified file&lt;/p&gt;
&lt;p&gt;The workflow step is similar to this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;      - name: &quot;Match in separate verified directory - not matching&quot;
        uses: flcdrg/verify-cli-action@v1
        with:
          file: &quot;data/notMatching.json&quot;
          working-directory: &quot;samples/separate-verified&quot;
          verified-directory: &quot;verified&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;With this result:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://david.gardiner.net.au/_astro/verify-cli-action-failing.CojYQ54y_Z21BKH4.webp&quot; alt=&quot;Screenshot of failing GitHub Actions workflow&quot; /&gt;&lt;/p&gt;
&lt;p&gt;If you need to ensure that a file&apos;s contents match a known state (and need to ignore specific text like timestamps), but be alerted by a failing GitHub Actions workflow if it changes (and see what those changes are), then this action might be just the thing.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <id>https://david.gardiner.net.au/2026/09/actions-setup-dotnet</id>
    <updated>2026-09-26T16:00:00.000+09:30</updated>
    <title>Troubleshooting GitHub Package NuGet feeds with GitHub Actions</title>
    <link href="https://david.gardiner.net.au/2026/09/actions-setup-dotnet" rel="alternate" type="text/html" title="Troubleshooting GitHub Package NuGet feeds with GitHub Actions"/>
    <category term=".NET"/>
    <category term="GitHub Actions"/>
    <published>2026-09-26T16:00:00.000+09:30</published>
    <summary type="html">Make sure you configure the actions/setup-dotnet action correctly to set up the right .NET SDK and authenticate to a GitHub Packages NuGet feed.</summary>
    <content type="html">&lt;p&gt;If you&apos;re building .NET applications with GitHub Actions, then you want to ensure the correct .NET SDK is in place. If you&apos;re using &lt;a href=&quot;https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-nuget-registry&quot;&gt;GitHub Packages to access a private NuGet feed&lt;/a&gt; then you&apos;ll also need to be able to authenticate to that feed. The &lt;a href=&quot;https://github.com/marketplace/actions/setup-net-core-sdk&quot;&gt;actions/setup-dotnet&lt;/a&gt; action is great for doing both of these tasks, but there are some gotchas I&apos;ve encountered when using it.&lt;/p&gt;
&lt;p&gt;Using the action is pretty straight forward:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;- uses: actions/setup-dotnet@v6
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;If you have a &lt;code&gt;global.json&lt;/code&gt; file present in the root of your repo it will read it by default. If you don&apos;t then it doesn&apos;t know which version to install and you&apos;ll see this logged in the workflow run:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;The global.json wasn&apos;t found in the root directory. No .NET version will be installed.
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Better to use &lt;code&gt;dotnet-version&lt;/code&gt; to indicate one (or more) SDK version ranges to install:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;- uses: actions/setup-dotnet@v6
  with:
    dotnet-version: 10.0.x
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;That is fine, but the best approach in my opinion is to have a &lt;code&gt;global.json&lt;/code&gt; file with an sdk property set like this:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;{
  &quot;sdk&quot;: {
    &quot;version&quot;: &quot;10.0.401&quot;,
    &quot;rollForward&quot;: &quot;latestFeature&quot;
  },
  &quot;test&quot;: {
    &quot;runner&quot;: &quot;Microsoft.Testing.Platform&quot;
  }
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The action will read the SDK version from there. This is often a good thing as it means you just need to set the version in one place rather than all through your workflow files.&lt;/p&gt;
&lt;h2&gt;Using GitHub Packages feeds&lt;/h2&gt;
&lt;p&gt;Assuming you&apos;ve already configured your GitHub packages feed in your &lt;code&gt;NuGet.Config&lt;/code&gt; file (and note the use of the newer &lt;code&gt;packageSourceMapping&lt;/code&gt; block):&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&amp;gt;
&amp;lt;configuration&amp;gt;
    &amp;lt;packageSources&amp;gt;
        &amp;lt;add key=&quot;nuget&quot; value=&quot;https://api.nuget.org/v3/index.json&quot; /&amp;gt;
        &amp;lt;add key=&quot;github&quot; value=&quot;https://nuget.pkg.github.com/flcdrg/index.json&quot; /&amp;gt;
    &amp;lt;/packageSources&amp;gt;

    &amp;lt;packageSourceMapping&amp;gt;
        &amp;lt;packageSource key=&quot;nuget&quot;&amp;gt;
            &amp;lt;package pattern=&quot;*&quot; /&amp;gt;
        &amp;lt;/packageSource&amp;gt;
        &amp;lt;packageSource key=&quot;github&quot;&amp;gt;
            &amp;lt;package pattern=&quot;Verify.MongoDB&quot; /&amp;gt;
        &amp;lt;/packageSource&amp;gt;
    &amp;lt;/packageSourceMapping&amp;gt;
&amp;lt;/configuration&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Then you can use the action to wire up authentication for the Packages feed with the &lt;code&gt;source-url&lt;/code&gt; input parameter:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;- uses: actions/setup-dotnet@v6
  with:
    source-url: https://nuget.pkg.github.com/flcdrg/index.json
  env:
    NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Note that you must grant the GitHub token access to read packages!&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;permissions:
  contents: read
  packages: read
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;And you&apos;d think that would be it. But there are some edge cases to be aware of.&lt;/p&gt;
&lt;h2&gt;Building from a subdirectory&lt;/h2&gt;
&lt;p&gt;The action defaults to looking in the root of the repository for &lt;code&gt;global.json&lt;/code&gt; and &lt;code&gt;NuGet.Config&lt;/code&gt; files. If your .NET source code resides in a subdirectory (often the case if you are using a monorepo approach), then make sure you tell the action where they are:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;- uses: actions/setup-dotnet@v6
  with:
    global-json-file: globaljson-and-nugetconfig/global.json
    source-url: https://nuget.pkg.github.com/flcdrg/index.json
    config-file: globaljson-and-nugetconfig/nuget.config
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;If you forget to set &lt;code&gt;global-json-file&lt;/code&gt; and/or &lt;code&gt;config-file&lt;/code&gt; then it will only look in the root of the repository, and either load the wrong files or load nothing if those files don&apos;t exist at the root (as we saw earlier).&lt;/p&gt;
&lt;p&gt;When the &lt;code&gt;action/setup-dotnet&lt;/code&gt; action runs with &lt;code&gt;source-url&lt;/code&gt;, it actually generates an additional temporary &lt;code&gt;nuget.config&lt;/code&gt; file. You can see this in the workflow run output:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;dotnet-auth: Finding any source references in /home/runner/work/using-setup-dotnet-action/using-setup-dotnet-action/nuget.config, writing a new temporary configuration file with credentials to /home/runner/work/using-setup-dotnet-action/nuget.config
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;That temporary file contains the authentication details for the feed.&lt;/p&gt;
&lt;p&gt;But the restore fails:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Determining projects to restore...
/usr/share/dotnet/sdk/10.0.401/NuGet.targets(198,5): warning : Your request could not be authenticated by the GitHub Packages service. Please ensure your access token is valid and has the appropriate scopes configured. [/home/runner/work/using-setup-dotnet-action/using-setup-dotnet-action/globaljson-and-nugetconfig/tests/tests.csproj]
  Retrying &apos;FindPackagesByIdAsync&apos; for source &apos;https://nuget.pkg.github.com/flcdrg/download/verify.mongodb/index.json&apos;.
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;If you take a look at the contents of the temporary nuget.config file you might see the problem:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;configuration&amp;gt;
  &amp;lt;config&amp;gt;
    &amp;lt;add key=&quot;defaultPushSource&quot; value=&quot;https://nuget.pkg.github.com/flcdrg/index.json&quot;/&amp;gt;
  &amp;lt;/config&amp;gt;
  &amp;lt;packageSources&amp;gt;
    &amp;lt;add key=&quot;Source&quot; value=&quot;https://nuget.pkg.github.com/flcdrg/index.json&quot;/&amp;gt;
  &amp;lt;/packageSources&amp;gt;
  &amp;lt;packageSourceCredentials&amp;gt;
    &amp;lt;Source&amp;gt;
      &amp;lt;add key=&quot;Username&quot; value=&quot;flcdrg&quot;/&amp;gt;
      &amp;lt;add key=&quot;ClearTextPassword&quot; value=&quot;***&quot;/&amp;gt;
    &amp;lt;/Source&amp;gt;
  &amp;lt;/packageSourceCredentials&amp;gt;
&amp;lt;/configuration&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The action knows the feed URL, but it has defaulted to using &lt;code&gt;Source&lt;/code&gt; as the source name.&lt;/p&gt;
&lt;p&gt;The issue here is that when &lt;code&gt;dotnet restore&lt;/code&gt; runs, it finds the &lt;code&gt;nuget.config&lt;/code&gt; file in the application directory and combines that with the temporary file.&lt;/p&gt;
&lt;p&gt;The &lt;code&gt;packageSourceMapping&lt;/code&gt; defines the &lt;code&gt;github&lt;/code&gt; source as the only place to look for &lt;code&gt;Verify.MongoDB&lt;/code&gt; package. But the temporary &lt;code&gt;nuget.config&lt;/code&gt; file didn&apos;t use that name. So you end up that error.&lt;/p&gt;
&lt;p&gt;The solution is to set the &lt;code&gt;config-file&lt;/code&gt; input parameter so that the action can use the correct source name from your &lt;code&gt;nuget.config&lt;/code&gt; file. With the names aligned, everything should work correctly.&lt;/p&gt;
&lt;h2&gt;Summary&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;If &lt;code&gt;global.json&lt;/code&gt; is not in the root of the repository, use &lt;code&gt;global-json-file&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;If &lt;code&gt;NuGet.Config&lt;/code&gt; is not in the root of the repository, use &lt;code&gt;config-file&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
</content>
  </entry>
</feed>
