This is a sub-issue of #1910624: [META] Introduce and complete configuration schemas in all of core.

Problem/motivation

#1866610: Introduce Kwalify-inspired schema format for configuration introduced the idea of config schema. The changelog leads to (hopefully extensive) documentation on the format at http://drupal.org/node/1905070. While there are little cleanups planned for the format overall, the current format is a result of months of back and forths, so it should be perfectly fine to apply it more widely to core.

Proposed solution

Create a configuration schema for tour module. Note that this may be one of the trickier conversions.

Schema in place

Schema not yet in place
tour.tour.*.yml

Remaining Tasks

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

vijaycs85’s picture

Updating patch with config inspector check.
tour-config-inspector.png

P.S: May need some label update, couldn't find any label in UI though.

Gábor Hojtsy’s picture

Status: Active » Needs review

Are tips not plugin based? That is what I've seen in a quick look. That would necessitate some dynamic type definitions to support contrib tour plugins to expose other textual items, no?

Status: Needs review » Needs work
Issue tags: -Configuration system, -D8MI, -language-config, -Configuration schema

The last submitted patch, 1935094-tour-schema-cmi-1.patch, failed testing.

vijaycs85’s picture

Status: Needs work » Needs review

#1: 1935094-tour-schema-cmi-1.patch queued for re-testing.

Status: Needs review » Needs work
Issue tags: +Configuration system, +D8MI, +language-config, +Configuration schema

The last submitted patch, 1935094-tour-schema-cmi-1.patch, failed testing.

larowlan’s picture

Labels aren't used at present but will be in contrib - see #1921188: Implement Tour UI module

sidharthap’s picture

Thanks @larowlan I have checked the latest patch attached to the issue and all labels matching except Data Class and Data ID. However, they are sequence so we can not update them. so label wise latest patch looks good to me.

vijaycs85’s picture

Status: Needs work » Needs review

Changing status as per @sidharthap comment in #7

Gábor Hojtsy’s picture

#1: 1935094-tour-schema-cmi-1.patch queued for re-testing.

Gábor Hojtsy’s picture

Status: Needs review » Needs work

@larowlan: can you look at whether the schema fits the system otherwise? Also how would this work with tip plugins? To me the schema look good, although I don't see why it would fail anything. Sent for restest for this. I only found this issue:

+++ b/core/modules/tour/config/schema/tour.schema.ymlundefined
@@ -0,0 +1,56 @@
+
+
+# Tour tip with associated fields.
+
+tour_tip:
+  type: mapping
+  label: 'Tour tip'

Superfluous comment? The name and the label seems to tell it all.

nick_schuch’s picture

Status: Needs work » Needs review
FileSize
1.22 KB

I have made the change outlined in #10.

Status: Needs review » Needs work

The last submitted patch, 1935094-tour-schema-cmi-11.patch, failed testing.

nick_schuch’s picture

Status: Needs work » Needs review
FileSize
1.22 KB
427 bytes

Woops. Here we go. Added a interdiff for good measure.

Status: Needs review » Needs work
Issue tags: -Configuration system, -D8MI, -language-config, -Configuration schema

The last submitted patch, 1935094-tour-schema-cmi-13.patch, failed testing.

Gábor Hojtsy’s picture

Status: Needs work » Needs review
Issue tags: +Configuration system, +D8MI, +language-config, +Configuration schema

#13: 1935094-tour-schema-cmi-13.patch queued for re-testing.

Gábor Hojtsy’s picture

Schema looks good to me, however this still stands and needs feedback:

@larowlan: can you look at whether the schema fits the system otherwise? Also how would this work with tip plugins?

I don't believe the fails.

vijaycs85’s picture

Looks good to me except 2 minor issue:

+++ b/core/modules/tour/config/schema/tour.schema.ymlundefined
@@ -0,0 +1,53 @@
+      type: string
+      label: 'Id'

minor upper case issue - can we keep it 'ID' to align with ID in tour_tip definition?

+++ b/core/modules/tour/config/schema/tour.schema.ymlundefined
@@ -0,0 +1,53 @@
+        - type: tour_tip
+          label: 'Tour tip '
+

Minor space issue in label

Status: Needs review » Needs work
Issue tags: -Configuration system, -D8MI, -language-config, -Configuration schema

The last submitted patch, 1935094-tour-schema-cmi-13.patch, failed testing.

vijaycs85’s picture

Status: Needs work » Needs review

#13: 1935094-tour-schema-cmi-13.patch queued for re-testing.

Status: Needs review » Needs work
Issue tags: +Configuration system, +D8MI, +language-config, +Configuration schema

The last submitted patch, 1935094-tour-schema-cmi-13.patch, failed testing.

vijaycs85’s picture

I guess, this is the same issue we are facing with block schema #1948884: Create configuration schemas for block and custom_block modules. if we add schema without config those tests fails.

vijaycs85’s picture

Status: Needs work » Postponed
vijaycs85’s picture

Currently blocked by #1948884: Create configuration schemas for block and custom_block modules as test fix is part of this issue.

Gábor Hojtsy’s picture

Fix currently included with #1948884: Create configuration schemas for block and custom_block modules, waiting for commit there.

Gábor Hojtsy’s picture

Status: Postponed » Needs review

That one got committed. Can someone please respond to my question on plugins? (If we want to see this committed :).

Gábor Hojtsy’s picture

#13: 1935094-tour-schema-cmi-13.patch queued for re-testing.

larowlan’s picture

Hi Gabor
Yeah tips are plugin based.
There is text plugin in core now, image plugin (takes a url) in the tests.
There is also a multi page plugin that has three fields (title, body, url) with url for 'next page'.
So yeah - these are plugin based and contrib could add anything that implements the tip interface.
Sorry about the delay
Lee

Gábor Hojtsy’s picture

Status: Needs review » Needs work

Ok, so that means the existing proposed schema does not work since it does not have any provisions for dynamic typing (AKA plugins to be explained). In the schema tour_tip is one fixed type, no possibilities for plugins. Sounds like we need to make the type dynamic based on the plugin value in the tip data. See http://drupal.org/node/1905070#dynamic-types

Gábor Hojtsy’s picture

Issue tags: +sprint

Add on D8MI sprint for closer tracking.

vijaycs85’s picture

Status: Needs work » Needs review
Issue tags: -sprint
FileSize
702 bytes
1.23 KB

Updating patch with fix for #17 and dynamic plugin option as mentioned in #28. For now just text plugin.

vijaycs85’s picture

Issue tags: +sprint

Cross post... adding tag back...

Gábor Hojtsy’s picture

Sounds like the multipage plugin is in core and would need coverage too?

vijaycs85’s picture

Updating image plugin that @larowlan mentioned (on test file). Can't find multipage though... not sure how to find it...

nick_schuch’s picture

As discussed in IRC.

Thanks Gabor and vijaycs85

The multipage side of things is in the following issue: http://drupal.org/node/1942576

I don't believe this will result in a brand new tip type.

Gábor Hojtsy’s picture

Status: Needs review » Needs work

I believe we should be able to define a tour.tip type that defines the base properties and extend it with the two other types with more properties, right? :) That would let us centralize the base properties that both tip types extend from. Makes it easier to pin-point differences and maintain the schemas.

Gábor Hojtsy’s picture

Also the image plugin is with the tests, not in the main module, so it should be defined in a schema under the test module not in the main module.

vijaycs85’s picture

Status: Needs work » Needs review
FileSize
1.58 KB
2.04 KB

Moving tour.tip.image to tour_test.schema.yml

vijaycs85’s picture

Adding tour.tip data type and fix for an issue in tour_test.schema.yml. Because of common data type (i.e. tour.tip), the tip type specific element added at the end. example text tour tip - body field appear at the end (ref: screenshot below):

2013-04-02_184210.png

Gábor Hojtsy’s picture

My only remaining remark is the tour URI in the image schema would be "Image URL" right? Instead of just URL which is less descriptive. Otherwise looks all good to me :)

vijaycs85’s picture

Updating label fix as mentioned in #39.

Gábor Hojtsy’s picture

Status: Needs review » Reviewed & tested by the community

Looks all good to me, it supports plugins now and optimises schema definition for them :)

webchick’s picture

Status: Reviewed & tested by the community » Fixed

Committed and pushed to 8.x. Thanks!

Gábor Hojtsy’s picture

Issue tags: -sprint

Superb, thanks!

Automatically closed -- issue fixed for 2 weeks with no activity.

Anonymous’s picture

Issue summary: View changes

Updated issue summary.