Environments and Packages
What environments, packages and drafts are, what an environment holds, environment roles, how environments differ from workspaces, and common ways to organize them (by department, by stage, or both)
An environment is where data models are built and published in Credible. It holds the connections to your data, the packages built on them, and the roles that decide who can use, build in and administer it.
What an Environment Holds
An organization contains one or more environments. Each environment holds:
- Connections: managed links to your databases, warehouses and cloud storage. Every package in the environment can use them. See Connect Data.
- Packages: data models, with the reports and data apps built on them.
- Access: who can use, build in and administer the environment.
Organization admins create environments. In older versions of the API and CLI, an environment was called a project; the CLI still accepts project but prints a deprecation warning.
Organization
├── Environment: analytics
│ ├── Connections
│ │ └── warehouse
│ └── Packages
│ └── sales-model
│ ├── 1.2.3
│ └── 1.2.4 (latest)
└── Workspaces
└── read published packagesPackages
A package is the unit you build, version and publish together: a data model and everything built on it, such as dashboards, notebooks and data apps. Changes start in a draft, a working copy that isn't served to anyone until it's published. Each publish creates a new version, and the latest version is what everyone gets by default.
A package lives in one environment and uses that environment's connections. The environment's roles decide who can edit drafts and who can publish. See Publishing and Versions for promoting, rolling back and archiving versions.
Drafts
A draft is a working copy of a package. The agent writes into a draft, you preview queries against it, and nothing in it is served to anyone until you publish. Publishing a draft creates a new version of the package. To change a published package, start a new draft from its latest version. In a git-backed environment, publishing a draft opens a pull request instead.
A draft belongs to the workspace it was started in, and members of that workspace can see it. Changing it takes the Admin or Modeler role on the environment it publishes to.
Connections and Credentials
An environment admin enters a connection's credentials. After that:
- Modelers never see them. Modelers use the environment's connections in their models without seeing the credentials, and nothing is stored on their machines.
- Queries run through Credible. Queries from the app, an agent, an API call or a local
credsession run through Credible, never directly from a user to your database.
Environment Roles
Access to an environment is granted to users or groups with one of three roles. A role applies to every package in the environment. Organization admins are Admins of every environment.
| Role | What it allows |
|---|---|
| Admin | Everything a Modeler can do, plus managing connections, changing or deleting the environment, and granting access to it. |
| Modeler | Creating, publishing, sharing and deleting packages, and using the environment's connections in models, without seeing connection settings or credentials. |
| Viewer | Querying published packages, for example in workspaces or over MCP. |
Admins and Modelers can also share a single package without granting a role on the whole environment, with a specific person or group or with everyone in the organization. Organization roles, groups and package sharing are covered in Users and Groups and Permissions.
Environments vs. Workspaces
An environment is where models are built and published. A workspace is where people use them: it brings together the packages a team needs, with its chats and reports. One package can be in many workspaces, and one workspace can hold packages from several environments. See Workspaces vs. Environments.
Ways to Organize Environments
An environment is a boundary for connections and access. Three common patterns are below, and they can be combined. Start with the boundary that matters most and add a second only when a team needs it: each environment is one more set of connections and roles to maintain. Within one environment you can hold many packages that share its connections, and use versions to manage releases.
By department or team
Each department or team gets an environment with the connections and packages it owns.
Organization: acme-corp
├── Environment: finance
│ ├── Connection: finance-warehouse
│ └── Packages: gl-model, revenue-model
├── Environment: revops
│ ├── Connection: revops-warehouse
│ └── Packages: pipeline-model, quota-model
└── Environment: hr
├── Connection: hr-warehouse
└── Packages: headcount-modelUse this when departments own separate data, when access should follow team lines (grant each team a role on its own environment, and its connections stay out of other teams' reach), and when teams publish on their own schedules.
By stage
Separate environments for development, staging and production, each with connections to the matching database. Optionally, give a developer a private environment to work in without affecting shared ones.
Organization: acme-corp
├── Environment: analytics-dev
│ ├── Connection: snowflake (dev database)
│ └── Package: sales-model 1.3.0
├── Environment: analytics-staging
│ ├── Connection: snowflake (staging database)
│ └── Package: sales-model 1.3.0
└── Environment: analytics-prod
├── Connection: snowflake (production database)
└── Package: sales-model 1.2.0Use this when each stage has its own database, or when you want to test a model against non-production data before people rely on it. A change is published to analytics-dev, checked, then published to the next environment in turn. The connection names should match across environments so the same model files work in each.
By department and stage
Each department gets its own set of stage environments.
Organization: acme-corp
├── Environment: finance-dev
├── Environment: finance-prod
├── Environment: revops-dev
└── Environment: revops-prodUse this when several departments each own their data and also need separate development and production, and each wants to release without coordinating with the others.