You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Standardize argument patterns across openedx_content APIs
Testing
TBC
AI Usage in PRs
I used Claude Code to help me write all the PRs. I developed a plan for the entire set of 5 changes, and then had it break the plan into 5 parts, one for each commit, before having it implement everything. I've reviewed each changeset by hand and tweaked it, both using Claude and on my own. All commits which Claude was involved in have co-author credit.
Original ticket:
Problems and questions
Inconsistent usage of id, pk, uuid, slug, key throughout learning core
Confusion between usage keys and our new suite of non-usage-key "keys" (ie, PublishableEntity.key)
Lack of standard parsing functions for PublishableEntity.key
Wasted time and energy marshaling between UsageKeys and PublishableEntity.keys
Should PE keys be usage keys?
Should we delete PE UUIDs?
Original issue
Working with Learning Core's authoring api is mostly a joy, except for the inconsistent usage of the terms "id", "key", and "slug". This applies to the LC-related objects and models in opaque-keys and edx-platform, as well.
I would propose standardizing on these meanings of each term for all new content-related code, and for any existing code which is not too burdensome to change:
*_id is an integer primary key.
*_uuid is a UUID.
*_slug is a URL-friendly string which identifies something within a local scope. On the Component model, we currently call this is a "local key".
*_key is a string (or an opaque-keys object) which uniquely identifies something across a whole Open edX instance. Can be composed of slugs, or of other slug-like things like a block/component type.
For example, one change I'd like to make is:
On the model, Collection.key should be renamed Collection.slug
The corresponding field on the opaque-keys object, LibraryCollectionLoctator.collection_id should be renamed LibraryCollectionLocator.slug.
Function arguments and dataclass members should be renamed accordingly.
Development notes
PRs
The OEP:
openedx-core PRs:
keysare now opaquerefs#546openedx-platform PR:
Follow-ups
Testing
TBC
AI Usage in PRs
I used Claude Code to help me write all the PRs. I developed a plan for the entire set of 5 changes, and then had it break the plan into 5 parts, one for each commit, before having it implement everything. I've reviewed each changeset by hand and tweaked it, both using Claude and on my own. All commits which Claude was involved in have co-author credit.
Original ticket:
Problems and questions
Original issue
Working with Learning Core's authoring api is mostly a joy, except for the inconsistent usage of the terms "id", "key", and "slug". This applies to the LC-related objects and models in opaque-keys and edx-platform, as well.
I would propose standardizing on these meanings of each term for all new content-related code, and for any existing code which is not too burdensome to change:
*_idis an integer primary key.*_uuidis a UUID.*_slugis a URL-friendly string which identifies something within a local scope. On the Component model, we currently call this is a "local key".*_keyis a string (or an opaque-keys object) which uniquely identifies something across a whole Open edX instance. Can be composed of slugs, or of other slug-like things like a block/component type.For example, one change I'd like to make is:
Collection.keyshould be renamedCollection.slugLibraryCollectionLoctator.collection_idshould be renamedLibraryCollectionLocator.slug.