Skip to content

Commit

Permalink
Merge pull request #51 from openedx/cag/pr-preview-docs
Browse files Browse the repository at this point in the history
chore: add dbt-coverage report
  • Loading branch information
Cristhian Garcia authored Mar 7, 2024
2 parents 0b42bb7 + 2015355 commit 016ae37
Show file tree
Hide file tree
Showing 13 changed files with 467 additions and 3 deletions.
9 changes: 9 additions & 0 deletions .ci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
CLICKHOUSE_ADMIN_PASSWORD: ch_password
CLICKHOUSE_ADMIN_USER: ch_admin
CLICKHOUSE_SECURE_CONNECTION: false
LANGUAGE_CODE: en
LMS_HOST: local.edly.io
PLATFORM_NAME: Aspects Local CI Test
PLUGINS:
- aspects
DOCKER_IMAGE_OPENEDX: edunext/openedx-aspects:0.80.0
16 changes: 14 additions & 2 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,16 @@ on:
push:
branches:
- main
pull_request:
branches:
- main

env:
DBT_PROFILES_DIR: ./.github/
CLICKHOUSE_DB: "xapi"
CLICKHOUSE_USER: "ch_admin"
CLICKHOUSE_PASSWORD: "ch_password"
TUTOR_ROOT: ./.ci/

jobs:
build:
Expand All @@ -32,15 +36,23 @@ jobs:
python-version: "3.8.x"
- name: Install dependencies
run: |
pip install tutor-contrib-aspects
pip install -r requirements.txt
dbt deps
- name: Run Clickhouse
- name: Initialize Open edX
run: |
docker compose up -d
tutor plugins enable aspects
tutor config save
tutor local start -d
tutor local do init
tutor local do load-xapi-test-data
- name: Build docs
run: |
dbt run
dbt docs generate
dbt-coverage compute doc --cov-fail-under 0.9
- name: Deploy
if: github.event_name == 'push'
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.SEMANTIC_RELEASE_GITHUB_TOKEN }}
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@
target/
dbt_packages/
logs/
coverage.json

3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
format:
sqlfmt models macros

coverage:
dbt-coverage compute doc --cov-fail-under 0.9
35 changes: 35 additions & 0 deletions models/base/schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,22 @@ models:
columns:
- name: org
data_type: String
description: "The organization that the course belongs to"
- name: course_key
data_type: String
description: "The course key for the course"
- name: course_name
data_type: String
description: "The name of the course"
- name: course_run
data_type: String
description: "The course run for the course"
- name: block_id
data_type: String
description: "The block's unique identifier"
- name: block_name
data_type: String
description: "The block's name"
- name: section_number
data_type: string
description: "The section this block belongs to, formatted as <section location>:0:0"
Expand All @@ -30,6 +36,35 @@ models:
description: "The block's display name with section, subsection, and unit prepended to the name. This provides additional context when looking at block names and can help data consumers understand which block they are analyzing"
- name: graded
data_type: Boolean
description: "Whether the block is graded"
- name: block_type
data_type: String
description: "The type of block. This can be a section, subsection, unit, or the block type"

- name: xapi_events_all_parsed
description: "A materialized view for xAPI events"
columns:
- name: event_id
data_type: uuid
description: "The unique identifier for the event"
- name: verb_id
data_type: string
description: "The xAPI verb identifier"
- name: actor_id
data_type: string
description: "The xAPI actor identifier"
- name: object_id
data_type: string
description: "The xAPI object identifier"
- name: course_id
data_type: string
description: "The course identifier"
- name: org
data_type: string
description: "The organization that the course belongs to"
- name: emission_time
data_type: datetime64(6)
description: "The time the event was emitted"
- name: event
data_type: string
description: "The xAPI event as a string"
35 changes: 35 additions & 0 deletions models/completion/schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,59 @@ models:
data_type: DateTime64(3)
- name: org
data_type: String
description: "The organization that the course belongs to"
- name: course_key
data_type: String
description: "The course key for the course"
- name: course_name
data_type: String
description: "The name of the course"
- name: course_run
data_type: String
description: "The course run for the course"
- name: entity_id
description: "The block ID or course key for the graded entity"
data_type: String
- name: entity_name
data_type: String
description: "The name of the graded entity (course or block)"
- name: entity_name_with_location
data_type: Nullable(String)
description: "The entity's display name with section, subsection, and unit prepended to the name. This provides additional context when looking at block names and can help data consumers understand which block they are analyzing"
- name: actor_id
data_type: String
description: "The xAPI actor identifier"
- name: scaled_progress
description: "A ratio between 0 and 1, inclusive, of the learner's progress"
data_type: Float32
- name: completion_bucket
description: "A displayable value of progress sorted into 10% buckets. Useful for grouping progress together to show high-level learner performance"
data_type: String

- name: completion_events
description: "A materialized view for xAPI events related to course completions"
columns:
- name: event_id
data_type: uuid
description: "The unique identifier for the event"
- name: emission_time
data_type: datetime
description: "The time the event was emitted"
- name: actor_id
data_type: string
description: "The xAPI actor identifier"
- name: object_id
data_type: string
description: "The xAPI object identifier"
- name: course_key
data_type: string
description: "The course identifier"
- name: org
data_type: string
description: "The organization that the course belongs to"
- name: verb_id
data_type: string
description: "The xAPI verb identifier"
- name: progress_percent
data_type: string
description: "The percentage of the xAPI object completed"
38 changes: 37 additions & 1 deletion models/enrollment/schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,57 @@ models:
description: "A record for each enrollment event"
columns:
- name: emission_time
description: "Timestamp, to the second, of when this event was emitted"
data_type: DateTime
description: "Timestamp, to the second, of when this event was emitted"
- name: org
data_type: String
description: "The organization that the course belongs to"
- name: course_key
data_type: String
description: "The course key for the course"
- name: course_name
data_type: String
description: "The name of the course"
- name: course_run
data_type: String
description: "The course run for the course"
- name: actor_id
data_type: String
description: "The xAPI actor identifier"
- name: enrollment_mode
data_type: LowCardinality(String)
description: "The mode of enrollment"
- name: enrollment_status
description: "Whether a learner is actively enrolled in a course"
tests:
- accepted_values:
values: ["registered", "unregistered"]
data_type: String

- name: enrollment_events
description: "A materialized view for xAPI events related to course enrollment"
columns:
- name: event_id
data_type: uuid
description: "The unique identifier for the event"
- name: emission_time
data_type: datetime
description: "The time the event was emitted"
- name: actor_id
data_type: string
description: "The xAPI actor identifier"
- name: object_id
data_type: string
description: "The xAPI object identifier"
- name: course_key
data_type: string
description: "The course identifier"
- name: org
data_type: string
description: "The organization that the course belongs to"
- name: verb_id
data_type: string
description: "The xAPI verb identifier"
- name: enrollment_mode
data_type: string
description: "The mode of enrollment"
34 changes: 34 additions & 0 deletions models/forum/schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,53 @@ models:
columns:
- name: event_id
data_type: UUID
description: "The unique identifier for the event"
- name: emission_time
data_type: DateTime64(3)
description: "Timestamp, to the second, of when this event was emitted"
- name: org
data_type: String
description: "The organization that the course belongs to"
- name: course_key
data_type: String
description: "The course key for the course"
- name: course_name
data_type: String
description: "The name of the course"
- name: course_run
data_type: String
description: "The course run for the course"
- name: object_id
data_type: String
description: "The xAPI object identifier"
- name: actor_id
data_type: String
description: "The xAPI actor identifier"
- name: verb_id
data_type: LowCardinality(String)
description: "The xAPI verb identifier"

- name: forum_events
description: ""
columns:
- name: event_id
data_type: uuid
description: "The unique identifier for the event"
- name: emission_time
data_type: datetime
description: "The time the event was emitted"
- name: org
data_type: string
description: "The organization that the course belongs to"
- name: course_key
data_type: string
description: "The course identifier"
- name: object_id
data_type: string
description: "The xAPI object identifier"
- name: actor_id
data_type: string
description: "The xAPI actor identifier"
- name: verb_id
data_type: string
description: "The xAPI verb identifier"
Loading

0 comments on commit 016ae37

Please sign in to comment.