[MGNLCT-265] Provision workspace by enabling auto create has not taken into account for others environments Created: 09/Aug/22 Updated: 09/Feb/23 Resolved: 30/Sep/22 |
|
| Status: | Closed |
| Project: | Content Types |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 2.0.0 |
| Type: | Bug | Priority: | Critical |
| Reporter: | Andrei Ichimescu | Assignee: | Oanh Thai Hoang |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Σ Remaining Estimate: | Not Specified | Remaining Estimate: | Not Specified |
| Σ Time Spent: | 7d 0.5h | Time Spent: | 7d 0.5h |
| Σ Original Estimate: | Not Specified | Original Estimate: | Not Specified |
| Attachments: |
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| Issue Links: |
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| Sub-Tasks: |
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| Template: |
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| Acceptance criteria: |
Empty
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| Task DoD: |
[X]*
Doc/release notes changes? Comment present?
[X]*
Downstream builds green?
[X]*
Solution information and context easily available?
[X]*
Tests
[X]*
FixVersion filled and not yet released
[X] 
Architecture Decision Record (ADR)
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| Bug DoR: |
[ ]*
Steps to reproduce, expected, and actual results filled
[ ]*
Affected version filled
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| Date of First Response: | |||||||||||||||||||||||||||||||||||||||||||||||||||
| Epic Link: | SaaS TPR - ContentTypes | ||||||||||||||||||||||||||||||||||||||||||||||||||
| Sprint: | DevX 17, DevX 18, DevX 19, DevX 20 | ||||||||||||||||||||||||||||||||||||||||||||||||||
| Story Points: | 5 | ||||||||||||||||||||||||||||||||||||||||||||||||||
| Team: | |||||||||||||||||||||||||||||||||||||||||||||||||||
| Description |
|
There is 1 problem when using the auto-create functionality of Below is 1 example of content type that enable provisioning workspace path:
datasource:
$type: norsuContentTypeDatasource
workspace: website
autoCreate: true
Step to reproduce:
|
| Comments |
| Comment by Oanh Thai Hoang [ 17/Aug/22 ] |
|
A hint from Rabie:
Right now, we are not taking in account any environment that are not the default ones(see https://git.magnolia-cms.com/projects/CLOUD/repos/norsu/browse/magnolia-norsu/src/main/java/info/magnolia/norsu/CurrentEnvironmentContextProvider.java#64) we need to integrate this with devx environment (@David could you add a story). Let see some use cases: 1. Public instance - Should not try to create an environment, the call will fail because public instance just have read access. 2. Author instance a. Default environments (main, draft) - Author instance has access to "draft" environement by default. So any action runned on author instance on the default devx environment will be runned for norsu "draft" environment, that why we don't see the new rootPath on main - Possible solution: 1. If you are working on the default environment and author, publish the newly created node to main. 2. Automatically run the functionality for "main" and "draft" as we do here https://git.magnolia-cms.com/projects/MODULES/repos/content-types/browse/magnolia-content-types/src/main/java/info/magnolia/types/ContentTypesModule.java#80 b. Others (when magnolia start up or there is a releoad event, basically not in a request) - the rootpath logic should be wrapped in something like this https://git.magnolia-cms.com/projects/MODULES/repos/content-types/browse/magnolia-content-types/src/main/java/info/magnolia/types/ContentTypesModule.java#80, so the right environment is picked up automatically and used to run action. (@nucleus need to make the change on CurrentEnvironmentContextProvider) |
| Comment by Oanh Thai Hoang [ 08/Sep/22 ] |
|
Reverted PR due to Caused by: java.lang.RuntimeException: No default environment found for subscription at info.magnolia.norsu.environment.CurrentEnvironmentContextProvider.lambda$new$0(CurrentEnvironmentContextProvider.java:73) at java.base/java.util.Optional.orElseThrow(Optional.java:408) at info.magnolia.norsu.environment.CurrentEnvironmentContextProvider.<init>(CurrentEnvironmentContextProvider.java:73) at info.magnolia.norsu.environment.CurrentEnvironmentContextProvider$$FastClassByGuice$$acabf592.newInstance(<generated>) at com.google.inject.internal.DefaultConstructionProxyFactory$FastClassProxy.newInstance(DefaultConstructionProxyFactory.java:89) at com.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:114) at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:91) at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:306) at com.google.inject.internal.SingleParameterInjector.inject(SingleParameterInjector.java:42) at com.google.inject.internal.SingleParameterInjector.getAll(SingleParameterInjector.java:65) at com.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:113) at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:91) at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:306) at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40) at com.google.inject.internal.SingletonScope$1.get(SingletonScope.java:168) at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:39) at com.google.inject.internal.InternalInjectorCreator.loadEagerSingletons(InternalInjectorCreator.java:213) at com.google.inject.internal.InternalInjectorCreator.injectDynamically(InternalInjectorCreator.java:184) |
| Comment by Oanh Thai Hoang [ 28/Sep/22 ] |
|
|
| Comment by Oanh Thai Hoang [ 29/Sep/22 ] |
|
After https://jira.magnolia-cms.com/browse/CLOUD-2020 has been fixed and rest norsu can instanced successfully. The error writer from missing jackson provider to write mesage as json still happen and it prevents Content type to create a new rootPath. See problem |