Core committer @effulgentsia is reviewing #2843147: Add JSON:API to core as a stable module and asked us to audit all remaining @todos, to ensure they:

  1. are up-to-date
  2. point to issues if possible
CommentFileSizeAuthor
#44 3028970-44.patch42.93 KBwim leers
#44 interdiff.txt1.99 KBwim leers
#43 3028970-43.patch42.66 KBwim leers
#43 interdiff.txt1.07 KBwim leers
#41 3028970-40.patch42.27 KBwim leers
#41 interdiff.txt643 byteswim leers
#39 3028970-39.patch41.96 KBwim leers
#39 interdiff.txt888 byteswim leers
#37 3028970-37.patch42 KBwim leers
#37 interdiff.txt2.8 KBwim leers
#36 3028970-36.patch39.87 KBwim leers
#36 interdiff.txt1.27 KBwim leers
#35 3028970-35.patch39.28 KBwim leers
#35 interdiff.txt764 byteswim leers
#31 3028970-31.patch38.83 KBwim leers
#31 interdiff.txt3.71 KBwim leers
#30 3028970-30.patch35.96 KBwim leers
#30 interdiff.txt1.19 KBwim leers
#27 3028970-27.patch33.9 KBgabesullice
#27 interdiff.txt799 bytesgabesullice
#26 3028970-26.patch33.9 KBgabesullice
#26 interdiff.txt1.04 KBgabesullice
#23 3028970-22.patch34.62 KBwim leers
#23 interdiff.txt1.66 KBwim leers
#21 3028970-21.patch32.99 KBwim leers
#21 interdiff.txt1.06 KBwim leers
#20 3028970-20.patch32.71 KBwim leers
#20 interdiff.txt1.91 KBwim leers
#18 3028970-18.patch31.86 KBwim leers
#18 interdiff.txt2.25 KBwim leers
#16 3028970-16.patch29.96 KBwim leers
#16 interdiff.txt2.61 KBwim leers
#14 3028970-14.patch28.06 KBwim leers
#14 interdiff.txt1.5 KBwim leers
#13 3028970-11.patch27.74 KBwim leers
#13 interdiff.txt1.05 KBwim leers
#10 3028970-10.patch26.26 KBwim leers
#10 interdiff.txt1.18 KBwim leers
#9 3028970-9.patch25.4 KBwim leers
#9 interdiff.txt16.71 KBwim leers
#8 3028970-8.patch9.04 KBwim leers
#8 interdiff.txt2.23 KBwim leers
#7 3028970-7.patch6.94 KBwim leers
#6 3028970-6.patch6.07 KBwim leers
#6 interdiff.txt849 byteswim leers
#5 3028970-5.patch6.08 KBwim leers
#5 interdiff.txt835 byteswim leers
#4 3028970-4.patch5.5 KBwim leers
#4 interdiff.txt946 byteswim leers
#3 3028970-3.patch5.47 KBwim leers

Comments

Wim Leers created an issue. See original summary.

wim leers’s picture

#2955615: Field properties are not being denormalized introduced this:

    // @todo Make this unconditional once https://www.drupal.org/project/drupal/issues/2957385 lands — JSON:API fixed denormalization of properties in https://www.drupal.org/project/jsonapi/issues/2955615, core's Serialization module still has to follow
    if ($test_module === 'jsonapi_test_field_type') {
      $this->assertSame(static::VALUE_ORIGINAL, $denormalized_entity->field_test->value);
    }

#2957385: FieldItemNormalizer never calls @DataType-level normalizer service' ::denormalize() method landed yesterday, so we can get rid of that todo! 🎉 Except we can't, because that only landed in 8.7, and JSON:API 2 supports 8.5 + 8.6 + 8.7. So, did that in #3015325-21: [ignore] support issue for the core patch.

wim leers’s picture

Status: Active » Needs review
StatusFileSize
new5.47 KB

Improved a whole bunch of them.

wim leers’s picture

Priority: Normal » Minor
Related issues: +#3028967: Queries across storages fail with very confusing exception
StatusFileSize
new946 bytes
new5.5 KB

Created a new core issue for one of the @todos: #3028967: Queries across storages fail with very confusing exception.

wim leers’s picture

StatusFileSize
new835 bytes
new6.08 KB

Based on re-reading the issue (#2958587: Unable to filter on columns of entity reference fields) that introduced this particular @todo, I think this is actually unnecessary now.

wim leers’s picture

wim leers’s picture

wim leers’s picture

StatusFileSize
new2.23 KB
new9.04 KB

Yay, found the first @todo whose blocker landed, we just forgot to do it!

wim leers’s picture

StatusFileSize
new16.71 KB
new25.4 KB

Actually, lots of occurrences of the pattern in #8! Let's fix them all. These were blocked on #2939810: EntityResource::patchIndividual() should allow fields that the user is not allowed to change, as long as they match the current value, and that issue should've fixed these, but it didn't. 😅

wim leers’s picture

StatusFileSize
new1.18 KB
new26.26 KB

Similarly, #2934149: [>=8.5] JSON API routes not specifying _content_type_format route requirement, resulting in bad DX landed, but it only solved the @todo for the PATCH case, not the one for the POST case. Fixed.

The last submitted patch, 9: 3028970-9.patch, failed testing. View results

Status: Needs review » Needs work

The last submitted patch, 10: 3028970-10.patch, failed testing. View results

wim leers’s picture

Status: Needs work » Needs review
StatusFileSize
new1.05 KB
new27.74 KB

Again similarly, #2543726: Make $term->parent behave like any other entity reference field, to fix REST and Migrate support and de-customize its Views integration was fixed, but the @todo wasn't updated. Sadly, that only landed in 8.6, and since JSON:API still supports 8.5, we'll just need to make it run conditionally now. Still, that's a step forward :)

Also, the above patches didn't apply because I still had #3015325: [ignore] support issue for the core patch applied while creating these patches. Sorry about that.

wim leers’s picture

StatusFileSize
new1.5 KB
new28.06 KB

The last submitted patch, 13: 3028970-11.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

wim leers’s picture

StatusFileSize
new2.61 KB
new29.96 KB

A few trivial fixes and one CS fix.

The last submitted patch, 14: 3028970-14.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

wim leers’s picture

Status: Needs review » Needs work

The last submitted patch, 18: 3028970-18.patch, failed testing. View results

wim leers’s picture

Status: Needs work » Needs review
StatusFileSize
new1.91 KB
new32.71 KB

Progress. Still fails though, now on expected cache contexts instead of cache tags.

Note that unlike #18, this is now also asserting the body!

wim leers’s picture

StatusFileSize
new1.06 KB
new32.99 KB

Dealing with the cache contexts here is A) out-of-scope, B) blocked on other issues. Enabling the majority of that test coverage still is a big step forward.

The last submitted patch, 20: 3028970-20.patch, failed testing. View results

wim leers’s picture

StatusFileSize
new1.66 KB
new34.62 KB

While working on #21, I think I observed a lengthy override to be unnecessary. Let's see.

wim leers’s picture

Assigned: wim leers » Unassigned

Signing off for today. @gabesullice, feel free to continue in the mean time. I haven't yet figured out where the Drupal 8.5 failure was introduced.

gabesullice’s picture

Assigned: Unassigned » gabesullice

yoink!

gabesullice’s picture

StatusFileSize
new1.04 KB
new33.9 KB

#2938035: When PATCHing a field is disallowed, no reason is given for *why* this happens added a period to the end of the error message: "The current user is not allowed to PATCH the selected field (uid). The entity ID cannot be changed", which only applies to 8.6 and above.

This will need to be undone in #3015325: [ignore] support issue for the core patch

gabesullice’s picture

StatusFileSize
new799 bytes
new33.9 KB

#13 introduced a version test, but I think it mistakenly had the comparison operator flipped.

gabesullice’s picture

Assigned: gabesullice » Unassigned
wim leers’s picture

Assigned: Unassigned » wim leers

Thanks Gabe! Picking this up again :)

wim leers’s picture

StatusFileSize
new1.19 KB
new35.96 KB

I queued PHP 5.6/Drupal 8.5 tests for all patches, since that's failing in #25. Turns out it's also failing on HEAD: https://www.drupal.org/pift-ci-job/1184958. So … that's not introduced here. Still, here's an attempt to fix that.

wim leers’s picture

wim leers’s picture

Status: Needs review » Needs work

The last submitted patch, 31: 3028970-31.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

wim leers’s picture

Status: Needs work » Needs review
StatusFileSize
new764 bytes
new39.28 KB

Fix CS violation.

wim leers’s picture

StatusFileSize
new1.27 KB
new39.87 KB

Apparently the Comment entity's validation order changed in Drupal 8.7. Working around that.

wim leers’s picture

Status: Needs review » Needs work

The last submitted patch, 37: 3028970-37.patch, failed testing. View results

wim leers’s picture

Status: Needs work » Needs review
StatusFileSize
new888 bytes
new41.96 KB

Status: Needs review » Needs work

The last submitted patch, 39: 3028970-39.patch, failed testing. View results

wim leers’s picture

Status: Needs work » Needs review
StatusFileSize
new643 bytes
new42.27 KB

Status: Needs review » Needs work

The last submitted patch, 41: 3028970-40.patch, failed testing. View results

wim leers’s picture

Status: Needs work » Needs review
StatusFileSize
new1.07 KB
new42.66 KB

#41 was insufficient to prevent multiple identical fieldsets from being tested, any non-first request would result in a cache hit of course.

wim leers’s picture

StatusFileSize
new1.99 KB
new42.93 KB

And there were some quite obvious simplifications that I refrained from doing earlier: explicit asserts that are part of the now uncommented assertResourceResponse(…) call 👍

wim leers’s picture

Status: Needs review » Reviewed & tested by the community
  1. Before patch: 144 @todos in .php files
    After patch: 128 @todos in .php files
  2. The majority of @todos refer to #2300677: JSON:API POST/PATCH support for fully validatable config entities (~80). Many @todos are about 8.5/8.6 work-arounds, that are removed in #3015325: [ignore] support issue for the core patch (that currently removes 21 @todos).
  3. #2965056: Support `include` parameter on relationship routes (turns out it accidentally works on cold caches: fix + test this) is ready too now, and it removes 2 @todo that I would have to address here otherwise in a less-than-ideal way.
  4. #2965056 + #3015325 brings us down to 108 @todos of which ~80 are about config entities, ~5 are about PHP 5.x limitations, and the remainder are mostly long-standing core bugs. I think

Conclusion: this patch is a big leap forward: 14 files changed, 109 insertions, 313 deletions. Green on Drupal 8.5+8.6+8.7 and PHP 5+7. Let's do this! 🚢

  • Wim Leers committed 0327ba8 on 8.x-2.x
    Issue #3028970 by Wim Leers, gabesullice: Audit all @todos
    
wim leers’s picture

Assigned: wim leers » Unassigned
Status: Reviewed & tested by the community » Fixed
gabesullice’s picture

👏👏👏 nice!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.