Skip to content

Latest commit

 

History

History
865 lines (727 loc) · 21 KB

File metadata and controls

865 lines (727 loc) · 21 KB

Upgrading to v0.4.0

In version v0.4.0 we have added our own implementation of generating language types from Buildkite's Pipeline Schema. That means some of the types have been renamed or in some cases changed shape to adhere 1:1 with the schema.

Below you will find a list of the breaking changes in each language.

TypeScript

Pipeline

  • notify no longer accepts an Enum and now accepts a defined Union of strings. You will need to update all Enum values to their respective string.

Block Step

  • blocked_state is no longer an Enum and is defined as a Union of strings. You will need to update all Enum values to their respective string.

Command Step

  • concurrency_method is no longer an Enum and is defined as a Union of strings. You will need to update all Enum values to their respective string.
  • notify no longer accepts an Enum and now accepts a defined Union of strings. You will need to update all Enum values to their respective string.
  • retry.automatic.signal_reason is no longer an Enum and is defined as a Union of strings. You will need to update all Enum values to their respective string.

Group Step

  • notify no longer accepts an Enum and now accepts a defined Union of strings. You will need to update all Enum values to their respective string.

Python

We have implemented Pydantic for our types alongside our TypedDict types.

Pipeline

  • The names of the underlying types of the notify field have changed to adhere to how they are named in the pipeline schema. You will need to update the names of your constructors.

Block Step

  • blocked_state is no longer defined as an Enum and is now defined as a Literal of strings. You will need to update all Enum values to their respective string.

Command Step

  • concurrency_method is no longer an Enum and is defined as a Union of strings. You will need to update all Enum values to their respective string.
  • The names of the underlying types of the notify field have changed to adhere to how they are named in the pipeline schema. You will need to update the names of your constructors.
  • retry.automatic.signal_reason is no longer an Enum and is defined as a Union of strings. You will need to update all Enum values to their respective string.

Group Step

  • The names of the underlying types of the notify field have changed to adhere to how they are named in the pipeline schema. You will need to update the names of your constructors.

Go

Block Step

  • AllowDependencyFailure is no longer a bool and is now a struct. Example usage:
// Boolean
step := buildkite.BlockStep{
  AllowDependencyFailure: &buildkite.AllowDependencyFailure{
      Bool: buildkite.Value(true),
  }
}

// String
step := buildkite.BlockStep{
  AllowDependencyFailure: &buildkite.AllowDependencyFailure{
      String: buildkite.Value("true"),
  }
}
  • BlockedState is no longer a struct and is now a map, and has been renamed. For example, BlockedState.Failed can be updated to either BlockStepBlockedStateValues["failed"] or BlockStepBlockedState("failed").
  • Branches is no longer a []string and is a now a struct named Branches Example usage:
step := buildkite.BlockStep{
  Branches: &buildkite.Branches{
      String: buildkite.Value("one"),
  }
}

listValues := []string{"one","two"}
step := buildkite.BlockStep{
  Branches: &buildkite.Branches{
      StringArray: listValues,
  }
}
  • DependsOn is no longer an interface and is now a struct. Example usage:
singleValue := "step"
step := buildkite.BlockStep{
  DependsOn: &buildkite.DependsOn{
      String: buildkite.Value("step"),
  }
}

step := buildkite.BlockStep{
  DependsOn: []buildkite.DependsOnListItem{
      {String: buildkite.Value("one")},
      {
          DependsOnList: &buildkite.DependsOnListObject{
              Step: buildkite.Value("two"),
          },
      }
  }
}
  • Fields is no longer defined as an interface and is now defined as a struct. Example usage:
step := buildkite.BlockStep{
  Fields: []buildkite.FieldsItem{
      // Text Field
      {
          TextField: &buildkite.TextField{
  			Default: buildkite.Value("default"),
  			Format:  buildkite.Value("format"),
  			Hint:    buildkite.Value("hint"),
  			Key:     buildkite.Value("key"),
  			Required: &buildkite.TextFieldRequired{
  				String: buildkite.Value("true"),
  			},
  			Text: buildkite.Value("text"),
  		},
      },
      // Select Field
      {
          SelectField: &buildkite.SelectField{
              Default: &buildkite.SelectFieldDefault{
                  String: buildkite.Value("default"),
              },
              Hint:   buildkite.Value("hint"),
              Key:    buildkite.Value("key"),
              Select: buildkite.Value("select"),
              Multiple: &buildkite.SelectFieldMultiple{
                  Bool: buildkite.Value(true),
              },
              Required: &buildkite.SelectFieldRequired{
                  Bool: buildkite.Value(true),
              },
              Options: []buildkite.SelectFieldOption{
                  {Value: buildkite.Value("optionValue")},
              },
          }
      },
  },
}

Command Step

  • Agents is no longer defined as a map[string]interface{} and is now defined as a struct. Example usage:
// List
step := buildkite.CommandStep{
  Agents: &buildkite.Agents{
      AgentsList: buildkite.Value([]string{"one","two"})
  }
}

// Object
step := buildkite.CommandStep{
  Agents: &buildkite.Agents{
      AgentsObject: buildkite.Value(map[string]interface{}{
  		"one": "two",
  	})
  }
}
  • AllowDependencyFailure is no longer a bool and is now a struct. Example usage:
// Boolean
step := buildkite.CommandStep{
  AllowDependencyFailure: &buildkite.AllowDependencyFailure{
      Bool: buildkite.Value(true),
  }
}

// String
step := buildkite.CommandStep{
  AllowDependencyFailure: &buildkite.AllowDependencyFailure{
      String: buildkite.Value("true"),
  }
}
  • ArtifactPaths is no longer defined as []string and is now a struct named CommandStepArtifactPaths. Example usage:
// String
step := buildkite.CommandStep{
  ArtifactPaths: &buildkite.CommandStepArtifactPaths{
      String: buildkite.Value("path"),
  },
}

// StringArray
step := buildkite.CommandStep{
  ArtifactPaths: &buildkite.CommandStepArtifactPaths{
      StringArray: []string{"one","two"},
  },
}
  • Branches is no longer a []string and is a now a struct named Branches Example usage:
step := buildkite.CommandStep{
  Branches: &buildkite.Branches{
      String: buildkite.Value("one"),
  }
}

listValues := []string{"one","two"}
step := buildkite.CommandStep{
  Branches: &buildkite.Branches{
      StringArray: listValues,
  }
}
  • Cache is no longer defined as an interface and is now defined as a struct. Example usage:
// String
step := buildkite.CommandStep{
    Cache: &buildkite.Cache{
        String: buildkite.Value("path"),
    },
}

// String Array
step := buildkite.CommandStep{
    Cache: &buildkite.Cache{
        StringArray: []string{"one","two"},
    },
}

// Object
step := buildkite.CommandStep{
    Cache: &buildkite.Cache{
        Cache: &buildkite.CacheObject{
            Paths: []string{"one", "two"},
  		  Size:  buildkite.Value("size"),
  		  Name:  buildkite.Value("name"),
        },
    },
}
  • CancelOnBuildFailing is no longer a bool and is now a struct. Example usage:
// Bool
step := buildkite.CommandStep{
  CancelOnBuildFailing: &buildkite.CancelOnBuildFailing{
      Bool: buildkite.Value(true),
  }
}

// String
step := buildkite.CommandStep{
  CancelOnBuildFailing: &buildkite.CancelOnBuildFailing{
      String: buildkite.Value("true"),
  }
}
  • Command is no longer a string and is now a struct named CommandStepCommand. Example usage:
// String
step := buildkite.CommandStep{
  Command: &buildkite.CommandStepCommand{
      String: buildkite.Value("run.sh"),
  }
}

// String Array
step := buildkite.CommandStep{
  Command: &buildkite.CommandStepCommand{
      StringArray: []string{"one","two"},
  }
}
  • Commands is no longer a string and is now a struct named CommandStepCommand. Example usage:
// String
step := buildkite.CommandStep{
  Commands: &buildkite.CommandStepCommand{
      String: buildkite.Value("run.sh"),
  }
}

// String Array
step := buildkite.CommandStep{
  Commands: &buildkite.CommandStepCommand{
      StringArray: []string{"one","two"},
  }
}
  • Concurrency is no longer an int64 and is now an int.
  • ConcurrencyMethod's type has been renamed to CommandStepConcurrencyMethod.
  • DependsOn is no longer an interface and is now a struct. Example usage:
singleValue := "step"
step := buildkite.CommandStep{
  DependsOn: &buildkite.DependsOn{
      String: buildkite.Value("step"),
  }
}

step := buildkite.CommandStep{
  DependsOn: []buildkite.DependsOnListItem{
      {String: buildkite.Value("one")},
      {
          DependsOnList: &buildkite.DependsOnListObject{
              Step: buildkite.Value("two"),
          },
      }
  }
}
  • Matrix is no longer an interface and is now a struct named Matrix. Example usage:
// List
step := buildkite.CommandStep{
  Matrix: &buildkite.Matrix{
      MatrixElementList: buildkite.Value(buildkite.MatrixElementList{
  	   {
  	       String: buildkite.Value("value"),
  	   },
          {
              Bool: buildkite.Value(true),
          },
          {
              Int: buildkite.Value(1),
          },
  	}),
  },
}

// Object
step := buildkite.CommandStep{
  Matrix: &buildkite.Matrix{
      MatrixObject: &buildkite.MatrixObject{
          Setup: &buildkite.MatrixSetup{
              MatrixSetup: buildkite.Value(map[string][]buildkite.MatrixElement{
                  "foo": {
                      {
                          String: buildkite.Value("bar"),
                      },
                      {
                          Bool: buildkite.Value(true),
                      },
                      {
                          Int: buildkite.Value(1),
                      },
                  },
              }),
          },
      },
  },
}
  • Notify is no longer an interface and is now CommandStepNotify. You will need to update any notify blocks with the new types. Example usage:
step := buildkite.CommandStep{
    Notify: &buildkite.CommandStepNotify{
        {
            NotifySlack: &buildkite.NotifySlack{
                Slack: &buildkite.NotifySlackSlack{
                    String: buildkite.Value("#channel"),
                },
            },
        },
    },
}
  • Parallelism is no longer an int64 and is now an int.
  • Plugins is no longer a map[string]interface{} and is now a struct. Example usage:
step := buildkite.CommandStep{
  Plugins: &buildkite.Plugins{
      PluginsList: &buildkite.PluginsList{
          {
              PluginsList: &buildkite.PluginsListObject{
                  "docker": map[string]interface{}{
                      "foo": "bar",
                  },
              },
          },
      },
  },
}
  • Priority is no longer an int64 and is now an int.
  • Retry is no longer an interface and is now a struct named CommandStepRetry. Example usage:
// Automatic
step := buildkite.CommandStep{
  Retry: &buildkite.CommandStepRetry{
      Automatic: &buildkite.CommandStepAutomaticRetry{
          AutomaticRetryList: buildkite.Value([]buildkite.AutomaticRetry{
  		{
  	          Limit: buildkite.Value(1),
  		},
  	   }),
      },
  },
}
  • Signature's type has been renamed to CommandStepSignature. Example usage:
step := buildkite.CommandStep{
  Signature: &buildkite.CommandStepSignature{
      Algorithm: buildkite.Value("algo"),
      SignedFields: []string{"one","two"},
      Value: buildkite.Value("value"),
  },
}
  • SoftFail is no longer an interface and is now a struct named SoftFail. Example usage:
// Simple
step := buildkite.CommandStep{
  SoftFail: &buildkite.SoftFail{
      SoftFailEnum: &buildkite.SoftFailEnum{
          Bool: buildkite.Value(true),
      },
  },
}

// List
step := buildkite.CommandStep{
  SoftFail: &buildkite.SoftFail{
      SoftFailList: []buildkite.SoftFailObject{
  		{
  			ExitStatus: &buildkite.SoftFailObjectExitStatus{
  				Int: buildkite.Value(1),
  			},
  		},
  	},
  },
}
  • TimeoutInMinutes is no longer an int64 and is now an int.

Group Step

  • AllowDependencyFailure is no longer a bool and is now a struct named. Example usage:
// Boolean
step := buildkite.GroupStep{
  AllowDependencyFailure: &buildkite.AllowDependencyFailure{
      Bool: buildkite.Value(true),
  }
}

// String
step := buildkite.GroupStep{
  AllowDependencyFailure: &buildkite.AllowDependencyFailure{
      String: buildkite.Value("true"),
  }
}
  • DependsOn is no longer an interface and is now a struct. Example usage:
singleValue := "step"
step := buildkite.GroupStep{
  DependsOn: &buildkite.DependsOn{
      String: buildkite.Value("step"),
  }
}

step := buildkite.GroupStep{
  DependsOn: []buildkite.DependsOnListItem{
      {String: buildkite.Value("one")},
      {
          DependsOnList: &buildkite.DependsOnListObject{
              Step: buildkite.Value("two"),
          },
      }
  }
}
  • Notify is no longer an interface and is now BuildNotify. You will need to update any notify blocks with the new types. Example usage:
step := buildkite.GroupStep{
    Notify: &buildkite.BuildNotify{
        {
            NotifySlack: &buildkite.NotifySlack{
                Slack: &buildkite.NotifySlackSlack{
                    String: buildkite.Value("#channel"),
                },
            },
        },
    },
}
  • Skip is no longer a bool and is now a struct named Skip. Example usage:
// Bool
step := buildkite.GroupStep{
  Skip: &buildkite.Skip{
      Bool: buildkite.Value(true),
  }
}

// String
step := buildkite.GroupStep{
  Skip: &buildkite.Skip{
      String: buildkite.Value("true"),
  }
}
  • Steps is no longer defined as a slice of interfaces and now is a slice of structs. Example usage:
steps := buildkite.GroupStep{
  Steps: &buildkite.GroupSteps{
      {
          CommandStep: &buildkite.CommandStep{
              Command: &buildkite.CommandStepCommand{
                  String: buildkite.Value("command.sh"),
              },
          },
      },
  },
}

Input Step

  • AllowDependencyFailure is no longer a bool and is now a struct named. Example usage:
// Boolean
step := buildkite.InputStep{
  AllowDependencyFailure: &buildkite.AllowDependencyFailure{
      Bool: buildkite.Value(true),
  }
}

// String
step := buildkite.InputStep{
  AllowDependencyFailure: &buildkite.AllowDependencyFailure{
      String: buildkite.Value("true"),
  }
}
  • Branches is no longer a []string and is now a struct named Branches. Example usage:
step := buildkite.InputStep{
  Branches: &buildkite.Branches{
      String: buildkite.Value("one"),
  }
}

listValues := []string{"one","two"}
step := buildkite.InputStep{
  Branches: &buildkite.Branches{
      StringArray: listValues,
  }
}
  • BlockedState is no longer a struct and is now a map, and has been renamed. For example, BlockedState.Failed can be updated to either InputStepBlockedStateValues["failed"] or InputStepBlockedState("failed").
  • DependsOn is no longer an interface and is now a struct. Example usage:
singleValue := "step"
step := buildkite.InputStep{
  DependsOn: &buildkite.DependsOn{
      String: buildkite.Value("step"),
  }
}

step := buildkite.InputStep{
  DependsOn: []buildkite.DependsOnListItem{
      {String: buildkite.Value("one")},
      {
          DependsOnList: &buildkite.DependsOnListObject{
              Step: buildkite.Value("two"),
          },
      }
  }
}
  • Fields is no longer defined as an interface and is now defined as a struct. Example usage:
step := buildkite.InputStep{
  Fields: []buildkite.FieldsItem{
      // Text Field
      {
          TextField: &buildkite.TextField{
  			Default: buildkite.Value("default"),
  			Format:  buildkite.Value("format"),
  			Hint:    buildkite.Value("hint"),
  			Key:     buildkite.Value("key"),
  			Required: &buildkite.TextFieldRequired{
  				String: buildkite.Value("true"),
  			},
  			Text: buildkite.Value("text"),
  		},
      },
      // Select Field
      {
          SelectField: &buildkite.SelectField{
              Default: &buildkite.SelectFieldDefault{
                  String: buildkite.Value("default"),
              },
              Hint:   buildkite.Value("hint"),
              Key:    buildkite.Value("key"),
              Select: buildkite.Value("select"),
              Multiple: &buildkite.SelectFieldMultiple{
                  Bool: buildkite.Value(true),
              },
              Required: &buildkite.SelectFieldRequired{
                  Bool: buildkite.Value(true),
              },
              Options: []buildkite.SelectFieldOption{
                  {Value: buildkite.Value("optionValue")},
              },
          }
      },
  },
}

Trigger Step

  • AllowDependencyFailure is no longer a bool and is now a struct. Example usage:
// Boolean
step := buildkite.TriggerStep{
  AllowDependencyFailure: &buildkite.AllowDependencyFailure{
      Bool: buildkite.Value(true),
  }
}

// String
step := buildkite.TriggerStep{
  AllowDependencyFailure: &buildkite.AllowDependencyFailure{
      String: buildkite.Value("true"),
  }
}
  • Async is no longer a bool and is now a struct named TriggerStepAsync. Example usage:
// Boolean
step := buildkite.TriggerStep{
  Async: &buildkite.TriggerStepAsync{
      Bool: buildkite.Value(true),
  }
}

// String
step := buildkite.TriggerStep{
  Async: &buildkite.TriggerStepAsync{
      String: buildkite.Value("true"),
  }
}
  • Branches is no longer a []string and is a now a struct name Branches Example usage:
step := buildkite.TriggerStep{
  Branches: &buildkite.Branches{
      String: buildkite.Value("one"),
  }
}

listValues := []string{"one","two"}
step := buildkite.TriggerStep{
  Branches: &buildkite.Branches{
      StringArray: listValues,
  }
}
  • The type for Build has been renamed from Build to TriggerStepBuild.
  • DependsOn is no longer an interface and is now a struct. Example usage:
step := buildkite.TriggerStep{
  DependsOn: &buildkite.DependsOn{
      String: buildkite.Value("step"),
  }
}

step := buildkite.TriggerStep{
  DependsOn: []buildkite.DependsOnListItem{
      {String: buildkite.Value("one")},
      {
          DependsOnList: &buildkite.DependsOnListObject{
              Step: buildkite.Value("two"),
          },
      }
  }
}
  • Skip is no longer a bool and is now a struct named Skip. Example usage:
// Bool
step := buildkite.TriggerStep{
  Skip: &buildkite.Skip{
      Bool: buildkite.Value(true),
  }
}

// String
step := buildkite.TriggerStep{
  Skip: &buildkite.Skip{
      String: buildkite.Value("true"),
  }
}
  • SoftFail is no longer an interface and is now a struct. Example usage:
// Simple
step := buildkite.TriggerStep{
  SoftFail: &buildkite.SoftFail{
      SoftFailEnum: &buildkite.SoftFailEnum{
          Bool: buildkite.Value(true),
      },
  },
}

// List
step := buildkite.TriggerStep{
  SoftFail: &buildkite.SoftFail{
      SoftFailList: []buildkite.SoftFailObject{
  		{
  			ExitStatus: &buildkite.SoftFailObjectExitStatus{
  				Int: buildkite.Value(1),
  			},
  		},
  	},
  },
}

Wait Step

  • AllowDependencyFailure is no longer a bool and is now a struct named. Example usage:
// Boolean
step := buildkite.WaitStep{
  AllowDependencyFailure: &buildkite.AllowDependencyFailure{
      Bool: buildkite.Value(true),
  }
}

// String
step := buildkite.WaitStep{
  AllowDependencyFailure: &buildkite.AllowDependencyFailure{
      String: buildkite.Value("true"),
  }
}
  • Branches is no longer a []string and is a now a struct name Branches Example usage:
step := buildkite.WaitStep{
  Branches: &buildkite.Branches{
      String: buildkite.Value("one"),
  }
}

listValues := []string{"one","two"}
step := buildkite.WaitStep{
  Branches: &buildkite.Branches{
      StringArray: listValues,
  }
}
  • ContinueOnFailure is no longer a bool and is not a struct named WaitStepContinueOnFailure. Example usage:
// Bool
step := buildkite.WaitStep{
  ContinueOnFailure: &buildkite.WaitStepContinueOnFailure{
      Bool: buildkite.Value(true),
  },
}

// String
step := buildkite.WaitStep{
  ContinueOnFailure: &buildkite.WaitStepContinueOnFailure{
      String: buildkite.Value("true"),
  },
}
  • DependsOn is no longer an interface and is now a struct. Example usage:
step := buildkite.WaitStep{
  DependsOn: &buildkite.DependsOn{
      String: buildkite.Value("step"),
  }
}

step := buildkite.WaitStep{
  DependsOn: []buildkite.DependsOnListItem{
      {String: buildkite.Value("one")},
      {
          DependsOnList: &buildkite.DependsOnListObject{
              Step: buildkite.Value("two"),
          },
      }
  }
}

Ruby

No breaking changes.