# The LookML Development Workflow

The development lifecycle follows a strict path from branch creation to production deployment. This process ensures your changes are validated and tested before they affect your production dashboards.

#### 1. Navigate to Analytics Development

To begin, navigate to the Analytics Development section via the gear icon.&#x20;

<figure><img src="https://410725593-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FamTMWiPne1v1V3L7mbuj%2Fuploads%2FUyjQ9bHPhp178dwGnTSF%2Fimage.png?alt=media&#x26;token=991ce9d0-d4dd-4903-968b-914036cf5a25" alt=""><figcaption></figcaption></figure>

#### 2. Initialize Development Mode

Click the **Enable development mode** button to activate your staging environment.

<figure><img src="https://410725593-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FamTMWiPne1v1V3L7mbuj%2Fuploads%2F3sov1fWeCJ3benOSrzwz%2Funknown.png?alt=media&#x26;token=1965c7ed-74f7-4c3c-bd71-2a431b6222eb" alt=""><figcaption></figcaption></figure>

<figure><img src="https://410725593-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FamTMWiPne1v1V3L7mbuj%2Fuploads%2FjYRu9CKGH8eS9FtXZex3%2Fimage.png?alt=media&#x26;token=79d1e75f-3823-4b74-ba3f-17630566f525" alt=""><figcaption><p>Once enabled, a <strong>Dev mode enabled</strong> badge will appear in the top navigation bar of the Daasity app. You can hover over this badge at any time to verify which account and Git branch you are currently working on.</p></figcaption></figure>

<figure><img src="https://410725593-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FamTMWiPne1v1V3L7mbuj%2Fuploads%2FnZC1035dU9EYnTnIAAhZ%2Funknown.png?alt=media&#x26;token=1c96ec5b-8317-468a-9782-ee368fb572a3" alt=""><figcaption><p>The Analytics Development UI will display a new section which includes all the development actions the user will perform during the development lifecycle: Select a branch to work on (default selection will be your personal branch) with a link to open GitHub with the current session branch, Validate the selected current session branch, Deploy current session branch to production (master branch), and Reset a current session branch to production (master branch).</p></figcaption></figure>

#### 3. Select Your Development Branch

In the "Code Development" section, click the drop-down menu next to the "Current Branch"

<figure><img src="https://410725593-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FamTMWiPne1v1V3L7mbuj%2Fuploads%2Fc0Xtur8cgDCLpCegYkw5%2Funknown.png?alt=media&#x26;token=116ff384-a822-451c-b9bd-8eb7974c1195" alt=""><figcaption></figcaption></figure>

{% hint style="warning" %}
Before validating or testing, you must ensure Daasity is looking at the correct Git branch. Use the Branch dropdown to select the branch where you pushed your code changes. By default, this is usually your personal developer branch.&#x20;
{% endhint %}

#### 4. Modify and Sync Code (External)

{% hint style="danger" %}
Daasity does not have an in-app code editor. All LookML modifications must be performed externally in GitHub.
{% endhint %}

A) Modify Code: Scroll to the Looker Code Repository section and click the Looker Repository URL. This opens your "Merchant Spoke" project in GitHub.

B) Sync: You must Commit and Push your changes in GitHub to the same branch you selected in Step 3.\ <br>

<figure><img src="https://410725593-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FamTMWiPne1v1V3L7mbuj%2Fuploads%2FZSWoMvGUhIb9l03jzmqG%2Fimage.png?alt=media&#x26;token=bb28985d-91f4-4858-ac9f-a437d0d65eb6" alt=""><figcaption></figcaption></figure>

#### 4. Validate LookML

After pushing your code changes to GitHub, return to Daasity and click **Validate LookML**.&#x20;

<figure><img src="https://410725593-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FamTMWiPne1v1V3L7mbuj%2Fuploads%2FMDNdLiwRzXlLLM2timYC%2Funknown.png?alt=media&#x26;token=b7742430-5e6a-46cb-b3ba-ec15a617b282" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
When the user performs the **Validate LookML** action, a background job runs to validate the LookML of the current branch. The system will check for syntax errors. This may take up to 6 minutes to complete.

While a validation action is running, the app UI will:

* disable the **Validate LookML** action until it is complete
* disable the Push to Production action until it is complete
* automatically update when the refresh is complete
  {% endhint %}

{% hint style="warning" %}
A branch may not be pushed to production (merged to master) unless it has been validated and the validation results are clean, i.e. results do not have any errors / warnings.&#x20;
{% endhint %}

The UI will also display the last set of validation results. The possible statuses are:

* not validated
* no errors
* some errors / warnings

See examples below:

<figure><img src="https://410725593-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FamTMWiPne1v1V3L7mbuj%2Fuploads%2F70PljpGjt59M78kbAdyH%2Funknown.png?alt=media&#x26;token=7385b37c-d81d-4092-b07e-d9a7feb7a4b0" alt=""><figcaption><p>An example of the current branch that has not been validated.</p></figcaption></figure>

<figure><img src="https://410725593-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FamTMWiPne1v1V3L7mbuj%2Fuploads%2FNwWundVVZbU3ApnGAue0%2Funknown.png?alt=media&#x26;token=ccfd38be-dcd9-4ffe-9152-6e6486082f28" alt=""><figcaption><p>In this example the branch has errors and warnings.</p></figcaption></figure>

<figure><img src="https://410725593-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FamTMWiPne1v1V3L7mbuj%2Fuploads%2Fsbjg3D0sQdBHsEFjVrud%2Funknown.png?alt=media&#x26;token=1399e4f4-8f85-4be6-8aa4-0ed036898b39" alt=""><figcaption><p>An example of the validation completion without any errors. In this example the branch is the same as production, so the option to Push to Production is disabled.</p></figcaption></figure>

<figure><img src="https://410725593-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FamTMWiPne1v1V3L7mbuj%2Fuploads%2FBqDfRH5vNhNKgyHz7Cxg%2Funknown.png?alt=media&#x26;token=f122fa26-dd12-4d21-adf8-ef91f4d94807" alt=""><figcaption><p>An example of a branch without any errors and is different from production. You will notice the option to Reset to Master is available and that the Push to Production is enabled as well.</p></figcaption></figure>

#### 5. Test in the Development UI

Before going live, navigate to the Explore section. You will see a Development Data Models tab. This is your staging environment where you can run queries against your new models.&#x20;

<figure><img src="https://410725593-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FamTMWiPne1v1V3L7mbuj%2Fuploads%2FHcWlcqmLArySErsnXVtJ%2Fimage.png?alt=media&#x26;token=f6b471a4-33de-4436-afeb-9c5bc766304b" alt=""><figcaption></figcaption></figure>

<figure><img src="https://410725593-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FamTMWiPne1v1V3L7mbuj%2Fuploads%2F0LSwTJZZCxtcWufgdIiM%2Funknown.png?alt=media&#x26;token=0427c594-ef2f-4872-bfad-a13fb1849626" alt=""><figcaption></figcaption></figure>

#### 6. Push to Production

Once validated and tested, return to the Analytics Development page and click **Push to Production**. This merges your changes into the `master` branch, making them live for all users.

<figure><img src="https://410725593-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FamTMWiPne1v1V3L7mbuj%2Fuploads%2FMgUB3TD7facfePzkRrp0%2Fimage.png?alt=media&#x26;token=6e5433a7-cf77-4d39-aa74-142c00ab2d6e" alt=""><figcaption></figcaption></figure>

After pushing to Production, the models you built and tested in development will now appear there as shown below.

<figure><img src="https://410725593-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FamTMWiPne1v1V3L7mbuj%2Fuploads%2FYEfQqqusx1JU6YLtBYNl%2Funknown.png?alt=media&#x26;token=ea4bd129-a0c2-41a8-a7dc-fc7cd24dd578" alt=""><figcaption></figcaption></figure>
