#2992833: Add a version negotiation to revisionable resource types makes it possible to request individual revisions of an entity.

In order to find those revisions, a version-history resource is required which will list all revisions of an entity.

We need to:

  1. Determine what the URL path should be.
  2. Figure out how individual resource objects in the collection will link directly to their revision-specific individual route. See #2992836: Provide links to resource versions (entity revisions)
  3. Implement it!

Comments

gabesullice’s picture

Wim Leers’s picture

Issue tags: +Workflow Initiative

#2992836: Provide links to resource versions (entity revisions) was blocked on #2992833: Add a version negotiation to revisionable resource types, but #2992833 just reached RTBC, so #2992836 can move forward again. Hence the status of this issue is accurate.

Wim Leers’s picture

Title: [PP-1] Provide a collection resource where a version history can be obtained. » [PP-2] Provide a collection resource where a version history can be obtained.
Related issues: +#2725523: Add a revision_parent field to revisionable entities

AFAICT this is also blocked on #2725523: Add a revision_parent field to revisionable entities? Fortunately, that is moving forward again as of exactly one week ago, see #2725523-15: Add a revision_parent field to revisionable entities! I already reviewed that patch.

gabesullice’s picture

Title: [PP-2] Provide a collection resource where a version history can be obtained. » [PP-1] Provide a collection resource where a version history can be obtained.
Wim Leers’s picture

Title: [PP-1] Provide a collection resource where a version history can be obtained. » [PP-1] Provide a collection resource where a version history can be obtained (`version-history` link relation)

https://tools.ietf.org/html/rfc5829#section-3.1 defines this as the version-history link relation, reflecting that in the title.

Wim Leers’s picture

Title: [PP-1] Provide a collection resource where a version history can be obtained (`version-history` link relation) » [PP-1] Provide a collection resource where a version history can be obtained (`version-history`, `predecessor-version` and `successor-version` link relations)

It probably makes sense to also handle predecessor-version and successor-version links in this issue, since that is also enabled by #2725523: Add a revision_parent field to revisionable entities.

gabesullice’s picture

Title: [PP-1] Provide a collection resource where a version history can be obtained (`version-history`, `predecessor-version` and `successor-version` link relations) » Provide a collection resource where a version history can be obtained (`version-history`, `predecessor-version` and `successor-version` link relations)
Status: Postponed » Active

@Wim Leers, let's not block this on that issue. Right now, we can deduce predecessors and successors from the vid (just sort it) since Drupal does not yet support branching. When it does, we can take revision_parent into account in a follow-up.

gabesullice’s picture

Project: JSON:API » Drupal core
Version: 8.x-2.x-dev » 8.8.x-dev
Component: Code » jsonapi.module

Moving to the core queue.

Wim Leers’s picture

IIRC deducing it from vid now and using revision_parent in the future will lead to behavior changes and hence BC breaks?

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

johnguirgis’s picture

Is there any update on this? I would like to be able to view the version history of node and I'm not sure how I would go about doing that.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.