Skip to main content

Module publishing

Module publishing 

Source
Expand description

Publishing a changeset to the live course.

Structs§

Authors 🔒
Who the history of each published entity is attributed to: the changeset’s owner, through the latest call that staged the entity.
PublishContext 🔒
What writing a changeset’s staged entities uses besides the entities.
PublishOptions
How a publish may proceed. The publisher is always the changeset’s owner, which the caller checks.
Publishable 🔒
A changeset that may be published: its staged rows and the bases they were staged on.
Refusal 🔒
Why publishing stops before writing anything.
StagedWrites 🔒
The staged entities of a changeset by what publishing does with them.

Enums§

PublishOutcome
PublishRejection
Why a publish was refused. Nothing was written.
WriteStop 🔒
Why writing the staged entities stopped.

Constants§

LOCK_ORDER 🔒
The order publishing locks the live rows of entity kinds in. Every publish uses it, so two publishes never deadlock on each other.

Functions§

afters 🔒
check_publishable 🔒
Locks what the changeset writes and checks that it may be published: no conflicts, no risk the publisher hasn’t reviewed, no exercise services the publisher may not add. The risk reasons it classifies again are stored, not put in the returned rows.
delete_removed 🔒
Deletes the entities the changeset removes: chapters with their pages first, then the other pages, then modules, so that nothing still points at what is deleted next.
embed_staged_settings 🔒
Embeds the texts the changeset’s staged course settings add or change; see TextEmbeddings.
entity_ref 🔒
exercises_switched_to_own_review_config 🔒
The staged exercises that switch from the course default review config to their own.
lock_live_rows 🔒
Locks the live rows of the staged entities until the transaction ends, so that nothing changes them between the conflict check and the writes.
move_block_references 🔒
Points feedback and edit proposals at the page their blocks moved to.
publish
Publishes an open changeset: writes every staged entity in one transaction, through the module and chapter writers, the CMS page save and the course save paths, and marks the changeset published.
saved 🔒
result of saving entity, with a save path’s refusal of what was staged as PublishRejection::SaveFailed.
with_course_default_copies 🔒
The staged page with the exercises in switched given a new copy of course_default, keeping the config id and review instructions staged: staging copied the default as it was then.
write_staged 🔒
Writes the staged entities in an order where nothing points at what doesn’t exist yet, records their history and returns the redirects created from changed page paths.
written 🔒
The staged snapshots of kind T, each with its base.