This document provides step-by-step instructions for upgrading between versions of lif-core when breaking changes are introduced.
Breaking changes are modifications that require action from users to maintain compatibility. This includes:
- Database schema changes that require migrations
- API endpoint changes (removed, renamed, or modified parameters)
- Configuration format changes
- Dependency version requirements
- Changes to expected input/output formats
- Identify your current version
- Read all migration sections between your current version and target version
- Follow the steps in order
- Test thoroughly in a non-production environment first
-
Action Required: a local docker-compose MariaDB volume keeps the old schema, because
02-ddl.sqlonly runs on an empty datadir. Either recreate the volumes (docker compose -f deployments/advisor-demo-docker/docker-compose.yml down -v) or apply the change in place, which keeps existing rows and is safe to re-run:ALTER TABLE identity_mappings MODIFY lif_organization_id VARCHAR(191) NOT NULL, MODIFY lif_organization_person_id VARCHAR(191) NOT NULL, MODIFY target_system_id VARCHAR(191) NOT NULL, DROP INDEX IF EXISTS idx_org_person;
dev and demo need nothing: their MariaDB datadir is ephemeral, so every task start replays the new DDL.
-
Impact: a mapping whose
lif_organization_id,lif_organization_person_idortarget_system_idis longer than 191 characters is now rejected (previously 255). No value in the repo's sample data is longer than 22. -
Related: #1258, CHANGELOG.md "Changed",
docs/design/components/identity-mapper.md
- Action Required: callers of the GraphQL API must read the
errorsentry in the response to detect a backend failure. Code that treats an empty list as the only possible "no results" outcome keeps working; code that relied on a failure also arriving as an empty list will now seedatanull for the queried field plus anerrorsentry. - Impact: any GraphQL consumer. In this repo that is the semantic search MCP server (via
graphql_client) and thelif-to-lifadapter, which already checkserrorsand will now raise when an upstream org's planner fails instead of contributing empty fragments. Learner Data Export is unaffected — it calls the Query Planner directly. - Related: #1264, CHANGELOG.md "Changed",
bases/lif/api_graphql/README.md→ Error contract
- Action Required:
- Set
MDR__AUTH__JWT_SECRET_KEYto a strong secret. It previously defaulted tochange4, and MDR now refuses to start without it. Local docker-compose won't even parse without it: copy the value line fromdeployments/advisor-demo-docker/.env.exampleinto your.env. In AWS it comes from/{env}/mdr-api/MdrAuthJwtSecretKey. No script creates it; seedocs/operations/guides/auth-configuration.md→ Creating secrets without a script. - Make sure no signing secret (
SECRET_KEYfor the Advisor,MDR__AUTH__JWT_SECRET_KEYfor MDR) is a value published in this repo (changeme,changeme1–6,change4,replace, …). Those now stop the service at import, with an error naming the variable. - Set
API_TOKENfor the Example Data Source API. An unset token now stops it at startup, instead of making it reject every request. - Set each
MDR__AUTH__SERVICE_API_KEY__*that a caller in your deployment uses. Thechangeme1–6code defaults are gone, and an unset key is simply not accepted (a startup warning names it). Local compose still supplies thechangeme*values. In AWS,scripts/setup-mdr-api-keys.sh <env> --applywrites each server key and its client copy. - Run the read-only SSM check in
docs/operations/guides/auth-configuration.mdfor each environment before deploying.
- Set
- Impact:
- MDR rejects an unknown
X-API-Keywith 401, even if a valid Bearer token is also sent. It previously fell through to the Bearer token. - Response changes:
- MDR with no credentials:
{"detail": "Missing or invalid credentials"}(wasAuthentication required: …). - Advisor with a missing token: 401 instead of 403.
- MDR with no credentials:
- Code importing
lif.api_key_auth,lif.api_token_auth,lif.cognito_auth,lif.auth.core, or MDR'screate_access_token/create_refresh_token/decode_jwt/AuthMiddlewaremust move tolif.auth(middleware, strategies) andlif.auth.jwt(JwtConfig,mint_access,mint_refresh,verify). MDR bases uselif.mdr_auth.add_mdr_auth(app).
- MDR rejects an unknown
- Related: #548, CHANGELOG.md "Changed" / "Removed" / "Security", ADR 0007
(
docs/design/adr/general/0007-single-auth-brick-with-provider-adapters.md),docs/operations/guides/auth-configuration.md
- Action Required: a mapping group file exported before this change can no longer be imported
from the Mappings tab. Export the group again from its source install (the export now writes a
portable
.lif-mdr-mapping-group.jsonfile), or post the old file to the deprecatedPOST /transformation_groups/{id}/importroute, which still accepts it. - Impact: the Mappings tab's group import and export use
/portable/mapping_groups. The old import dialog, including its "report missing paths" option, is removed. An imported group arrives inactive, at the version in its file. - Related: #1408,
docs/specs/mdr-portable-file-format.md
- Deprecated:
GET /import_export/export/{data_model_id},GET /import_export/export/multiple/,POST /import_export/import/,POST /import_export/clone/,GET /transformation_groups/{id}/exportandPOST /transformation_groups/{id}/import. They are marked deprecated in OpenAPI and still work; no removal date is set. - Replacement:
GET/POST /portable/models,/portable/mapping_groupsand/portable/crosswalks, which exchange portable files (docs/specs/mdr-portable-file-format.md)./import_export/clone/has no portable equivalent: re-importing a model's own file into the same install is refused asMODEL_EXISTS. - Related: #1408
Breaking Changes:
- Description of breaking change
- Action Required: Step-by-step migration instructions
- Impact: Who is affected and how
- Related: Link to CHANGELOG.md entry, relevant issue, or documentation
Example:
Breaking Changes:
- Action Required:
- Run migration script:
python scripts/migrate.py --version 1.2.0 - Update any code that inserts users to include
user_roleparameter
- Run migration script:
- Impact: All deployments with existing user data
- Related: CHANGELOG.md, Issue #123
- Action Required:
- Update all client code to use
/v2/learnerinstead - Note:
/v2/learnerreturns data in a different format (see API docs)
- Update all client code to use
- Impact: Any external systems calling the v1 endpoint
- Related: API Documentation
- Action Required:
- Rename
LIF_DB_HOST→LIF_DATABASE_HOST - Rename
LIF_DB_PORT→LIF_DATABASE_PORT - Update all deployment configurations and docker-compose files
- Rename
- Impact: All deployment configurations
- Related: Configuration Guide
If you encounter issues during migration:
- Check the CHANGELOG.md for additional context
- Review relevant documentation in the /docs directory
- Search existing GitHub Discussions
- Open a new discussion with the
migrationlabel if applicable - Search existing GitHub Issues
- Open a new issue with the
migrationlabel if needed