Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ VITE_STATE=
# with PROGRAMS_DIR and PROGRAMS_REF.
# PROGRAMS_DIR=../unlocked-programs
# PROGRAMS_REF=main
# Learning Record (github.com/UnlockedLabs/unlocked-learning-record) is built the
# same way, with LEARNING_RECORD_DIR and LEARNING_RECORD_REF.
# LEARNING_RECORD_DIR=../unlocked-learning-record
# LEARNING_RECORD_REF=main

# Path to the AI tutor checkout (github.com/UnlockedLabs/unlocked-hiset-ai),
# relative to this repo or absolute. Defaults to ../ai/unlocked-hiset-ai.
Expand Down
19 changes: 14 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ PROVIDER_PLATFORMS_RUN=docker compose run --rm --no-deps providerplatforms-migra
# GitHub, or your checkout in PROGRAMS_DIR.
PROGRAMS_REPO=https://github.com/UnlockedLabs/unlocked-programs.git
PROGRAMS_RUN=docker compose run --rm --no-deps programs-migrate
# Learning Record runs as its own service (EN-208), built the same way:
# LEARNING_RECORD_REF from GitHub, or your checkout in LEARNING_RECORD_DIR.
LEARNING_RECORD_REPO=https://github.com/UnlockedLabs/unlocked-learning-record.git
LEARNING_RECORD_RUN=docker compose run --rm --no-deps learning-record-migrate
# Canvas admin created on first `make canvas`. Override in the environment if
# you want different credentials. These are also what you log into Canvas with
# at localhost:3001 to mint the API token.
Expand Down Expand Up @@ -84,6 +88,7 @@ define run_dev_compose
build_source OPEN_CONTENT "Open Content" $(OPEN_CONTENT_REPO) || exit 1; \
build_source PROVIDER_PLATFORMS "Provider Platforms" $(PROVIDER_PLATFORMS_REPO) || exit 1; \
build_source PROGRAMS "Programs" $(PROGRAMS_REPO) || exit 1; \
build_source LEARNING_RECORD "Learning Record" $(LEARNING_RECORD_REPO) || exit 1; \
AI_DIR=$${TUTOR_DIR:-$$(sed -n 's/^TUTOR_DIR=//p' .env | tail -1)}; \
AI_DIR=$${AI_DIR:-$(DEFAULT_AI_DIR)}; \
TUTOR_READY=0; TUTOR_WHY=; \
Expand Down Expand Up @@ -248,25 +253,29 @@ install-dep: ascii_art
fi
docker compose down && docker volume rm -f unlockedv2_node_modules && cd frontend && yarn add $(NAME) && cd ..
$(call run_dev_compose,)
# Open Content's, Provider Platforms' and Programs' migrations roll back first,
# since they move tables that core's reset drops, and run again after it. Their
# services restart because their connections switch to the role the reset
# recreates, and Open Content's worker seeds the fresh database when it starts.
# Open Content's, Provider Platforms', Programs' and Learning Record's
# migrations roll back first, since they move tables that core's reset drops, and
# run again after it. Their services restart because their connections switch to
# the role the reset recreates, and Open Content's worker seeds the fresh
# database when it starts.
migrate-fresh: ascii_art
$(OPEN_CONTENT_RUN) migrate-reset
$(PROVIDER_PLATFORMS_RUN) migrate-reset
$(PROGRAMS_RUN) migrate-reset
$(LEARNING_RECORD_RUN) migrate-reset
go run -tags dev $(MIGRATE_MAIN) --fresh
$(OPEN_CONTENT_RUN) migrate
$(PROVIDER_PLATFORMS_RUN) migrate
$(PROGRAMS_RUN) migrate
docker compose restart open-content open-content-worker providerplatforms providerplatforms-worker programs programs-worker
$(LEARNING_RECORD_RUN) migrate
docker compose restart open-content open-content-worker providerplatforms providerplatforms-worker programs programs-worker learning-record

migrate: ascii_art
go run $(MIGRATE_MAIN)
$(OPEN_CONTENT_RUN) migrate
$(PROVIDER_PLATFORMS_RUN) migrate
$(PROGRAMS_RUN) migrate
$(LEARNING_RECORD_RUN) migrate

kolibri: ascii_art
$(call run_dev_compose,-f $(DOCKER_COMPOSE) -f $(KOLIBRI_COMPOSE))
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,12 @@ pages are still in core's frontend; the rev_proxy sends their `/api` paths to it
questions with `PROGRAMS_TOKEN`. If you run the server outside compose, `.env.example` points
`PROGRAMS_URL` at its port, 8084.

**Learning Record** ([unlocked-learning-record](https://github.com/UnlockedLabs/unlocked-learning-record))
runs as its own service the same way: `make dev` builds its `main` branch from GitHub, or your checkout when
`LEARNING_RECORD_DIR` is set (such as `../unlocked-learning-record`), or another branch with
`LEARNING_RECORD_REF`. The rev_proxy sends `/api/learning-record` to it, and it asks core who the
user is and whether `learning_record` is on. It listens on port 8085.


**NOTE:** you _must_ be sure to use `127.0.0.1` in place of `localhost` in your browser, as the cookies required for authentication are not shared between the two,
and this can cause bad states in the browser that will prevent successful login/auth flow.
Expand Down
12 changes: 1 addition & 11 deletions backend/.golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: "2"

# golangci-lint's standard linters (what CI ran before this file existed) plus
# depguard for the feature-module boundaries (EN-190). Open Content, Provider
# Platforms and Programs aren't here: they are their own services.
# Platforms, Programs and Learning Record aren't here: they are their own services.
linters:
default: standard
enable:
Expand All @@ -29,7 +29,6 @@ linters:
allow:
- github.com/UnlockedLabs/unlocked-core/backend/src/modules/module
- github.com/UnlockedLabs/unlocked-core/backend/src/modules/registry
- github.com/UnlockedLabs/unlocked-core/backend/src/modules/learningrecord/api
# The seam imports nothing from core. depguard only sees each file's
# own imports, so a core type handed to modules through the seam
# (a *database.DB, handlers.Claims) would slip past the module rules.
Expand All @@ -41,12 +40,3 @@ linters:
desc: the module seam must not expose core types to feature modules (EN-188)
allow:
- github.com/UnlockedLabs/unlocked-core/backend/src/modules/module
learningrecord:
list-mode: lax
files: ["**/src/modules/learningrecord/**"]
deny:
- pkg: github.com/UnlockedLabs/unlocked-core/backend
desc: a feature module reaches core only through src/modules/module and unlocked-contracts, and other modules only through their api package (EN-186, EN-188)
allow:
- github.com/UnlockedLabs/unlocked-core/backend/src/modules/module
- github.com/UnlockedLabs/unlocked-core/backend/src/modules/learningrecord
89 changes: 0 additions & 89 deletions backend/src/modules/learningrecord/README.md

This file was deleted.

5 changes: 0 additions & 5 deletions backend/src/modules/learningrecord/api/api.go

This file was deleted.

192 changes: 0 additions & 192 deletions backend/src/modules/learningrecord/handlers.go

This file was deleted.

Loading
Loading