Page MenuHomePhabricator

Support experimenting with domain configurations
Closed, ResolvedPublicFeature

Description

Feature summary (what you would like to be able to do and where):

Provide yet another additional endpoint that uses domain definitions (i.e., templates and patterns, and tests?) posted by the user instead of those in our storage in Meta.

This endpoint may return a webpage split in two:

  1. the left part could have two text areas, one for the templates and one for the patterns.
  2. the right part would show the translation output, just like the main endpoint, or the more-detailed information one described in T301748

The first time the user sends a request to this endpoint, it would return a translation using the domain definitions saved to our storage. This time, the template and pattern text areas would show these definitions. Next, the user would be able to change the definitions in these text areas and push a "translate" button that would post these updated definitions to the endpoint to get an updated translation using these new definitions.

Use case(s) (list the steps that you performed to discover that problem, and describe the actual underlying problem which you want to solve. Do not describe only a solution):

As described in T301748, until the Web2Cit-Editor is available, some users may be willing to start testing the system by manually defining templates and patterns, and asking the Web2Cit-Server to pick them up to translate some URLs.

However, writing these definitions may involve some trial and error, which would mean actual changes to the pages in our storage in Meta. This would not only be slow, but more importantly it may break translation for everyone until the trial and error has settled.

Benefits (why should this be implemented?):

With the solution described here, the users would have (until Web2Cit-Editor is available) a place to play around with the definitions, and finally paste them to the storage when they have found something that works as expected.

Event Timeline

Alternatively, consider adding a search query parameter (or path component) to specify alternative storage paths. For example, https://web2cit.toolforge.org/translate?storage=/diegodlh/Web2Cit/data/ may fetch configuration files from this alternative path, where the user may experiment with custom configuration files without corrupting the whole Web2Cit ecosystem.

diegodlh renamed this task from Support posting domain definitions to Support experimenting with domain configurations.Feb 28 2022, 6:49 AM
diegodlh moved this task from Backlog to To do on the Web2Cit-Server board.

As discussed on our advisory board's mailing list, around the topic of page content model for our configuration files, this sandboxing endpoint may be used like this: https://web2cit.toolforge.org/sandbox/<user>/<target>, where <user> would be the username under which the test configuration files will be fetched from, and <target> the target webpage.

For example, https://web2cit.toolforge.org/sandbox/Diegodlh/https://example.com/article1 would fetch configurations from User:Diegodlh/Web2Cit/data/com/example instead of from Web2Cit/data/com/example/.

Saving sandbox configuration files to userspace has two benefits:

One drawback would be that such files may only be created by logged-in users. However, the solution proposed in the previous comment, is not better at this, I believe.

diegodlh claimed this task.

Implemented in 082a9db8, as described in my last comment. Updated the early adopter guidelines accordingly.