Platform
Version control
Commits

Commits

Learn about how Knock's commit and promotion model works.

To version the content changes you make in your environments, Knock uses a commit model.

How commits work

#

When you make a change to a content resource (like a workflow or a layout) in the Knock dashboard, you need to commit it to your development environment before those changes will appear in workflows triggered via the API.

A few notes:

  • A commit is not a save. When you're drafting a workflow or a template, you can save and test your changes. Saved changes apply when you're using the test runner, but they do not apply to workflow runs or guide renders that are invoked via the API. To test changes via the API, you must commit them.
  • Account-level resources are not version controlled. Channel configurations, branding, and variables do not need to be committed, as they live at the account-level. This means that if you make a change to a channel configuration, it will update immediately on notifications sent in that environment.
  • You can commit changes using our CLI and management API. We offer both a Management API and a command line interface for interacting with Knock resources programmatically, both of which support programmatic commits.

Visualizing commit changes

#

Clicking the "Commit to development" button will show you a view of changes between your current commit and the most recent version of the resource that you're updating. Commit diffs are also available on your full commit log (viewable on the "Commits" page in your dashboard), so you can view the commit history for a resource and know exactly what was changed with each commit.

Commit diffs in Knocks version control

Promoting commits

#

Knock is designed to allow large teams to create and manage notifications at scale. That means that changes must be versioned, tested, and promoted to production environments, so that if there are any issues they can be rolled back with ease.

Knock uses a model where all changes are first made in the development environment, before being promoted to the production environment.

You can promote your commits from a given content resource's page. You can also view all commits in one place in the "Commits" page.

  1. Introduce any backend changes to support a new workflow (such as users and preference properties).

  2. Build the workflow in a development environment in Knock and commit it to that environment.

  3. Test the workflow.
  4. When you're ready to go live, promote the workflow to production.

Reverting a commit

#

If you've made a change in a commit that you want to revert, you can use the "Revert commit" feature to "undo" that change. You can find the revert commit action on the Commits page in the dashboard, under the "Unpromoted changes" and "Commit log" tabs.

Reverting a commit will:

  • Create a new commit with a message that indicates the commit reverts a preceding commit
  • Wind back the state of the resource to the change that precedes the commit
  • Undo any uncommitted changes on the resource

Because the revert will produce a new commit, you can then promote that commit to other environments to make that change live in those environments.