Data types and the Common Data Model

A data type is a specific kind of data, defined by the values it can contain and how those are accessed. For example, an Integer is a Scalar data type that can hold a whole number and an Object is a data type that has named fields with their own data types and values.

CloudBees SDM uses several kinds of GraphQL data types, including Object, Scalar, Enum, and Interface, to define the CloudBees SDM Common Data Model.

  • An Object represents an item of data that has fields, each each of these fields has its own data type.

  • A Scalar is a simple value like a String, Integer, or URL.

  • An Enum is a type with a fixed list of values, for example you might have an Object with a status field that can be either SUCCESS or FAILURE.

  • The Interface types define the CloudBees SDM Common Data Model.

An Interface represents an abstraction, a way to treat data types in a generic way. For example, you might be using Jira and GitHub for issue tracking, and you want to define a policy or a report that treats issues in a generic way. You want a report that includes all of your tickets, not just the ones in Jira. That’s why CloudBees SDM defines an Issue interface, which defines the fields that all issues must provide.

Common Data Model and benefits

The Common Data Model is a set of interfaces that represent the common data types that exist in SDLC systems. For example:

  • Issues and IssueComments exist in issue tracking systems like Jira

  • Build and Job exist in CI and CD systems like Jenkins

  • Repositories and Pull Request exist in source control management (SCM) systems like GitHub

When you write a query for a report or policy, you should use interfaces when you want to report across all of the different "brands" of SDLC systems that you use. For example, you want to write a policy that alerts you when pull requests are stale in any of your SCMs whether they are Git, GitHub, or others.

Additional information about types

Behind the scenes of CloudBees SDM, data types are defined by a GraphQL schema. These notions of Objects, Scalars, Enums, and Interfaces are all defined by GraphQL. To learn more about how GraphQL types and schemas work, please refer to the GraphQL documentation (https://graphql.org/learn/schema/).

Refer to reports and policies for more information about these features.