Remove categories from the KB, articles can now directly have children - #24922
Remove categories from the KB, articles can now directly have children#24922AdrienClairembault wants to merge 17 commits into
Conversation
ee7e251 to
2206110
Compare
| class: KnowbaseItemCategory::class, | ||
| field: 'knowbaseitemcategories_id', | ||
| full_schema: 'KBCategory' | ||
| 'knowbase_article' => self::getDropdownTypeSchema( |
There was a problem hiding this comment.
Renaming properties and linking to a new schema that doesn't have a superset of the old properties, is an API version contract violation.
| 'x-field' => 'answer', | ||
| ], | ||
| 'categories' => [ | ||
| 'parents' => [ |
There was a problem hiding this comment.
Renaming properties and linking to a new schema that doesn't have a superset of the old properties, is an API version contract violation.
| ], | ||
| ], | ||
| ], | ||
| 'KBCategory' => [ |
There was a problem hiding this comment.
Removing schemas is an API version contract violation.
| return ResourceAccessor::deleteBySchema($this->getKnownSchema('KBArticle', $this->getAPIVersion($request)), $request->getAttributes(), $request->getParameters()); | ||
| } | ||
|
|
||
| #[Route(path: '/Category', methods: ['POST'])] |
There was a problem hiding this comment.
Removing endpoints is an API version contract violation.
There was a problem hiding this comment.
The itemtype was dropped from GLPI. Not sure how we can avoid API violation when something is no longer available.
As the main API maintainer, what would you suggest here?
There was a problem hiding this comment.
I'm working on a solution for that today. It may involve some underlying changes to the API but at least from the user POV, I think I can keep it working without breaking changes.
In short, I am going to try to keep the KBCategory schema name but have its properties mapped to the new KB articles, and then add a deprecation for it. For changed/renamed properties, I'm going to try doing the same and utilizing the "x-version-introduced/deprecated/removed" properties.
2206110 to
8d3afb6
Compare
|
@cedric-anne This one is high priority to finish the KB feature so don't wait for me to come back (I'm away for 2 weeks). @f2cmb will take over if any changes are requested. |
8d3afb6 to
76e798a
Compare
cedric-anne
left a comment
There was a problem hiding this comment.
Except for the API schema changes, it seems OK.
Still working on getting HLAPI v3 ready. Seems some issues were unknowingly suppressed instead of just one known issue. |
This reverts commit 07b8e2a.
GLPI had no visibility criteria on categories so each article had his own rights. Now that the categories will become articles, they have access to the right management criteria. To keep GLPI in line with modern practices, this mean that if you have access to a given article, you should also be able to view any children of this article (= you can see an article if you match its visibility criteria or the ones from one of its parents).
This commit was reverted at the top to avoid conflicts, I've remade it from scratch at the end to make sure it take into account the new changes.
9aca8b6 to
03de1f4
Compare
Categories no longer exists, now any article can have children/parent articles.
This bring the KB in line with modern tools like outline or notion which use a similar system.
Note: I've reverted #24848 during a rebase as it was merged unexpectedly late and was conflicting with most of the changes.
Rather than deal with conflicts, I've re-added it cleanly as a separate commit at the end.