Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow profiles to override extensions #1341

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Zayon
Copy link

@Zayon Zayon commented Apr 9, 2021

Fixes #1339

@Zayon
Copy link
Author

Zayon commented Apr 9, 2021

Following #1339

I added a feature file that demonstrate the issue I have.

I fixed the Unrecognized option error by moving the unset($configs[$i]['extensions']); line but the extensions in the default profile are still loaded in the custom profile.

My investigations tends toward the ConfigurationLoader here

private function loadConfigs($basePath, array $config, $profile)
where changes could be done.

One thing I have to test is loading a second extension specifically in the custom profile, that would be interesting to know if it works or if extensions are activated only when declared on the default profile.
EDIT: It works I added a second commit to demonstrate

Any thoughts ?

@ciaranmcnulty
Copy link
Contributor

This looks useful, it's certainly something I've struggled with 👍

@ciaranmcnulty
Copy link
Contributor

Can you please rebase this? I think maybe the feature files could be simplified as well

@Zayon
Copy link
Author

Zayon commented Jul 7, 2022

I'll try to take a look at it this week-end if I can

@Zayon Zayon force-pushed the profile-without-extension branch from 8bf0d4b to 7f48458 Compare July 12, 2022 09:18
@Zayon
Copy link
Author

Zayon commented Jul 12, 2022

I rebased :)

@ciaranmcnulty
Copy link
Contributor

so looking at this again (sorry again for slow progress) how do I inherit extension configuration from the default profile?

@Zayon
Copy link
Author

Zayon commented Nov 29, 2022

From the tests I have written I would say that it's possible to :

  1. Disable all extensions from the default profile with
      default:
        extensions:
          custom_extension.php: ~
      custom_profile:
        extensions: ~

Here, custom_profile doesn't have any extension loaded

  1. Load an extension on a custom profile but not on the default one
      default:
        extensions:
          custom_extension.php: ~
      custom_profile:
        extensions:
          custom_extension2.php: ~

Here, custom_profile has both extensions loaded and the default profile only has custom_extension loaded and NOT custom_extension2

It would be intersting to add a tests for overriding a specific configuration of an extension, while keeping the rest of the configuration.

@Zayon
Copy link
Author

Zayon commented Nov 30, 2022

To be clearer :

how do I inherit extension configuration from the default profile?

It's done by default

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unrecognized option "extensions" under "testwork".
2 participants