Skip to content

Instantly share code, notes, and snippets.

@mikekistler
mikekistler / overlay-traits.md
Created January 28, 2025 03:27
Overlay example with Traits

This is my attempt to get the Traits overlay example working with Speakeasy's overlay tooling.

The original example is here.

Original OpenAPI

openapi: 3.1.0
info:
 title: API with a paged collection
@mikekistler
mikekistler / breaking-change-logic.md
Last active February 20, 2024 18:32
Logic for adding breaking change labels

The PR pipeline checks every PR to determine if it (potentially) introduces breaking changes or violates Azure Versioning policy.

The main tool for this is "openapi-diff" which checks two versions of an OpenAPI doc (old and new) and identifies all the "substantive changes" (changes in descriptions and such are ignored).

Our versioning policy requires that any "substantive change" be done in a new API version.

A subset of the "substantive changes" are also considered a "breaking change"

We add labels to the PR as follows:

  • IF any change is classified as breaking AND the "old" OpenAPI doc is GA (same or different than new API version)
@mikekistler
mikekistler / breaking-change-labels.md
Last active February 15, 2024 23:49
Breaking Change Labels

Proposal for new Breaking Change Labels

Update of proposal from this comment.

Breaking Changes

BreakingChangeReviewRequired

  • Added by automation when it detects a breaking change from a previous GA API version
  • Blocks merge until a "BreakingChange-Approved*" label is applied
@mikekistler
mikekistler / devbox-erd.md
Last active October 3, 2023 19:37
Entity Relationship Diagram for Microsoft DevBox

Resources / relationships for Microsoft DevBox

erDiagram
    Project { 
        string name
    }
    
    Catalog {
 string name
@mikekistler
mikekistler / mvad-train.cs
Last active May 10, 2023 04:18
Sample code to train a Multivariate Anomaly Detector model
string Train(AnomalyDetectorClient client, string dataSource, DateTimeOffset startTime, DateTimeOffset endTime, int maxTryout = 500)
{
var modelInfo = new ModelInfo(
dataSource,
startTime,
endTime);
AnomalyDetectionModel model = client.TrainMultivariateModel(modelInfo);
var modelId = model.ModelId;
@mikekistler
mikekistler / moonwalk-links.md
Last active October 17, 2024 15:10
Proposal for links in OpenAPI v4
@mikekistler
mikekistler / restler-databricks.md
Last active April 13, 2023 14:56
Running Restler on the Azure Databricks service

Restler on Databricks (control plane)

This gist will describe how I ran Restler on the Azure Databricks control plane service and the results I obtained.

Clone and build Restler

git clone https://github.com/microsoft/restler-fuzzer.git
restler_bin=~/bin/restler
mkdir -p $restler_bin
# Need --python because it can’t find “python” — I use an alias that it did not understand.
@mikekistler
mikekistler / linter.js
Created March 14, 2023 19:00
TypeSpec linter for api-version query parameter
import { createTypeSpecLibrary } from "@typespec/compiler";
import { createRule, getLinter } from "@typespec/lint";
import { isQueryParam } from "@typespec/http";
export const myLibrary = createTypeSpecLibrary({
name: "myLibrary",
diagnostics: {
"version-policy": {
severity: "error",
messages: {
@mikekistler
mikekistler / analyze_speccov.md
Last active January 26, 2023 15:55
Slicing and dicing RESTler speccov.json

This gist will show how to extract information from the RESTler speccov.json to get a quick view of what operations succeeded and failed in a RESTler run and why.

The primary tool for this is jq.

Here I will use the results of a RESTler test I ran on the Azure DataBricks service.

The test summary reported at the end of the run was: