Problem/Motivation
We need to document all of the special keys like distribution and the newer opt in and opt out.
Steps to reproduce
N/A
Proposed resolution
Create a profile.api.php in the Extension namespace.
We can move some of the hook docs in core.api.php over as well.
Remaining tasks
User interface changes
N/A
Introduced terminology
N/A
API changes
N/A
Data model changes
N/A
Release notes snippet
N/A
Issue fork drupal-3615639
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 #4
macsim commentedMR opened.
Generated with the help of an LLM.
Comment #5
nicxvan commentedWe need to add the new keys.
Also I'm not sure which parts of this you used LLMs for, I tried to do a comparison, but since it's prose it didn't show a clean diff.
I did see you added:
- php: The minimum PHP version required.I don't see where that happens for profiles? Am I missing something?
Comment #6
macsim commentedMy bad, I just added the documentation for
opt_out_install.Is there another key that needs to be documented?
Unless I'm mistaken, the
phpkey is supported for profiles.ProfileExtensionList::$defaultssets it to\Drupal::MINIMUM_PHP, andExtensionList::checkIncompatibility()checks$extension->info['php']for all extension types including profiles.That said, it is not documented anywhere else (modules, themes), so we can probably leave it out here too.
Comment #7
nicxvan commentedThanks! Let's keep the php key documented here, I missed that bit, I was looking at the forms.
opt_out_installactually isn't in yet, but we can postpone this issue on #3614401: Allow install profiles to opt out of being installedWe do need
keep_profiletoo: https://www.drupal.org/node/3605597I think that might be it. I need to read through carefully what you moved, but this is a great start!
Comment #8
charlliequadros commentedHi @macsim,
I'm not sure what the best way to handle this here would be, but if this change is merged into `main` now, we would be documenting a key that does not yet exist in the codebase.
I was updating my comment, so I ended up missing the comment above. You can ignore this.
There are also a few other documented keys that are not currently available. You can use the following command to check which keys are missing:
Both examples currently use:
However, `main` is currently on `12.0-dev`. Copying either example produces a profile that cannot be installed.
`InfoParserDynamic` sets `core_incompatible`, the active profile is included in the module list by `ModuleExtensionList`, and `install_install_profile()` eventually reaches the check in `ModuleInstaller`. That check runs before the `$enable_dependencies` branch, so passing `FALSE` does not bypass it.
Since nothing in the installer catches this incompatibility earlier, it eventually surfaces midway through the batch as a `MissingDependencyException`.
Changing it to:
would fix the problem for now, but it would also mean updating the example for every new major version.
Another option could be to use:
core_version_requirement: >=11This would keep the example valid for Drupal 11, the current 12.0-dev branch, and future major versions without requiring an update each time. InfoParserInterface::parse() already uses >=9 as an example of this approach.
It might also make sense to keep a single example rather than two, which would reduce the amount of documentation that could become stale over time.
Comment #9
charlliequadros commentedComment #10
nicxvan commentedThanks!
For 1, yes that is what I was referring to in 7 we can postpone this on the issue I linked. We can also pull the key here and add it in the issue where the feature is added.
For 2 regex is great, I might open follow ups to better document module and theme keys too.
For 3 core_version_requirement I would consider copying what module.api.php says about it, I'm not sure I agree we should only have one example, one is a profile, one is a distribution. Identifying the differences is one of the specific things we want to better document.
Comment #11
macsim commentedThanks for the regex @charlliequadros.
I added documentation for
recipesandkeep_profilemissing keys.There's actually no example in
module.api.php; the only reference tocore_version_requirementis in thehook_update_Ndocumentation:I am ok with both the
core_version_requirement: ^12andcore_version_requirement: >=11versions ; even if we choose the first one, it actually doesn't really need to be updated on each major version - thathook_update_Nreference is still using a drupal 8 example and the documentation is still understandable.