Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
Workspace module is being built in a way to support multiple types of replication, including to and from remote Drupal sites. However core will only ever implement local replication. Therefore we need a test to make sure the local replication implementation will still allow for contrib to add remote replication.
Proposed resolution
- Add workspace_remote_test test module.
- Add a test to replicate back to the local site over http.
Remaining tasks
User interface changes
API changes
Data model changes
Comment | File | Size | Author |
---|---|---|---|
#13 | 2926472-13.patch | 14.14 KB | timmillwood |
| |||
#13 | interdiff-2926472-13.txt | 1.65 KB | timmillwood |
Comments
Comment #2
timmillwoodUsing a feature branch
workspace_remote_test
to flesh out the test module before converting to a patch.https://cgit.drupalcode.org/workspace/log/?h=workspace_remote_test
Comment #3
timmillwoodinitial patch.
Comment #5
timmillwoodAh ha! 403, not 404.
Comment #6
timmillwoodFixing coding standards issues.
Removing the remote item on the upstream plugin.
Comment #8
amateescu CreditAttribution: amateescu for Pfizer, Inc. commentedHere's what I was proposing in our chat: #2927248: Make upstream plugins non-configurable by default and improve their integration with the Workspace entity , and why I think the 'remote' annotation key is quite useful.
Given the issue above, this test needs to go through the entire flow:
- go to the workspace add form
- select the test remote upstream plugin
- check that the configuration form appears
- fill in values for the endpoint URL
- check that the values were correctly saved in the database by instantiating the plugin with
$upstream = $workspace->getUpstreamPlugin()
and looking at$upstream->getConfiguration()
Comment #9
timmillwoodNote: now there's a patch here I've deleted the branch
workspace_remote_test
so the link in #2 won't work.Comment #10
Wim LeersThis does not match.
If the parameter would be
WorkspaceInterface $workspace
, then it'd automatically receive the entity.All of this should not be necessary,
\Drupal\rest\RequestHandler::handle()
takes care of this.This … does not make sense. See
\Drupal\rest\Plugin\rest\resource\EntityResource::post()
. It should return aModifiedResourceResponse
containing the created data, or at least links to the created data.Comment #11
timmillwood❤ Thank you @Wim Leers!
Here's a quick patch just to fix the broken test in #6 and add
remote
annotation back as it looks like we might need it for #2927248: Make upstream plugins non-configurable by default and improve their integration with the Workspace entity.Comment #12
timmillwoodAfter talking to @WimLeers I've started looking into using REST modules resources rather than creating a custom one.
Comment #13
timmillwoodI think using the core REST resources for this would not work, so sticking with the slightly hacky solution for now. I was getting issues with
Access denied on creating field
for various fields such as nid, revision_uid, changed, status, etc.Looking to implement suggestions from #10.
Comment #14
amateescu CreditAttribution: amateescu for Pfizer, Inc. commentedComment #16
amateescu CreditAttribution: amateescu for Pfizer, Inc. commentedFix component following module rename.
Comment #17
amateescu CreditAttribution: amateescu for Pfizer, Inc. commentedRemote replication is not in the scope of the core Workspaces module anymore, so moving back to the contrib queue for now.