Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 18 additions & 0 deletions workflow/content-as-code.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,24 @@ content_as_code:

To publish a draft, a developer or admin opens **Project settings** → **Content review**, picks the draft, and clicks **Write back to repo**. Lightdash opens a pull request with the draft's content; merge it and run `lightdash upload`, for example from your deploy CI job, to publish the change. **Dismiss** closes a draft without writing it back. **Content review** appears only on projects connected to GitHub or GitLab.

#### See and stop managing Git-backed content

If your saves on a chart or dashboard keep turning into drafts, it's Git-backed. To check, open its info popover: the **i** icon next to a dashboard's title, or next to **Last edited** on a chart. Git-backed content shows **Source: Repository** and the repository file it comes from.

<Frame>
![A dashboard's info popover showing Source: Repository, the note Not linked to a file in the repository, and a Stop managing from the repository link](/images/workflow/content-as-code/managed-from-repository-dashboard.png)
</Frame>

**Not linked to a file in the repository** means the content is Git-backed but no file in your repository matches it. Edits made through an AI agent or the MCP server before version 3.113.0 could leave content in this state.

To edit content directly in the UI again, a developer or admin clicks **Stop managing from the repository**, then **Release**. The content stays where it is, saves publish straight away, and open drafts on it are dismissed. If a write-back pull request is open for it, close that on your Git provider.

When the content still has a file in your repository, the popover warns you first. The next `lightdash upload` that includes the file makes it Git-backed again and replaces edits made in the UI. To stop managing it for good, delete the file from your repository. The next full upload then releases it.

<Frame>
![A chart's info popover showing its repository file, a warning that the file is still in the repository, and Release anyway and Cancel links](/images/workflow/content-as-code/managed-from-repository-release-anyway.png)
</Frame>

## `lightdash download`

From the [Lightdash CLI](/workflow/cli/reference), you can use the command `lightdash download` to download all of the charts and dashboards from your Lightdash project as code. All of the charts and dashboards will be written as .yml files to a `lightdash` directory wherever you're running the command.
Expand Down
Loading