Sunday, September 3, 2023

Setting up NGROK to hit multiple endpoints

 NGROK is a very useful developer tool for working with cloud based services, as it allows testing workflows where those services have to call back to your machine. With NGROK, you can create a temporary public address to hit an endpoint on your machine, so say, a workflow in Pipedream.com could hit a GraphQL endpoint to make content updates.

Sunday, March 5, 2023

Command line BACPACs to Docker SQL Server instances

A quick walkthrough of creating a Docker SQL instance, pushing data to it, taking a backup from the host command line (using BACPAC format) and pushing that data to a new instance. This made me feel a bit more confident working with SQL from the command line, and especially working with backups, which should make scripting these actions a bit easier.

Wednesday, January 4, 2023

Using Postman to Authenticate to GraphQL

With the release of Sitecore 10.3, a whole bunch of new capabilities have come into GraphQL, such as the ability to create items and templates, do index rebuilds, publish items, and so forth.  But the documentation for setting up authentication to these services is somewhat intimidating, requiring you to build an MVC controller just to sign in.  In fact, it's pretty simple to set authentication with Postman too, which will be a familiar option for those who have worked with Sitecore Commerce.

Sunday, September 19, 2021

Web Deploy Parameters, a first look

WebDeploy is a foundational technology for SIF, as well as Azure deployments and even Docker (where content packages need to be converted into web deploy packages to build images).  I recently did some digging into the basics of WebDeploy, including how to configure parameters in projects. This short walkthrough shows how to create a web deployment package form a project, how to publish it to an IIS site, and how to add and set a custom parameter.  We'll use this to set the "My Application" text in the MVC scaffold project in Visual Studio.  

Saturday, February 27, 2021

Using Docker Playground to Run Solr

Recently, I wanted to run through some Solr documentation, and I wanted a clean Solr instance with demo contents. I was able to do this pretty cleanly on the Play with Docker site (requires a free Docker account).  

Here are the steps:

Go to Play with Docker: https://labs.play-with-docker.com/

Click Add New Instance.


Saturday, August 29, 2020

Healthchecks and Sitecore containers

I just figured something out, and thought I'd share it.  I just tried spinning up Sitecore 10 on Docker, using the XM1 configuration, and I saw I was getting this error:

ERROR: for traefik  Container "5530f939e540" is unhealthy.

Friday, May 15, 2020

Using Bucket Search to find empty field values

The bucket search interface is an under used feature in Content Editor, at least underutilized by me.  One of the things that's always thrown me off is the OR vs. AND syntax.  I'm currently doing some discovery using the Helix.Examples site, and I need to clear the related product values.  I thought it would be helpful to be able to see the ones I've already cleared, or the ones that I still have left to do.  (There's just 20, or else I would have installed Sitecore PowerShell Extensions to do this.)

So far, I've cleared the Related Products field on 5 of the 20 Product Detail Page items.  Let's see this in the bucket query:

Okay, let's restrict to my bucketed type, to avoid the Shared Content and the Bucket folders (like "2019"). Type "tem" and tab out the autocomplete to "template"


A weird bit of UI glitchiness is you will just see "Template" (at least it's capitalized now), until you type a colon (:), then you get a little selector field with autocomplete. Select your template type:
 And we get 20 results as expected.


Okay, now let's add the filter by field value. Type a "c" and tab out to "custom", then type a colon to get the field selector:







Now type "r" and select "related products" which brings up this:





Type an asterisk after the pipe symbol to select any non-empty value:



Why did we get 20 results if 5 items have been cleared? The field is not empty condition is getting treated as an "OR" condition, so the template condition is causing the undesired fields values to be included.  By clicking on the magnifying glass icon next to "Related Products", we can make that an AND condition, and now we get 15. Nice!


Click it again to make it a NOT condition, and now we have only those items with that field empty, and now we get 5.




And you can see in your Search log what is going to Solr. OR, AND and NOT syntax bits called out below:

That was a lot of screen shots for a pretty simple feature, but I've always found the autocomplete a little perplexing, especially the bit about having to type a colon to make the field selector logic appear, and needed to click the condition into AND mode.

Happy Sitecoring!

Sunday, August 25, 2019

Overview of the Commerce 9.1 SIF Installation Process

The Sitecore Commerce installation really puts SIF through its paces, and a number of things can go wrong along the way. Having a clear sense of what the script is doing, how it is structured, what the bumps are, and how to pick thing up after an error can make a big difference, so I thought I'd share my experiences. These notes are based on the Commerce 9.1 installation, though I touch on what has changed since 9.0. I hope to look at the recently released 9.2 installation process in a future post.

Monday, July 10, 2017

Using Powershell to find duplicate IDs in serialized items

On my current project I was troubleshooting a failing integration test that makes use of the Sitecore FakeDB Serialization module, which can declarative load a branch of content directly from the file system. The setup method for this test was reporting a duplicate key exception, so I used PowerShell to identify the culprit.

Saturday, April 22, 2017

Readable Tests

There's a great little chapter in Growing Object Oriented Software Guided by Tests on how to write helper methods for building complex test data. The specific techniques are somewhat less relevant in a post AutoFixture world, but the chapter also makes a powerful case that test code should read as English prose.

Monday, January 2, 2017

First steps with SpecFlow and Selenium

I've always been a Unit Testing guy, but reading Growing Object Oriented Software Guided by Tests really brought home the role an acceptance test outer structure can play in an iterative development process.

Wednesday, November 9, 2016

Zapping Solr Cores with Powershell

Imagine you've been working on a feature that creates Sitecore Solr indexes with SIM. Three's a lot of testing that goes into that.

Wednesday, November 2, 2016

Disposing of a DLL

So I've been working on a feature for Sitecore Instance Manager to automate installing Sitecore instances with Solr turned on.  This has been pulled in to the Develop branch of SIM and should hopefully hit the downloadable version soon.

Wednesday, October 26, 2016

NCrunch

If you want to make unit testing and TDD truly addictive, you should look at NCrunch, which basically gives you while-you-type intellisense for unit tests.

Thursday, September 15, 2016

Another Look at Sitecore and Unit Testing

At Sitecore Symposium 2016, I will be giving a talk on unit testing in Sitecore. The focus of this talk is on the notion of testability.

Tuesday, June 14, 2016

Debugging and Creating PDBs with ReSharper

Being able to debug Sitecore code is an important skill for supporting Sitecore solutions.  There have been a number of excellent articles on how to do this, but they typically describe using JetBrains DotPeek product as a "symbol server". (See http://bilyukov.com/debugging-sitecore-dotpeek/, and https://jammykam.wordpress.com/2015/01/11/how-to-debug-sitecore-kernel-in-visual/). An alternative, which I find somewhat simpler, is to use ReSharper to generate PDB files, and place those in your solution bin directory. I will walk you through that approach in this article.

Wednesday, January 13, 2016

The Pomodoro Technique

There is a special, lonely dread that accompanies a big, complex task. Am I up to it? Is it harder than I think? Am I missing something fundamental? I wonder what's going on on Twitter. Hey, I got retweeted...

Wednesday, January 6, 2016

Properties in JavaScript

Continuing my exploration of JavaScript, with Kyle Simpson's this and Object Prototypes as my guide, I'm going to look at some of the functionality introduced with ES5 to allow greater control over the behavior of object properties, which Simpson looks at in Chapter 3 of his book.

Wednesday, December 30, 2015

Interactive Rebasing in Git

This post is a quick look at one of my favorite features in Git, interactive rebases.  I like this feature because it lets you do two conflicting things: make micro commits (like saving every couple of  minutes when editing a Word doc) so you can replay your work, and always go back to a working state of your code, and making clean, well worded, self contained commits to a project repo.  Interactive rebasing lets you squish your commits together when you are ready to share them.

Wednesday, December 23, 2015

A Look at Git Hashes

Git is a locally stored database with integrity guarantees. To get  a feel for how this works, this post takes a look at a very simple repository using the commands hash-object and cat-file. Although these are not commands you would normally use (they are among the "plumbing commands" that lie behind the "porcelain commands" like clone and commit), they are very helpful for inspecting the objects that a Git repository manages.