[FEATURE] Setup: add database update steps guideline.#11616
Open
thibsy wants to merge 1 commit into
Open
Conversation
afb1fea to
be4d849
Compare
Contributor
|
No objections regarding the state of the database in connection with the release update/upgrade. |
mjansenDatabay
requested changes
Jun 11, 2026
Contributor
There was a problem hiding this comment.
Hi @thibsy ,
Thank you a lot for this pull request. This guideline addresses a real gap in our documentation.
Please answer the following questions:
- Should this document replace, supersede, or complement "docs/development/database-updates.md"? The existing doc still recommends
il$COMPONENT…Stepsnaming andclasses/Setupplacement, while this guideline proposesILIAS\<Component>\Setup\Database\V<n>\.... Without an explicit relationship, developers/authorities will not know which convention applies. - For the n+2 removal rule: can you add a concrete worked example? The rule is understandable (for me) in principle, but the n / n+1 / n+2 notation is easy to misread without one.
- How should backports be handled in practice? Chapter 2 explains the branching problem well, but the operational workflow is missing (e.g. same fix in "trunk" and "release_n" → separate "V11" / "V12" classes? hotfix steps like
ilHelpDB10HotfixSteps?).
Please consider the following suggestions. You do not need to follow those, but please indicate shortly why you prefer to do otherwise:
- Cross-link to "docs/development/database-updates.md" for operational basics (
prepare(), wiring theAgent,getStatusObjective()withilDatabaseUpdateStepsMetricsCollectedObjective, using onlyilDBInterface, grouping viaObjectiveCollection). This guideline focuses on lifecycle and branching, the other document covers day-to-day implementation. - Add a minimal example for
ObjectiveWithPreconditionswhen one step class depends on another and/or decide, whether to put this bonus tip to "docs/development/database-updates.md". - Update code examples to match the real interface or point to "docs/development/database-updates.md": every
ilDatabaseUpdateStepsimplementation must implementprepare(\ilDBInterface $db): void;. TheAgentexamples should includegetStatusObjective()where applicable. - Add an explicit warning that renaming or moving an
ilDatabaseUpdateStepsclass changes its FQDN and causes the setup to treat all steps as new, with potentially dangerous re-execution on existing installations when there is no "guard" code in place. - Clarify the relationship to the legacy naming still prevalent in the codebase and whether version namespaces are the target state for new code only.
Best regards,
Michael
on behalf of the Technical Board
| - the step number (gathered from your `step_<nr>()` methods) | ||
| - the FQDN of your implementation (class that implements `\ilDatabaseUpdateSteps`) | ||
|
|
||
| **It is therecore important that the FQDN of an implementation MUST NOT change.** Otherwise update steps are considered |
Contributor
There was a problem hiding this comment.
Suggested change
| **It is therecore important that the FQDN of an implementation MUST NOT change.** Otherwise update steps are considered | |
| **It is therefore important that the FQDN of an implementation MUST NOT change.** Otherwise update steps are considered |
| sign off on code changes](../../../../docs/development/maintenance.md#authorities) and guides all ILIAS developers who | ||
| perform database updates. | ||
|
|
||
| This guide will refer to database updates as schmea updates (DDL), but it possibly applies to other operations (DML, |
Contributor
There was a problem hiding this comment.
Suggested change
| This guide will refer to database updates as schmea updates (DDL), but it possibly applies to other operations (DML, | |
| This guide will refer to database updates as schema updates (DDL), but it possibly applies to other operations (DML, |
|
|
||
| ### 2.2. Recommended Namespace Pattern | ||
|
|
||
| To implement this consistently accross all ILIAS components and prevent possibly divergent database update steps, |
Contributor
There was a problem hiding this comment.
Suggested change
| To implement this consistently accross all ILIAS components and prevent possibly divergent database update steps, | |
| To implement this consistently across all ILIAS components and prevent possibly divergent database update steps, |
| ```php | ||
| namespace ILIAS\ComponentX\Setup; | ||
|
|
||
| class AgenfOfX implements \ILIAS\Setup\Agent |
Contributor
There was a problem hiding this comment.
Suggested change
| class AgenfOfX implements \ILIAS\Setup\Agent | |
| class AgentOfX implements \ILIAS\Setup\Agent |
| ```php | ||
| namespace ILIAS\ComponentX\Setup; | ||
|
|
||
| class AgenfOfX implements \ILIAS\Setup\Agent |
Contributor
There was a problem hiding this comment.
Suggested change
| class AgenfOfX implements \ILIAS\Setup\Agent | |
| class AgentOfX implements \ILIAS\Setup\Agent |
| e.g. `ILIAS\ComponentX\Setup\Database\V10\UpdateSteps::step_2()` is completely independent from | ||
| `ILIAS\ComponentX\Setup\Database\V11\UpdateSteps::step_2()`. | ||
|
|
||
| ### 2.2. Recommended Namespace Pattern |
Contributor
There was a problem hiding this comment.
This has to be 2.1, not 2.2.
|
|
||
| Bonus tip: use an `ILIAS\Setup\ObjectiveWithPreconditions` to control the order of your `\ilDatabaseUpdateSteps`. | ||
|
|
||
| ### 3.2. Removing Database Update Steps |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi folks,
Here's my proposal for the database update steps guideline.
Please let me know what you think about my recommendations, how strictly we want to phrase adherence (currently "SHOULD") and if there are something else missing or wrong in terms of content.
@fwolf-ilias I have added you to verify my sentences about the ILIAS upgrade and release process in general.
@ILIAS-eLearning/technical-board I have added your label, since this PR was created thanks to your funding.
Kind regards,
@thibsy