Problem/Motivation
Our revision logs messages are not consistent.
Initialization messages (set by Buildable plugins) are nominal sentences (no conjugated verb) and all end with a dot:
- Copy from Entity View Display configuration.
- Import from Layout Builder override.
- Initialization from existing content.
- Import from Layout Builder or Manage Display configuration.
- Initialization from existing Entity View Display configuration.
- Import from Block Layout configuration.
- Initialization from existing Page Layout configuration.
- Initialization from default configuration.
- Initialization from existing View configuration.
- Initialization of the display builder.
Tree manipulation messages (set by the Instance entity) are passive, past participle, sentences and don't finish with a dot:
- @label moved to root
- @label moved to slot @slot_id in @parent_label
- @label attached to root
- @label attached to slot @slot_id in @parent_label
- @label updated config
- @label settings updated by @island_id
- @label removed from @parent_label
before
"@label updated config" is grammatically wrong. It was "%source has been updated" until recently, an active, past conjugated, sentence.
The recent #3572328: Always prefer imported view display over saved state additions is also a passive, past participle, sentence:
- Synced from configuration import.
Proposed resolution
We need to find a style, a voice, any voice, the most important being the consistency.
Proposal 1: Drupal
Do we take Drupal Core dblog has an example? Core mixes passive, past participle, sentences and active, past conjugated, sentences:
$ grep -r "\->notice(" . | grep pdated
./locale/locale.bulk.inc: $logger->notice('Translations imported: %number added, %update updated, %delete removed.',
./locale/locale.bulk.inc: \Drupal::logger('locale')->notice('The configuration was successfully updated. %number configuration objects updated.
./locale/locale.module: $logger->notice('Updated JavaScript translation file for the language %language.',
./workspaces/src/Form/WorkspaceForm.php: $logger->notice('@type: updated %info.', $context);
./menu_ui/src/MenuForm.php: $this->logger('menu')->notice('Menu %label has been updated.',
./taxonomy/src/VocabularyForm.php: $this->logger('taxonomy')->notice('Updated vocabulary %name.',
./block_content/src/BlockContentTypeForm.php: $logger->notice('Block type %label has been updated.',
./comment/src/CommentTypeForm.php: $this->logger->notice('Comment type %label has been updated.',
./rest/src/Plugin/rest/resource/EntityResource.php: $this->logger->notice('Updated entity %type with ID %id.', [
./language/src/Form/LanguageEditForm.php: ->notice('The %language (%langcode) language has been updated.', [
./contact/src/ContactFormEditForm.php: $this->logger('contact')->notice('Contact form %label has been updated.',
But maybe there is a guideline somewhere, not strictly followed by modules.
Proposal 1: Conventional commits
The direct, present tense, style of conventional commits can add some dynamism to the logs:
feat!: send an email to the customer when a product is shipped
feat!: drop support for Node 6
docs: correct spelling of CHANGELOG
feat(lang): add Polish language
fix: prevent racing of requests
Apply to our messages, it could look like this (sentence case not final dots):
Copy display from Entity View Display configuration
Import display from Layout Builder override
Initialize display from existing content
Move @label to root
Move @label to slot @slot_id in @parent_label
Attach @label to root
Update @label configuration
Synchronize display from imported configuration
Something else?
Do we have UX study we can take inspiration from?
Issue fork display_builder-3592749
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
pdureau commentedComment #3
pdureau commentedComment #5
pdureau commentedI have opened a MR with the "conventional commit" proposal, just to check the scope and start the discussion for now.
Comment #6
pdureau commentedComment #7
pdureau commentedFor information, #3593247: Move some entity view logic to buildable plugins is splitting "Import from Layout Builder or Manage Display configuration." in:
We don't know yet in which order the tickets will be merged.
Comment #8
pdureau commentedHi Jean,
#3593247: Move some entity view logic to buildable plugins is merged .Do you want me to rebase the current MR and update the new log messages?
Comment #9
mogtofu33 commentedYes please.
Comment #10
pdureau commentedRebased.
Comment #12
mogtofu33 commented