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

REST endpoints for AMP validation errors and validated URLs #5552

Closed
5 tasks
johnwatkins0 opened this issue Oct 30, 2020 · 7 comments
Closed
5 tasks

REST endpoints for AMP validation errors and validated URLs #5552

johnwatkins0 opened this issue Oct 30, 2020 · 7 comments
Labels
Developer Tools Groomed P1 Medium priority WS:UX Work stream for UX/Front-end

Comments

@johnwatkins0
Copy link
Contributor

johnwatkins0 commented Oct 30, 2020

Feature description

For some planned plugin features, we will need data about validation errors and validated URLs to be fetched and updated over REST endpoints.

Although this data is currently represented in the database via the amp_validation_error taxonomy and the amp_validated_url post type, we should not use or extendWP_REST_Taxonomy_Controller and WP_REST_Post_Controller because the underlying data structure (which Weston has documented elsewhere) does not neatly map to these core WP object types. A longer-term goal is to move away from the workarounds that have been used to store this data in WP objects and potentially migrate the data into custom tables. So the endpoints should be built to the underlying data schema rather than to the WP_Post/WP_Term schemas. Then when we're ready to change how the data is stored, we'll just need to update the methods that query the database.

Summary

  • Endpoint for validation errors
  • Endpoint for validated URLs
  • Both endpoints support reading, updating, and creating items (see below)
  • All request methods should require authentication
  • Methods interacting with the database should be decoupled to ease transition to a different way of storing the data in the future

Copying this from Weston's comment below for visibility:

For the endpoint for validation errors…

  • They should not allow creation (as it is the creation of a validated URL which causes validation errors to be created).
  • The only update should be for the removed and reviewed flags. Everything else must be readonly.
  • A validation error can only be deleted if it has no associated validated URLs.

Related


Do not alter or remove anything below. The following sections will be managed by moderators only.

Acceptance criteria

Implementation brief

QA testing instructions

Demo

Changelog entry

@johnwatkins0 johnwatkins0 self-assigned this Oct 30, 2020
@johnwatkins0 johnwatkins0 added the WS:UX Work stream for UX/Front-end label Oct 30, 2020
@johnwatkins0 johnwatkins0 added this to the v2.2 milestone Oct 30, 2020
@johnwatkins0 johnwatkins0 removed their assignment Oct 30, 2020
@westonruter
Copy link
Member

  • Both endpoints support reading, updating, and creating items

For the endpoint for validation errors…

  • They should not allow creation (as it is the creation of a validated URL which causes validation errors to be created).
  • The only update should be for the removed and reviewed flags. Everything else must be readonly.
  • A validation error can only be deleted if it has no associated validated URLs.

@pierlon
Copy link
Contributor

pierlon commented Feb 16, 2021

This will be resolved as part of the work on #5772, which will use REST API calls to get information on validation errors and URLs.

@pierlon pierlon modified the milestones: v2.2, v2.1 Feb 16, 2021
@westonruter
Copy link
Member

@pierlon The scope for #5772 is much reduced, however. For the admin menu, the only thing needed is the counts for the validation errors and validated URLs which are not reviewed. There is no need to expose individual validated URLs nor validation errors. Therefore I think the efforts are related but not directly overlapping.

@pierlon
Copy link
Contributor

pierlon commented Feb 16, 2021

Yes you're right. I'll revert this back to the original milestone for now.

@westonruter
Copy link
Member

I have a design doc that lays out what endpoints are needed. I believe everyone has access on the team.

@westonruter
Copy link
Member

Work in progress via #6442.

@westonruter
Copy link
Member

Punting this since we now have what we need for 2.2 via #6615.

@westonruter westonruter modified the milestones: v2.3, v2.4 Dec 23, 2021
@westonruter westonruter removed this from the v2.4 milestone Apr 14, 2022
@westonruter westonruter closed this as not planned Won't fix, can't repro, duplicate, stale Jul 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Developer Tools Groomed P1 Medium priority WS:UX Work stream for UX/Front-end
Projects
Archived in project
Development

No branches or pull requests

4 participants