Skip to main content

Posts

Showing posts from May, 2024

Feedback loops in software development

Hello there! Would you be so kind to take another look at the Agile Manifesto ? For people who wants to avoid an extra click, I've added it below: We are uncovering better ways of developing software by doing it and helping others do it. Through this work we have come to value: Individuals and interactions over processes and tools Working software over comprehensive documentation Customer collaboration over contract negotiation Responding to change over following a plan That is, while there is value in the items on the right, we value the items on the left more. While most development teams claim to be agile, I always wonder if they really have read the manifesto above. Let’s start the conversation by talking about element in the list: Customer collaboration over contract negotiation In most projects I still see a lack of collaboration. Stakeholders are way to busy to talk to the development team so there is little to no user in

XUnit–Improve type safety

While doing a code review, I discovered a feature in XUnit I didn't know it existed. Let me share what I discovered.  I've been used to specify data for my parameterised tests either using the [InlineData] attribute or through the [MemberData] or [ClassData] attributes. When using [MemberData] or [ClassData] , XUnit expects that you return an IEnumerable<object[]> as far I as I know. Here is an example: If I try to use a typed alternative, it results in a compiler error: However it turns out that there is a type safe alternative available through TheoryData<> . The TheoryData<> types provide a series of abstractions around the IEnumerable<object[]> required by theory tests. It consists of a TheoryData base class, and a number of generic derived classes TheoryData<> . It can be used in combination with both the [MemberData] or [ClassData] attributes while enforcing type safety. Here is our original example rewritten to use The

Podman–Pull images from Docker Hub

Docker Hub is a container registry provided by Docker, Inc. It serves as a central repository for finding and sharing container images.  Although it is not the only place where docker images can be found it remains a popular container registry where developers and open source contributors can store, discover, and distribute container images. Pull through Docker Desktop To pull an image through Docker Desktop, you can use the following command: docker pull <image-name> For example, if I want to fetch the masstransit/rabbitmq image, I should execute the following command: docker pull masstransit/rabbitmq Pull through Podman Desktop What if I try to do the same thing through Podman Desktop: podman pull masstransit/rabbitmq This seems to work: However it is important to understand what is going on. If you don’t specify a registry name like we did here it look through the list of unqualified-search-registries. This list can be found inside the podman-machine at /et

Bicep– what-if

One of the cool features that Bicep has to offer is the 'what-if' operation. This allows you to preview the changes that will happen when applying your bicep template. Let’s see this operation in action: Open a command prompt Let’s first check if we have a version of the Azure CLI installed that supports the ‘what-if’ operation: az version The output should look like this: {   "azure-cli": "2.54.0",   "azure-cli-core": "2.54.0",   "azure-cli-telemetry": "1.1.0",   "extensions": {     "connectedk8s": "1.2.0",     "customlocation": "0.1.3",     "k8s-configuration": "1.1.1",      "k8s-extension": "1.0.4"   } } This should return at least CLI version 2.14.0. If not first install the latest version of the Azure CLI. Now we can run the command that w

Azure Static Web App–Deploy using Bicep

As a follow-up on the presentation I did at CloudBrew about Azure Static Web Apps I want to write a series of blog posts. Part I - Using the VS Code Extension Part II - Using the Astro Static Site Generator Part III  – Deploying to multiple environments Part IV – Password protect your environments Part V – Traffic splitting Part VI – Authentication using pre-configured providers Part VII – Application configuration using staticwebapp.config.json Part VIII – API Configuration Part IX – Injecting snippets Part X – Custom authentication Part XI – Authorization Part XII -  Assign roles through an Azure function Part XIII -  API integration Part XIV – Bring your own API Part XV – Pass authentication info to your linked API Part XVI – Distributed Functions Part XVII – Data API Builder Part XVIII(this post) -  Deploy using Bicep So far I’ve deployed our Azure Static Web App using Github Actions. But if you prefer to

Kubernetes–Limit your environmental impact

Reducing the carbon footprint and CO2 emission of our (cloud) workloads, is a responsibility of all of us. If you are running a Kubernetes cluster, have a look at Kube-Green . kube-green is a simple Kubernetes operator that automatically shuts down (some of) your pods when you don't need them. A single pod produces about 11 Kg CO2eq per year( here the calculation). Reason enough to give it a try! Installing kube-green in your cluster The easiest way to install the operator in your cluster is through kubectl. We first need to install a cert-manager: kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.14.5/cert-manager.yaml Remark: Wait a minute before you continue as it can take some time before the cert-manager is up & running inside your cluster. Now we can install the kube-green operator: kubectl apply -f https://github.com/kube-green/kube-green/releases/latest/download/kube-green.yaml Now in the namespace where we want t

SonarQube on Windows Troubleshooting

After installing a new SonarQube version on one our Windows Server VM’s, I encountered some issues. Let me walk you through the problems I encountered and how I fixed them. Issue 1 -  java.lang.UnsupportedClassVersionError After I extracted the SonarQube binaries I opened the installation folder, went to the bin\windows-x86-64 folder and tried to run the startsonar.bat file. This failed with the following error message: D:\sonar\bin\windows-x86-64>startsonar Starting SonarQube... Error: LinkageError occurred while loading main class org.sonar.application.App         java.lang.UnsupportedClassVersionError: org/sonar/application/App has been compiled by a more recent version of the Java Runtime (class file version 61.0), this version of the Java Runtime only recognizes class file versions up to 55.0 The error above is related to the class file version. Each JDK release comes with its class file version. Class files are backward compatible but files compiled for newer JDK

Kubernetes–Setup a local cluster through Podman Desktop

Running a local Kubernetes cluster is easy thanks to Podman Desktop and Kind . In this post I show you how to setup a kind environment from Podman Desktop. But first an introduction… What is Podman Desktop? Podman Desktop is an open source graphical tool enabling you to seamlessly work with containers and Kubernetes from your local environment. It offers similar functionality as Docker Desktop. Installing Podman Desktop(on Windows) is easy: Download the Windows installer . Start the Podman Desktop installer, open the downloaded file. Podman Desktop uses WSL2 to run a a Linux distribution in a virtual machine. It can be that a restart is required as the installer will try to enable/install WSL2 during the process. More information: Windows | Podman Desktop (podman-desktop.io) What is Kind? Kind is an open source project that allows to run Kubernetes clusters in a container engine (could be Docker or Podman or others). This is usually quite he

.NET Core - Renew localhost certificate

Today when I tried to debug a .NET Core application, I got a browser warning that my localhost certificate was no longer valid. The good news is that renewing your localhost certficate when using Kestrel is easy. You can use the built-in dotnet dev-certs command to manage a self-signed certificate. We can first remove the existing outdated certificate by executing the following command: dotnet dev-certs https --clean Output: Cleaning HTTPS development certificates from the machine. A prompt might get displayed to confirm the removal of some of the certificates. HTTPS development certificates successfully removed from the machine. Now we can generate a new self-signed certificate using following command: dotnet dev-certs https –trust Output: Trusting the HTTPS development certificate was requested. A confirmation prompt will be displayed if the certificate was not previously trusted. Click yes on the prompt to trust the certificate. Successfully created and truste

.NET Core - View outdated packages

When creating and maintaining (.NET Core) applications, it is always a good idea to keep the dependencies up-to-date. This helps to fix identified vulnerabilities but also keeps the upgrade path short as you closely stay to the latest package version. In this post I show you 3 ways to identify outdated packages and update them when necessary. Through the Visual Studio Package Manager When using Visual Studio, it is easy to find out whether newer versions of the NuGet packages used by your project is available, by using the NuGet Package Manager: Open your solution/project in Visual Studio Go to Tools -> NuGet Package Manager –> Manage NuGet Packages for Solution… Go to the Updates tab, check the Select all packages checkbox and click on Update Through the dotnet-outdated global tool A second option is to use the open source global .NET tool: dotnet-outdated . First install the tool using the following command: dotnet tool install --global dotnet-

The biggest effect on code quality

You carefully assembled a team of great developers, a top architect, UX designers, product owners, etc… You are confident that with this team you can tackle any challenge. However after 2 years working on the project, you have lost a lot of this confidence. The list of requested features keeps growing, existing functionality needs to be reworked because the business needs have evolved, and people work longer and longer days to still reach the predicted deadline. What started as workarounds to reach the end goal faster has evolved to just work. Workarounds are no longer the exception but became the rule. The solution becomes less and less stable and bugs are appearing everywhere. What is going on? Aha, we just discovered the biggest impact on code quality. It is not the skills of the team, neither the programming language or technologies they use, it is something else. The answer is ‘avoiding crunch mode’. Crunch mode , also known as crunch time , describes working extra

Azure Static Web App–Data API Builder

As a follow-up on the presentation I did at CloudBrew about Azure Static Web Apps I want to write a series of blog posts. Part I - Using the VS Code Extension Part II - Using the Astro Static Site Generator Part III  – Deploying to multiple environments Part IV – Password protect your environments Part V – Traffic splitting Part VI – Authentication using pre-configured providers Part VII – Application configuration using staticwebapp.config.json Part VIII – API Configuration Part IX – Injecting snippets Part X – Custom authentication Part XI – Authorization Part XII -  Assign roles through an Azure function Part XIII -  API integration Part XIV – Bring your own API Part XV – Pass authentication info to your linked API Part XVI – Distributed Functions Part XVII(this post) – Data API Builder So far I have shown you 2 different possibilities to integrate an API inside your Azure Static Web App: You have the Mana

.NET 8 - Warning AD0001: Analyzer 'Microsoft.AspNetCore.Analyzers.RouteHandlers.RouteHandlerAnalyzer' threw an exception of type 'System.InvalidOperationException'

After upgrading an application to .NET 8, the following warning appeared inside my IDE: Warning AD0001: Analyzer 'Microsoft.AspNetCore.Analyzers.RouteHandlers.RouteHandlerAnalyzer' threw an exception of type 'System.InvalidOperationException' with message 'Failed to resolve well-known type 'Microsoft.AspNetCore.Builde r.EndpointRouteBuilderExtensions'.'. As I have the ‘Treat Warnings as Errors’ setting enabled by default, this was a blocking issue for me. The problem is caused by a Roslyn lookup inside the RouterAnalyzer which searches for the EndpointRouteBuilderExtensions class by using GetTypeByMetadataName . However as HotChocolate is using exactly the same class name and namespace, null is returned  instead of the correct type.  This issue not only happens when using HotChocolate but also with the AspNetCore.HealthCheck.UI package that also has an EndpointRouterBuilderExtension class: AspNetCore.Diagnostics.HealthChecks/src/Health