Skip to content
This repository was archived by the owner on Nov 19, 2024. It is now read-only.

Conversation

diazwatson
Copy link
Contributor

@diazwatson diazwatson commented Feb 4, 2020

@diazwatson diazwatson requested a review from rogyar February 4, 2020 00:52
@diazwatson diazwatson changed the title #3361 New Configuration Type Topic [WIP] #3361 New Configuration Type Topic Feb 4, 2020
@devops-devdocs
Copy link
Collaborator

An admin must run tests on this PR before it can be merged.

1 similar comment
@devops-devdocs
Copy link
Collaborator

An admin must run tests on this PR before it can be merged.

@diazwatson
Copy link
Contributor Author

diazwatson commented Feb 4, 2020

@rogyar
1.

I'm not sure how you were able to create an exact copy of the existing guide :)

Apologies for the mess with branches and PRs, It turned out that my previous PR was extremely out of date, that is how I managed to create an exact copy of the existing guide :)

I believe I have solved the issue by creating everything from scratch.

It would be great if we leave a reference in this topic to the following topic so developers will know where to go for the detailed information.

There is already a reference to the config config-create.html
Do you see a way that can be improved?

Then, the following topic describes the general idea of the configuration file merge.
It would be awesome if we could have a few sentences about how to see (debug) the merged configuration. So, the question is if a developer wants to verify that a custom configuration is present in the merged config, what he is going to do?

I am working on a custom config myself, as soon as I have it working I will be able to provide an example for a developer who wants to verify that a custom configuration is present in the merged config.

@diazwatson
Copy link
Contributor Author

Hi @rogyar based on my findings while working on a custom config I have recreated the whole page with what I believe is a more mean-full and straight forward explanation of how to extend and create custom configuration files.

Could you please review my changes?

@rogyar
Copy link
Contributor

rogyar commented Feb 6, 2020

Hi @diazwatson. Awesome, thank you for the update. And for providing the reference

@rogyar rogyar added Major Update Significant original updates to existing content Special achievement High-value contributions that earn higher rewards and special attention labels Feb 6, 2020
@diazwatson
Copy link
Contributor Author

Hey BOT why you assign this PR to me? 🤔

@diazwatson diazwatson requested a review from jcalcaben February 7, 2020 09:06
@diazwatson
Copy link
Contributor Author

@jcalcaben @rogyar guys is there any other way you see this topic can be improved?

If other modules have a `search.xml` file, they are merged with your file when it loads.

To create a new configuration type, extend the `\Magento\Framework\Config\ReaderInterface`, which is [Magento\Framework\Config\Reader\Filesystem]({{ site.mage2bloburl }}/{{ page.guide_version }}/lib/internal/Magento/Framework/Config/Reader/Filesystem.php) to provide the following parameters:
4. Define a reader by extending [Magento\Framework\Config\Reader\Filesystem]({{ site.mage2bloburl }}/{{ page.guide_version }}/lib/internal/Magento/Framework/Config/Reader/Filesystem.php) class to provide the following parameters:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @diazwatson. The only doubtful point that is left is why we have removed the description of all parameters accepted by the ReaderInterface? below. We are still referencing these params here (above)

to provide the following parameters:

But then goes an example and no parameter description anymore.

And thank you for providing the detailed info!

Copy link
Contributor Author

@diazwatson diazwatson Feb 10, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @rogyar, thanks for taking the time to review this.

I removed that intentionally because I think the original text is misleading and a bit confusing.

For instance, it used to say

developers should extend an interface
but we all know an interface should be implemented no extended.

Then it said that developers should provide

all these parameters
but in reality if all we need is to create a custom file and we are going to extend \Magento\Framework\Config\Reader\Filesystem (rather than implement the interface) we only need to rewrite the protected attribute $_idAttributes to map the nodes in the xml file.

As a proof, we can see the Reader in the core used as an example:

Model/Order/Pdf/Config/Reader.php

In this reader, only $_idAttributes has been modified to provide a mapping for the xml file nodes.

In this PR I am still mentioning the Interface for those who want to create their own version of the reader.

I have change the paragraphs a bit trying to make this more clear.

Please let me know what you think

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It makes sense. Thank you

@dobooth
Copy link
Contributor

dobooth commented Feb 11, 2020

Our bots can be aggressive sometimes...

@dobooth dobooth added the xx2.3.3 Magento 2.3.3 changes label Feb 11, 2020
Copy link
Contributor

@rogyar rogyar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From a technical perspective, I'm approving this one. Thank you @diazwatson for providing such extended information.

@diazwatson
Copy link
Contributor Author

Thank you guys for your help with this @rogyar @dobooth @atwixfirster

@diazwatson diazwatson changed the title [WIP] #3361 New Configuration Type Topic #3361 New Configuration Type Topic Feb 12, 2020
@dobooth
Copy link
Contributor

dobooth commented Feb 13, 2020

running tests

Copy link
Contributor

@dobooth dobooth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple link errors. `

  • internally linking to /guides/v2.3/guides/v2.3/config-guide/config/config-files.html#config-files-load-merge-merge, which does not exist
    • _site/guides/v2.3/config-guide/config/config-create.html (line 430)
      a href="/guides/v2.3/guides/v2.3/config-guide/config/config-files.html#config-files-load-merge-merge">Configuration file merge
  • linking to internal hash #config-files-load-merge-merge that does not exist
    • _site/guides/v2.3/config-guide/config/config-create.html (line 430)
      a href="/guides/v2.3/guides/v2.3/config-guide/config/config-files.html#config-files-load-merge-merge">Configuration file merge`

@diazwatson
Copy link
Contributor Author

Working on it...

@diazwatson diazwatson requested a review from dobooth February 13, 2020 22:20
@diazwatson
Copy link
Contributor Author

Done
@dobooth could you please review?

Is there a way to run these tests locally to detect these issues in advance?

@dobooth
Copy link
Contributor

dobooth commented Feb 14, 2020

Sure. In a CLI, at the devdocs root, run rake to build the site. It should return any errors there. You can do rake check:mdl to test the markdown linting on changed files. Try rake -T to show all the checks you can do locally.

@dobooth
Copy link
Contributor

dobooth commented Feb 14, 2020

running tests

@dobooth dobooth merged commit f4b0900 into magento:master Feb 14, 2020
@ghost
Copy link

ghost commented Feb 14, 2020

Hi @diazwatson, thank you for your contribution!
Please, complete Contribution Survey, it will take less than a minute.
Your feedback will help us to improve contribution process.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Major Update Significant original updates to existing content Partner: Maginus partners-contribution PR created by Magento partner Progress: review Special achievement High-value contributions that earn higher rewards and special attention xx2.3.3 Magento 2.3.3 changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants