Unit/System Tests Webservices PR-5.4-dev Pending

User tests: Successful: Unsuccessful:

avatar alikon
alikon
26 Dec 2024

Summary of Changes

added endpoints for tags history

  • GET v1/tags/:id/contenthistory
  • PATCH v1/tags/:id/contenthistory/keep
  • DELETE v1/tags/:id/contenthistory

Testing Instructions

npm cypress run --spec tests/System/integration/api/com_contenthistory/Tag.cy.js

Actual result BEFORE applying this Pull Request

N/A

Expected result AFTER applying this Pull Request

test + endpoint

Link to documentations

As discussed, this API enhancement will be documented first in https://manual.joomla.org/migrations/54-60/new-features, please note:

  • id for /v1/tag/:id/contenthistory is the contenthistory id and NOT the tag.id
  • PATCH is only available for the attribute keep_forever with /v1/tag/:id/contenthistory/keep

Please select:

  • Documentation link for docs.joomla.org:

  • No documentation changes for docs.joomla.org needed

  • Pull Request link for manual.joomla.org:

  • No documentation changes for manual.joomla.org needed

avatar alikon alikon - open - 26 Dec 2024
avatar alikon alikon - change - 26 Dec 2024
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 26 Dec 2024
Category Front End Plugins JavaScript Unit Tests
a4c61cc 26 Dec 2024 avatar alikon cs
avatar alikon alikon - change - 26 Dec 2024
Labels Added: Unit/System Tests PR-5.3-dev
avatar alikon alikon - change - 27 Dec 2024
The description was changed
avatar alikon alikon - edited - 27 Dec 2024
avatar alikon alikon - change - 27 Dec 2024
The description was changed
avatar alikon alikon - edited - 27 Dec 2024
avatar alikon alikon - change - 23 Jan 2025
Labels Added: Documentation Required Webservices
avatar alikon alikon - change - 24 Mar 2025
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2025-03-24 21:44:51
Closed_By alikon
avatar alikon alikon - close - 24 Mar 2025
avatar alikon alikon - change - 15 May 2025
Status Closed New
Closed_Date 2025-03-24 21:44:51
Closed_By alikon
avatar alikon alikon - change - 15 May 2025
Status New Pending
avatar alikon alikon - reopen - 15 May 2025
avatar alikon alikon - change - 15 May 2025
Title
[5.3] Tag history endpoint
[5.4] Tag history endpoint
avatar alikon alikon - edited - 15 May 2025
avatar alikon alikon - change - 15 May 2025
Labels Added: PR-5.4-dev
Removed: Documentation Required PR-5.3-dev
avatar muhme
muhme - comment - 16 May 2025

Thank you @alikon for your contribution and for adding System Tests for the new REST API tag history functionality.

Is it possible to also test PATCH and DELETE requests in the System Tests after testing GET?

I would test in parallel with curl or postman and document this as the mentioned System Test spec is already included in the CI. And would ask around how to proceed with the documentation, e.g. there is no POST as the history entries are only created implicit.

avatar alikon
alikon - comment - 18 May 2025

yes, of course
but i'll be slow, i'm short in free time currently

1402ef7 26 May 2025 avatar alikon cs
avatar joomla-cms-bot joomla-cms-bot - change - 8 Jun 2025
Category Front End Plugins JavaScript Unit Tests Administration Language & Strings Front End Plugins JavaScript Unit Tests
avatar richard67 richard67 - change - 8 Jun 2025
Title
[5.4] Tag history endpoint
[6.0] Tag history endpoint
avatar richard67 richard67 - edited - 8 Jun 2025
avatar richard67
richard67 - comment - 8 Jun 2025

@alikon We have discussed this PR among release managers and decided to move it to 6.0-dev as it's a new feature, so I've just rebased your PR. Now it shows 2 unrelated changes, but these will disappear after the next upmerge and branch update.

avatar muhme muhme - test_item - 9 Jun 2025 - Tested unsuccessfully
avatar muhme
muhme - comment - 9 Jun 2025

I have tested this item 🔴 unsuccessfully on 5933d36


I have tested with current 6.0-dev and curl command line (script and output will be attached to the PR)

  • ✅ With wrong API token
    • GET /v1/tags/:id/contenthistory -> 401 "Unauthorized" with error "Forbidden"
    • PATCH /v1/tags/:id/contenthistory/keep -> 401 "Unauthorized" with error "Forbidden"
    • DELETE /v1/tags/:id/contenthistory -> 401 "Unauthorized" with error "Forbidden"
  • GET /v1/tags/:id/contenthistory -> 200 "OK" and returning the entry in JSON format
  • PATCH /v1/tags/:id/contenthistory/keep -> 200 "OK" and empty return
    • ✅ And verified next GET has "keep_forever" : 1 set
  • DELETE /v1/tags/:id/contenthistory -> 204 "No Content" end no content returned
  • ❌ Non existing entries, expected is e.g. 404 "Not Found"
    • GET /v1/tags/4711/contenthistory -> 200 "OK" and json structure with self link and empty data and empty meta
    • PATCH /v1/tags/4711/contenthistory/keep -> 400 "Bad Request" with JSON error "Changed the keep forever value for a history version."
    • DELETE /v1/tags/4711/contenthistory -> 500 "Internal Server Error" with JSON error "RuntimeException"

Not tested was the following. Should this or something elso be tested next time?

  • PATCH with malformed JSON
  • PATCH with unsupported fields

The database was checked in parallel and regardless of this PR, the entries in the content history are not deleted when the tag is deleted and I will create an issue.

Notes on the documentation:

  • id for /tags/:id/contenthistory is the contenthistory and NOT the tag.id
  • PATCH is only available for the attribute keep_forever with /v1/tags/:id/contenthistory/keep

This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/44669.

Files

avatar alikon
alikon - comment - 10 Jun 2025

for the DELETE of a non existent item see #45589

for the GET it is the current behaviour of contenthistory not only for tags

for the PATCH need some more free time to check

avatar muhme muhme - change - 10 Jun 2025
The description was changed
avatar muhme muhme - edited - 10 Jun 2025

Add a Comment

Login with GitHub to post a comment