Skip to content

Commit edd4d91

Browse files
issue template and pull request template (#4)
* issue template and pull request template * use datu core version * push and build tests * leech ignore * comment datu core * include site url * ignore issue link for now * start from 0.0.1 * datasource addition * fixing minor documentation issues and removing examples
1 parent dcf0d2c commit edd4d91

File tree

15 files changed

+326
-23
lines changed

15 files changed

+326
-23
lines changed
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: Documentation Update
2+
description: Suggest additions, modifications, or improvements to the documentation
3+
title: "[DOCS] "
4+
labels: ["docs", "enhancement"]
5+
assignees: []
6+
7+
body:
8+
- type: markdown
9+
attributes:
10+
value: |
11+
Thanks for helping us improve our documentation!
12+
13+
- type: dropdown
14+
id: change-type
15+
attributes:
16+
label: Type of Change
17+
description: What kind of update are you suggesting?
18+
options:
19+
- Addition (new content)
20+
- Modification (updates to existing content)
21+
- Removal (outdated or redundant content)
22+
- Other
23+
validations:
24+
required: true
25+
26+
- type: textarea
27+
id: proposed-content
28+
attributes:
29+
label: Proposed Content / Change
30+
description: Describe the content you'd like to add, modify, or remove
31+
placeholder: I think the documentation should include/update/remove...
32+
validations:
33+
required: true
34+
35+
- type: textarea
36+
id: location
37+
attributes:
38+
label: Location
39+
description: Where should this content be placed or updated in the documentation structure?
40+
placeholder: This should be added/updated in the section on...
41+
validations:
42+
required: true
43+
44+
- type: textarea
45+
id: rationale
46+
attributes:
47+
label: Rationale
48+
description: Why is this change valuable for the project documentation?
49+
placeholder: This content change would be valuable because...
50+
validations:
51+
required: true
52+
53+
- type: textarea
54+
id: content-outline
55+
attributes:
56+
label: Suggested Outline (Optional)
57+
description: If you have ideas for how the content should be structured, provide an outline
58+
placeholder: |
59+
1. Introduction
60+
2. Key concepts
61+
3. Examples
62+
validations:
63+
required: false
64+
65+
- type: textarea
66+
id: references
67+
attributes:
68+
label: References
69+
description: Include links to any reference material or examples
70+
placeholder: Related resources or examples
71+
validations:
72+
required: false

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<!-- Thank you for contributing to our documentation! -->
2+
3+
## Description
4+
<!-- Provide a clear and concise description of your changes -->
5+
6+
## Type of Change
7+
<!-- Select the type(s) of change in this PR -->
8+
- [ ] 📄 New content addition
9+
- [ ] ✏️ Content update/revision
10+
- [ ] 📚 Structure/organization improvement
11+
- [ ] 🔤 Typo/formatting fix
12+
- [ ] 🐛 Bug fix
13+
- [ ] 🔧 Tooling/config change (docs build, CI/CD, etc.)
14+
- [ ] Other (please describe):
15+
16+
## Motivation and Context
17+
<!-- Why is this change needed? What problem does it solve? -->
18+
19+
## Areas Affected
20+
<!-- List the pages/sections affected by this PR -->
21+
- e.g., `docs/getting-started.md`, `docs/configuration/`
22+
23+
## Screenshots (if applicable)
24+
<!-- Add before/after screenshots or diagrams if this helps reviewers -->
25+
26+
## Checklist
27+
<!-- Mark completed items with an [x] -->
28+
- [ ] I have read the **CONTRIBUTING** guidelines
29+
- [ ] My changes follow the project’s documentation style guide
30+
- [ ] I have previewed my changes locally (`mkdocs serve` or equivalent)
31+
- [ ] All internal/external links are valid
32+
- [ ] Images/diagrams are optimized (size, format) and display correctly
33+
- [ ] Any new references/resources are cited appropriately
34+
- [ ] All existing checks/tests pass (if applicable)
35+
36+
## Additional Notes
37+
<!-- Add any extra context or information reviewers should know -->
38+
39+
---
40+
41+
By submitting this pull request, I confirm that my contribution can be used, modified, and redistributed under the terms of this project’s license.

.github/workflows/build-deploy.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Build GitHub Pages
2+
on:
3+
push:
4+
branches:
5+
- main
6+
permissions:
7+
contents: write
8+
jobs:
9+
deploy:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
with:
14+
fetch-depth: 0
15+
token: ${{ secrets.GITHUB_TOKEN }}
16+
- name: Configure Git Credentials
17+
run: |
18+
git config user.name github-actions[bot]
19+
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
20+
- uses: actions/setup-python@v5
21+
with:
22+
python-version: 3.x
23+
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
24+
- uses: actions/cache@v4
25+
with:
26+
key: mkdocs-material-${{ env.cache_id }}
27+
path: .cache
28+
restore-keys: |
29+
mkdocs-material-
30+
- run: |
31+
pip install -r requirements.txt
32+
- run: |
33+
mike deploy --push --update-aliases 0.0.x latest
34+
mike set-default --push 0.0.x

.github/workflows/build-test.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Build and Test
2+
3+
on:
4+
pull_request:
5+
branches: [ main ]
6+
types: [ opened, synchronize, reopened, ready_for_review, review_requested, review_request_removed ]
7+
8+
schedule:
9+
- cron: "00 10 * * *" # Run at 10:00 AM every day
10+
11+
permissions: read-all
12+
13+
jobs:
14+
build:
15+
name: Build Documentation
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Checkout code
19+
uses: actions/checkout@v4
20+
- name: Install dependencies
21+
run: |
22+
pip install -r requirements.txt
23+
- name: Build docs
24+
run: |
25+
mkdocs build
26+
27+
check_links:
28+
name: Check Links
29+
runs-on: ubuntu-latest
30+
31+
steps:
32+
- uses: actions/checkout@v4
33+
- name: Restore lychee cache
34+
uses: actions/cache@v4
35+
with:
36+
path: .lycheecache
37+
key: cache-lychee-${{ github.sha }}
38+
restore-keys: cache-lychee-
39+
40+
- name: Check links with lychee
41+
id: lychee
42+
uses: lycheeverse/lychee-action@v2
43+
with:
44+
args: "--base . --cache --max-cache-age 1d ."

.lycheeignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# see examples in https://github.com/opensafely/documentation/blob/main/.lycheeignore
2+
3+
# localhost
4+
https?://locahost.*
5+
https?://127\.0\.0\.1.*
6+
.*localhost.*
7+
https://github.com/Datuanalytics/datu-core/issues*

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ reported the issue. Please try to include as much information as you can. Detail
2323
Looking at the existing issues is a great way to find something to contribute to. We label issues that are well-defined and ready for community contributions with the "ready for contribution" label.
2424

2525
Check our "Ready for Contribution" issues for items you can work on:
26-
- [SDK Python Issues](https://github.com/Datuanalytics/datu-core/issues?q=is%3Aissue%20state%3Aopen%20label%3A%22ready%20for%20contribution%22)
26+
- [Datu Core Issues](https://github.com/Datuanalytics/datu-core/issues?q=is%3Aissue%20state%3Aopen%20label%3A%22ready%20for%20contribution%22)
2727

2828
Before starting work on any issue:
2929
1. Check if someone is already assigned or working on it

docs/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Then follow next steps.
2121
Ready to learn more? Check out these resources:
2222

2323
- [Quickstart](user-guide/quickstart.md) - A more detailed introduction to Datu core
24-
- [Examples](examples/README.md) - Examples for connecting multiple datasources.
24+
- [Datasources](user-guide/datasources/datasources.md) - Connecting multiple datasources.
2525

2626
[Learn how to contribute]({{ server_repo }}/CONTRIBUTING.md) or join our community discussions to shape the future of Datu ❤️.
2727

docs/examples/README.md

Lines changed: 0 additions & 13 deletions
This file was deleted.
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# Datasources Overview
2+
3+
The directory provides a collection of configurations to help you get started with connecting data sources with Datu.
4+
## Purpose
5+
6+
With Datu, you can quickly connect to your data sources and turn raw information into actionable insights.
7+
8+
### How to add datasources
9+
10+
As per the current design the application will fetch all the schema that is listed in the profiles.yml. It is to avoid fetching the schema every single time.But it will only work on the **target** datasource that is selected.
11+
12+
**Structure of profiles.yml**
13+
14+
```sh
15+
datu_demo:
16+
target: dev-postgres # Target is used to select the datasource that is currently active. Change this if you would like to use a different datasource.
17+
outputs:
18+
dev-postgres:
19+
type: postgres
20+
{% raw %}
21+
host: "{{ env_var('DB_HOST', 'localhost') }}" # if a environment variable is supplied that gets priority. This is useful for not hardcoding.
22+
{% endraw %}
23+
port: 5432
24+
user: postgres
25+
password: postgres
26+
dbname: my_sap_bronze
27+
schema: bronze
28+
dev-sqlserver:
29+
type: sqlserver
30+
driver: 'ODBC Driver 18 for SQL Server' # Mandatory for sqlserver.
31+
host: localhost
32+
port: 1433
33+
user: sa
34+
password: Password123!
35+
dbname: my_sap_bronze
36+
schema: bronze
37+
```
38+
39+
### About profiles.yml
40+
41+
Datu core needs profiles.yml file that contains all the datasources configured. If you have used [dbt](https://github.com/dbt-labs/dbt-core),this is somewhat like to their profiles.yml though not exaclty the same.
42+
43+
```sh
44+
<profile-name>:
45+
target: <target-name> # this is the default target
46+
outputs:
47+
<target-name>:
48+
type: <postgres | sqlserver | other>
49+
schema: <schema_identifier>
50+
51+
### Look for each datasources specific variables
52+
...
53+
54+
...
55+
56+
<profile-name>: # additional profiles
57+
...
58+
59+
```
60+
61+
### env_var
62+
63+
You can use `env_var` with any attribute in the `profiles.yml` `outputs` section to load configuration values from environment variables.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
### Postgres as a datasource
2+
3+
Install datucore with extras postgres
4+
5+
```sh
6+
pip install "datu-core[postgres]"
7+
```
8+
9+
In profiles.yml
10+
11+
```sh
12+
dev-postgres:
13+
type: postgres
14+
host: [hostname]
15+
user: [username]
16+
password: [password]
17+
port: [port]
18+
dbname: [database name]
19+
schema: [schema]
20+
```

0 commit comments

Comments
 (0)