[MGNLREST-158] TourFinder endpoint overlaps newly registered endpoint Created: 08/Dec/17  Updated: 09/Jan/18  Resolved: 06/Jan/18

Status: Closed
Project: Magnolia REST Framework
Component/s: None
Affects Version/s: 2.0.1
Fix Version/s: 2.0.2

Type: Bug Priority: Neutral
Reporter: Hieu Nguyen Duc Assignee: Dai Ha
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: 0d
Time Spent: 4d 3h
Original Estimate: 3d 7h
Environment:

"magnolia-enterprise-standard-demo-webapp" and "magnolia-enterprise-pro-demo-webapp"


Attachments: PNG File Screen Shot 2018-01-05 at 8.55.18 AM.png     PNG File listOfEndpoints.png    
Issue Links:
Relates
relates to MGNLREST-157 Endpoint doesn't get updated after de... Closed
dependency
depends upon MGNLREST-152 Configure multiple delivery endpoints... Closed
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Date of First Response:
Sprint: Saigon 126, Saigon 127, Saigon 128, Saigon 129
Story Points: 2

 Description   

Registering a new endpoint doesn't have effect initially because an existing delivery endpoint called "tourFinder" has been registered. Any request to "/.rest/delivery/..." just jumps into tourFinder endpoint. In order to bring the new endpoint into play, edit config to trigger re-instantiation.



 Comments   
Comment by Mikaël Geljić [ 11/Dec/17 ]

Either log appropriate warning, or if there is a very quick solution to merge workspace params for different workspaces; otherwise we will close as "Won't fix", because this depends upon MGNLREST-152.

As a workaround, one should be able to set the enabled property of the tour finder endpoint to false; let's confirm that.

Comment by Dai Ha [ 05/Jan/18 ]

After discussion, the scope of this issue is raising a problem upon endpoint implementation class duplicated. The problem should look like:

Comment by Hieu Nguyen Duc [ 08/Jan/18 ]

QA result

I've found an issue that the problem has gone since I decorated the conflicted endpoint.

Steps:

1) Put this into "modules"

"rest-test/restEndpoints/rest-test.yaml"

class: info.magnolia.rest.delivery.jcr.v1.JcrDeliveryEndpointDefinition
params:
  pages:
    workspace: website
    bypassWorkspaceAcls: true
    includeSystemProperties: true
    nodeTypes:
      0: mgnl:page

Logs

2018-01-08 16:27:19,343 INFO  agnolia.config.source.yaml.YamlConfigurationSource: Registered definition from YAML file [/rest-test/restEndpoints/rest-test.yaml]: [restEndpoint] definition [rest-test] with reference id: [rest-test] from module [rest-test] at [rest-test]
2018-01-08 16:27:19,343 WARN  agnolia.config.source.yaml.YamlConfigurationSource: 1 major and 0 minor problems have been encountered
2018-01-08 16:27:19,343 WARN  agnolia.config.source.yaml.YamlConfigurationSource: 
Severity type:   MAJOR 
Title:           /rest-test/restEndpoints/rest-test.yaml: [Definition semantics] - Conflict endpoint definitions. 
Problem details: Endpoint definitions [rest-test:rest-test] and [tourFinder:tourFinder] both declare implementationClass [class info.magnolia.rest.delivery.jcr.v1.JcrDeliveryEndpoint]. REST module does support endpoints with identical implementationClass yet.
2) A major problem is shown in Problems tab
3) Put this decoration file into "modules"

"rest-test-decorations/decorations/rest-test/restEndpoints/rest-test.yaml"

 params:
   pages:
     depth: 1
     nodeTypes:
       0: mgnl:page
     childNodeTypes:
       0: mgnl:page

Logs

2018-01-08 16:27:31,342 INFO  ource.yaml.AbstractFileResourceConfigurationSource: File based definition decorator resolved from [/rest-test-decorations/decorations/rest-test/restEndpoints/rest-test.yaml] and will be added to [restEndpoints] registry
2018-01-08 16:27:31,343 INFO  fig.source.yaml.decoration.YamlDefinitionDecorator: Applied YAML file based decorator from [/rest-test-decorations/decorations/rest-test/restEndpoints/rest-test.yaml] to definition provider [[restEndpoint] definition [rest-test] with reference id: [rest-test] from module [rest-test] at [rest-test]]
4) The problem disappears from Problems tab!
Generated at Mon Feb 12 06:57:11 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.