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?

Command icon 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

pdureau created an issue. See original summary.

pdureau’s picture

Issue summary: View changes
pdureau’s picture

Issue summary: View changes

pdureau’s picture

Status: Active » Needs review

I have opened a MR with the "conventional commit" proposal, just to check the scope and start the discussion for now.

pdureau’s picture

Assigned: Unassigned » mogtofu33
pdureau’s picture

For information, #3593247: Move some entity view logic to buildable plugins is splitting "Import from Layout Builder or Manage Display configuration." in:

  • "Import from Layout Builder configuration."
  • "Import from Manage Display configuration."

We don't know yet in which order the tickets will be merged.

pdureau’s picture

Hi 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?

mogtofu33’s picture

Assigned: mogtofu33 » pdureau
Status: Needs review » Needs work

Yes please.

pdureau’s picture

Assigned: pdureau » mogtofu33
Status: Needs work » Needs review

Rebased.

  • mogtofu33 committed 5e19b1f9 on 1.0.x authored by pdureau
    task: #3592749 Consistency of revision logs messages
    
    By: pdureau
    
mogtofu33’s picture

Assigned: mogtofu33 » Unassigned
Status: Needs review » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.