Skip to content

Commit

Permalink
Merge pull request #109 from DataRecce/doc/getting_statrted/first_time
Browse files Browse the repository at this point in the history
add first time guide in get-started
  • Loading branch information
ijac13 authored Oct 1, 2024
2 parents b2101fd + c8c4e98 commit 48bf981
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 17 deletions.
25 changes: 17 additions & 8 deletions docs/docs/get-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ icon: material/rocket-launch-outline
# Getting Started

## Prerequisites

`Recce` requires that your dbt project has two [environments](https://docs.getdbt.com/docs/environments-in-dbt) to compare. For example, one for production and another for development.
Recce requires that your dbt project has two [environments](https://docs.getdbt.com/docs/environments-in-dbt) to compare. For example, one for production and another for development.

Prepare two targets with separate [schemas](https://docs.getdbt.com/docs/core/connect-data-platform/connection-profiles#understanding-target-schemas) in your dbt profile. Your `profiles.yml` might look something like this:

Expand All @@ -25,14 +24,14 @@ jaffle_shop:
schema: main
```
## Install `Recce`
## Install Recce
Install Recce using `pip`:
```shell
pip install -U recce
```

## Use `Recce` in your dbt project
## Use Recce in your dbt project

The following instructions give an overview of the process of using Recce in your dbt project. For a hands-on tutorial, please check the [Jaffle Shop Tutorial](./get-started-jaffle-shop.md).

Expand All @@ -44,7 +43,7 @@ cd your-dbt-project/

### Prepare dbt artifacts

`Recce` expects two sets of dbt [artifacts](https://docs.getdbt.com/reference/artifacts/dbt-artifacts) to be present:
Recce expects two sets of dbt [artifacts](https://docs.getdbt.com/reference/artifacts/dbt-artifacts) to be present:

- `target-base/` - dbt artifacts for to be used as the base for the comparison e.g. production
- `target/` - dbt artifacts for your development branch
Expand All @@ -70,8 +69,8 @@ dbt docs generate
```


## Start the `Recce` server
Start the `Recce` server with the follow command:
## Start the Recce server
Start the Recce server with the follow command:

```shell
recce server
Expand All @@ -86,4 +85,14 @@ Recce use dbt [artifacts](https://docs.getdbt.com/reference/artifacts/dbt-artifa

!!! tip

The regeneration of the `catalog.json` file is not required after every `dbt run`. it is only required to regenerate this file when models or columns are added or updated.
The regeneration of the `catalog.json` file is not required after every `dbt run`. it is only required to regenerate this file when models or columns are added or updated.

## First Time Guide for Recce instance
After you start the Recce server, you can see the Recce instance, the Web UI of the active Recce server.

Here are the 3 steps to use Recce: (see the image below)

1. Click the model you want to check
1. Click “Explore Change”
1. Click “Add to Checklist”
![first time guide of Recce instance](../assets/images/onboarding/material.svg){: .shadow}
18 changes: 9 additions & 9 deletions docs/docs/recce-cloud/getting-started-recce-cloud.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ icon: material/school
dbt_modules/
logs/
```
1. Remove the existing github action workflow.
1. Remove the existing github action workflow.
```
rm -rf .github/
```
Expand Down Expand Up @@ -140,28 +140,28 @@ As a PR author, you can prepare the recce review state and persist it in the rec
```

1. Create a pull request for this branch in your github repository.
1. Prepare a [github token](https://github.com/settings/tokens) in your account. You have to provide the `repo` permission.
2. Prepare a [github token](https://github.com/settings/tokens) in your account. You have to provide the `repo` permission.
![alt text](../../assets/images/recce-cloud/github-token.png)
1. Ensure you have configured these environment variables.
3. Ensure you have configured these environment variables.
```shell
export GITHUB_TOKEN=<github-token>
export RECCE_STATE_PASSWORD=mypassword
```
1. Run Recce instance in the cloud mode
4. Run Recce instance in the cloud mode
```
recce server --cloud
```
Open the link http://0.0.0.0:8000
1. Switch to the **Query** tab, add this query
5. Switch to the **Query** tab, add this query
```sql
select * from {{ ref("orders") }} order by 1
```
Add the primary key `order_id` and click the `Run Diff` button
![alt text](../../assets/images/recce-cloud/query-diff.png){: .shadow}
1. Click the `+` button to add the query result to checklist
1. You can find that there are three checks in the **Checks** page
1. Terminate the Recce instance. It would store the state to the recce cloud.
1. In the GitHub PR page, we can find a failed check for this PR. This is because not all checks are approved.
6. Click the `+` button to add the query result to checklist
7. You can find that there are three checks in the **Checks** page
8. Terminate the Recce instance. It would store the state to the recce cloud.
9. In the GitHub PR page, we can find a failed check for this PR. This is because not all checks are approved.
![alt text](../../assets/images/recce-cloud/pr-checks-wo-approved.png){: .shadow}

## Review the PR
Expand Down

0 comments on commit 48bf981

Please sign in to comment.