Problem/Motivation

Seems like the hal module is fighting beyond its grave...

There are still a few (textual) references to it around in 10.0.x-dev even after its removal in #3049857: Remove HAL module from core and create a contrib project for it.

Steps to reproduce

Proposed resolution

Find and delete/fix/alter/whatever remaining (textual) references, so nothing refers to the now Contrib module hal, so the Core hal of the Mountain King can finally be sealed forever.

Remaining tasks

Identify remaining (textual) references to the hal module in core
Delete/fix/alter/whatever them.

Agree on the changes made
Commit
Put on some Grieg to celebrate

User interface changes

API changes

Data model changes

Release notes snippet

Issue fork drupal-3266544

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

Spokje created an issue. See original summary.

spokje’s picture

Assigned: spokje » Unassigned
Issue summary: View changes
Status: Active » Needs review

Besides the changes in the MR, there are still some references to hal in Core:

- core/modules/serialization/serialization.services.yml has a few references explaining the priority of some services
- core/modules/rest/tests/src/Functional/EntityResource/EntityResourceTestBase.php has a reference explaining "Some top-level keys in the normalization may not be fields on the entity"

I think at least the first one should stay, the second one is a maybe for me.

I now put this issue on Needs review, which will probably remain until 32.0.x-dev or thereabout...

smustgrave’s picture

Status: Needs review » Needs work

First great issue summary

The changes to me look good. Can you update the MR to 10.1 though please. Then I don't mind marking RTBC.

spokje’s picture

Version: 10.0.x-dev » 10.1.x-dev
spokje’s picture

Status: Needs work » Needs review
smustgrave’s picture

Status: Needs review » Reviewed & tested by the community

Thanks!

Changes look good to me.

xjm’s picture

Status: Reviewed & tested by the community » Needs review
Issue tags: +Needs subsystem maintainer review

These are the references I find with the MR applied:

[ayrton:maintainer | Fri 19:09:08] $ grep -rEi "\bhal\b" * | grep -v "vendor" | grep -v "node_modules"
core/lib/Drupal/Component/Transliteration/data/xd5.php:  0x60 => 'hal', 'halg', 'halm', 'halb', 'hals', 'halt', 'halp', 'halh', 'ham', 'hab', 'habs', 'has', 'hass', 'hang', 'haj', 'hach',
core/modules/serialization/serialization.services.yml:      # Set the priority lower than the hal entity reference field item
core/modules/serialization/serialization.services.yml:      # Priority must be lower than serializer.normalizer.field_item.hal and any
core/modules/serialization/serialization.services.yml:      # Priority must be lower than serializer.normalizer.field.hal.
core/modules/serialization/serialization.services.yml:      # than hal field normalizer.
core/modules/serialization/serialization.services.yml:      # than hal normalizers.
core/modules/system/system.install:  'hal' => 'HAL',
Binary file core/modules/system/tests/fixtures/update/drupal-9.4.0.filled.standard.php.gz matches
core/modules/rest/tests/src/Functional/EntityResource/EntityResourceTestBase.php:      // entity (for example '_links' and '_embedded' in the HAL normalization).

The system.install one needs to stay for sure, as does the upgrade path fixture. The transliteration match is clearly unrelated.

However, I'm not sure that I agree with @Spokje that the references in serialization.services.yml should be kept, and I don't know what to do with the comment in EntityResourceTestBase.

Let's get a subsystem maintainer review from one of the API-First maintainers on what to do with those two.

xjm’s picture

(Aside: 🍪 for you for "HAL of the Mountain King".)

bbrala’s picture

Status: Needs review » Needs work
Issue tags: -Needs subsystem maintainer review

The comment in the test could just be trimmed imo.

      // Some top-level keys in the normalization may not be fields on the
      // entity.

Regarding the services, i understand you'd probably rather have those removed. This would be my first reaction also.

But I'm trying to imagine what will happen in a while if we remove those. Wouldn't it be rather confusing why those priorities exist? I might end up sending someone into a rabbithole. Also those comments are a pointer to an issue regarding a better way to select normalizers. (#2575761: Discuss a better system for discovering and selecting normalizers).

When examining the 'blame' it does seem to point in the right direction though, so someone who might need to find out, can. Pretty clean commit which actually added the comments also. I've added a link to the above issue in #2827218: Denormalization on field items is never called: add FieldNormalizer + FieldItemNormalizer with denormalize() methods, so it is still discoverable though some digging.

My conclusion, the information is clear enough, even without those comments. And it does feel weird to have hal live on through that. So I'd remove them.

spokje’s picture

Thanks to both @xjm and @bbrala.

I'm a bit confused in what file the below mentioned comment should be trimmed.

The comment in the test could just be trimmed imo.

      // Some top-level keys in the normalization may not be fields on the
      // entity.
bbrala’s picture

In the test I think.

core/modules/rest/tests/src/Functional/EntityResource/EntityResourceTestBase.php

spokje’s picture

Status: Needs work » Needs review

Thanks @bbrala, unsure how I've missed that.

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community

Appears that changes requested have been addressed.

xjm’s picture

Assigned: Unassigned » bbrala
Status: Reviewed & tested by the community » Needs review
Issue tags: +Needs subsystem maintainer review

My concern with the references in serialization.services.yml isn't that we mention HAL, it's that we're setting priorities relative to non-core services. I don't think we should just remove the comments; I think we should remove the code and the contrib module should be responsible for altering the priority of the services in the way that it needs. That should be possible, right?

Assigning to @bbrala for feedback. :)

bbrala’s picture

I've been thinking about this. And although I competly agree core should not serve contrib a change in how priorities work could mean sites will break in weird ways where custom serializers might not be called anymore as before. If there are sites that have implementere their own and rely on the order/priority currently output by core wouldn't those break?

So, I'm not against removing them BUT this really really does feal like something that is a BC break which would mean we would only be able to do that in 11. I'm just very weary of randomly breaking sites, which I know noone wants.

That's my 2ct. I might be overly defensive, but I do believe we will get weird breakage in a subset of sites.

smustgrave’s picture

Could we deprecate the service?

spokje’s picture

So here is where we stand:

In the (rebased) MR there are no changes in core/modules/serialization/serialization.services.yml, which means there will be still references to the HAL module explaining why some services in there have certain priorities.

Could we deprecate the service?

Suggested by @smustgrave in #17.

Not really, since we're not deprecating the services, but rather the comments about why certain services have certain priorities.

As fas as I can see, here are the options:

1) Get this MR in, discuss the references to HAL in core/modules/serialization/serialization.services.yml, in a follow-up
2) Decide here whether we want to keep to references or not and add the effect of that decision to the discussion the the MR in here and commit that.
3) Do "something nifty" in the contrib-module-HAL, which can juggle service priorities around. Even then we can't trust on all of the people having the "new way" module HAL installed, so we're still not sure we covered everybody.

Personally, I'm a fan of #1, but somebody somewhere in the ranks of Core Committers/Release Managers is probably needed to move this along. Especially seeing that the now-in-contrib module HAL already had no maintainer who we can ask on guidance.

Tagged with Needs release manager review, since that's the only relevant tag I could find, happy to be directed in the correct (tag-)direction.

catch’s picture

Get this MR in, discuss the references to HAL in core/modules/serialization/serialization.services.yml, in a follow-up

+1 to this let's split it off since it's not just a textual reference but actual logic.

smustgrave’s picture

quietone’s picture

Title: Remove remaining (textual) references to the hal module » Remove remaining (textual) references to the HAL module

I have reviewed this and I think it is ready to commit. I will wait for other committers to comment. Otherwise, I will commit in a day or two.

  • quietone committed 837957e1 on 10.1.x
    Issue #3266544 by Spokje, xjm, smustgrave, bbrala, catch: Remove...
quietone’s picture

Assigned: bbrala » Unassigned
Status: Reviewed & tested by the community » Fixed

A few days turned in a week.

Committed 837957e and pushed to 10.1.x. Thanks!

Work can continue in #3345059: Discuss reference to HAL in serialization.service.yml.

Status: Fixed » Closed (fixed)

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