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.