diff --git a/images/workflow/content-as-code/managed-from-repository-dashboard.png b/images/workflow/content-as-code/managed-from-repository-dashboard.png new file mode 100644 index 000000000..b1f155831 Binary files /dev/null and b/images/workflow/content-as-code/managed-from-repository-dashboard.png differ diff --git a/images/workflow/content-as-code/managed-from-repository-release-anyway.png b/images/workflow/content-as-code/managed-from-repository-release-anyway.png new file mode 100644 index 000000000..88cda49ad Binary files /dev/null and b/images/workflow/content-as-code/managed-from-repository-release-anyway.png differ diff --git a/workflow/content-as-code.mdx b/workflow/content-as-code.mdx index 23948c9c5..9e13e67da 100644 --- a/workflow/content-as-code.mdx +++ b/workflow/content-as-code.mdx @@ -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. + + + ![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) + + +**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. + + + ![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) + + ## `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.