Skip to content

Commit

Permalink
Docs: minor fixes to lakeFS quickstart (#6990)
Browse files Browse the repository at this point in the history
  • Loading branch information
talSofer authored Nov 14, 2023
1 parent 1790bd3 commit 5d21ec4
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 45 deletions.
Binary file removed docs/assets/img/quickstart/quickstart-repo.gif
Binary file not shown.
Binary file added docs/assets/img/quickstart/quickstart-repo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
88 changes: 44 additions & 44 deletions docs/quickstart/actions-and-hooks.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,51 +32,51 @@ _Hooks_ can be either a [Lua]({% link howto/hooks/lua.md %}) script that lakeFS
--source lakefs://quickstart/main
```

1. Open up your favorite text editor (or emacs), and paste the following YAML:

```yaml
name: Check Commit Message and Metadata
on:
pre-commit:
branches:
- etl**
hooks:
- id: check_metadata
type: lua
properties:
script: |
commit_message=action.commit.message
if commit_message and #commit_message>0 then
print("✅ The commit message exists and is not empty: " .. commit_message)
else
error("\n\n❌ A commit message must be provided")
end
job_name=action.commit.metadata["job_name"]
if job_name == nil then
error("\n❌ Commit metadata must include job_name")
else
print("✅ Commit metadata includes job_name: " .. job_name)
end
version=action.commit.metadata["version"]
if version == nil then
error("\n❌ Commit metadata must include version")
else
print("✅ Commit metadata includes version: " .. version)
if tonumber(version) then
print("✅ Commit metadata version is numeric")
else
error("\n❌ Version metadata must be numeric: " .. version)
end
end
```
1. Save this file as `/tmp/check_commit_metadata.yml`
2. Open up your favorite text editor (or emacs), and paste the following YAML:

```yaml
name: Check Commit Message and Metadata
on:
pre-commit:
branches:
- etl**
hooks:
- id: check_metadata
type: lua
properties:
script: |
commit_message=action.commit.message
if commit_message and #commit_message>0 then
print("✅ The commit message exists and is not empty: " .. commit_message)
else
error("\n\n❌ A commit message must be provided")
end
job_name=action.commit.metadata["job_name"]
if job_name == nil then
error("\n❌ Commit metadata must include job_name")
else
print("✅ Commit metadata includes job_name: " .. job_name)
end
version=action.commit.metadata["version"]
if version == nil then
error("\n❌ Commit metadata must include version")
else
print("✅ Commit metadata includes version: " .. version)
if tonumber(version) then
print("✅ Commit metadata version is numeric")
else
error("\n❌ Version metadata must be numeric: " .. version)
end
end
```
3. Save this file as `/tmp/check_commit_metadata.yml`
* You can save it elsewhere, but make sure you change the path below when uploading
1. Upload the `check_commit_metadata.yml` file to the `add_action` branch under `_lakefs_actions/`. As above, you can use the UI (make sure you select the correct branch when you do), or with `lakectl`:
4. Upload the `check_commit_metadata.yml` file to the `add_action` branch under `_lakefs_actions/`. As above, you can use the UI (make sure you select the correct branch when you do), or with `lakectl`:
```bash
docker exec lakefs \
Expand All @@ -85,13 +85,13 @@ _Hooks_ can be either a [Lua]({% link howto/hooks/lua.md %}) script that lakeFS
--source /tmp/check_commit_metadata.yml
```
1. Go to the **Uncommitted Changes** tab in the UI, and make sure that you see the new file in the path shown:
5. Go to the **Uncommitted Changes** tab in the UI, and make sure that you see the new file in the path shown:
<img width="75%" src="{{ site.baseurl }}/assets/img/quickstart/hooks-00.png" alt="lakeFS Uncommitted Changes view showing a file called `check_commit_metadata.yml` under the path `_lakefs_actions/`" class="quickstart"/>
Click **Commit Changes** and enter a suitable message to commit this new file to the branch.
1. Now we'll merge this new branch into `main`. From the **Compare** tab in the UI compare the `main` branch with `add_action` and click **Merge**
6. Now we'll merge this new branch into `main`. From the **Compare** tab in the UI compare the `main` branch with `add_action` and click **Merge**
<img width="75%" src="{{ site.baseurl }}/assets/img/quickstart/hooks-01.png" alt="lakeFS Compare view showing the difference between `main` and `add_action` branches" class="quickstart"/>
Expand Down
2 changes: 1 addition & 1 deletion docs/quickstart/branch.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,4 +131,4 @@ DESC LIMIT 5;
```
<img src="{{ site.baseurl }}/assets/img/quickstart/duckdb-main-02.png" alt="The lakeFS object browser showing DuckDB querying lakes.parquet on the main branch. The results are the same as they were before we made the changes to the denmark-lakes branch, which is as expected." class="quickstart"/>

In the next step we'll see how to merge our branch back into main.
In the next step we'll see how to commit our changes and merge our branch back into main.

0 comments on commit 5d21ec4

Please sign in to comment.