This is a follow-up issue for #2883680: Force all route filters and route enhancers to be non-lazy

Problem/Motivation

At core 8.5 \Drupal\Core\Routing\Enhancer\RouteEnhancerInterface was deprecated and replaced by \Drupal\Core\Routing\EnhancerInterface and similarly \Drupal\Core\Routing\Enhancer\RouteFilterInterface was deprecated in favour of \Drupal\Core\Routing\FilterInterface

However, the new classes are not available (yet) in 8.4 or 8.3 which is causing a knock-on effect for many contrib modules. Projects such as Rules and SMS framework cannot remove their deprecated code usage without creating a separate branch for 8.4/8.3 which is big overhead just to get tests to pass.

Other modules such as Scheduler that do not use the deprecated code still experience test failures at 8.5 due to having a test dependency on Rules.

Proposed resolution

Backport the new interface classes to Core 8.4 and 8.3

Remaining tasks

None

User interface changes

None

API changes

None

Data model changes

None

Comments

jonathan1055 created an issue. See original summary.

jonathan1055’s picture

Issue summary: View changes
Status: Active » Needs review
StatusFileSize
new1010 bytes

Here is a patch which adds the replacement interface class files to 8.4 and 8.3

dawehner’s picture

I'm wondering whether the better approach would be to backport the capability to ignore deprecation errors and ignore those explicitly in the former branches.

almaudoh’s picture

I'm wondering whether the better approach would be to backport the capability to ignore deprecation errors and ignore those explicitly in the former branches.

There is the possibility, which I haven't myself confirmed, but was mentioned by TR, that just having a module as a dependency which uses a deprecated API will cause test fails in the depending module. I'll check this when I'm done converting WTB to BTB on SMS Framework module.
#2870194-151: Ensure that process-isolated tests can use Symfony's PHPunit bridge to catch usages of deprecated code

my tests DON'T use deprecated functions and my code DOESN'T use deprecated functions - I can't just mark @group legacy because the problem isn't in my code.

My module just has a DEPENDENCY on Rules - none of my tests actually use Rules or call Rules methods or services or anything. If I remove the dependency, all the tests run fine. If I add the dependency (and nothing else), most of my tests fail.

Here is a patch which adds the replacement interface class files to 8.4 and 8.3

I expect this patch to work even though I haven't had time to test it yet. Will do so later.

catch’s picture

StatusFileSize
new93.73 KB

Contrib modules can set their testing branch to 'stable', 'supported' or 'pre-release' instead of dev, which means that 8.5.x testing won't commence until either we tag 8.5.0 (for the first two) or 8.5.0-alpa1 for the last option.

Generally, unless a module is actually depending on new features added in the current dev core minor, pre-release should be the right balance of getting test failures early enough to report core bugs or update for deprecations in time for the minor release, vs late enough that it won't impact releases against the stable version. If those few weeks are still too much crossover then stable or supported will work (also possible to switch for a branch test just to see what's happening, then switch back again).

The deprecation reporting is still pretty new, and there's a discussion on making the deprecation skipping more usable here as well[#2607260].

I'd prefer to exhaust those options before we either start backporting things that are new, or talk about delaying deprecations until minor+1 and similar.

jonathan1055’s picture

Thanks @catch. So, just to work through this specific deprecation case with the real example of Rules and Scheduler contrib modules, to see if I have understood what you are saying:

  • (Time X = now) Contrib should not really need to test on 8.5 the latest dev, and should use 'pre-release' which at the moment is 8.4.x-dev. So Rules will test on 8.4 for issue and 'on commit' and pass (because the deprecation is only at 8.5). What about testing at 8.3 also? Scheduler, which does not have deprecated code but uses Rules in testing has the option of not testing at 8.5 or adding @group legacy on each test (as they are using BTB, does not work for WTB)
  • (Time Y) When a new minor release is upcoming, 'pre-release' would be moved on to '8.5.x' and Rules (if doing daily testing) would get prompt notice that we are using this deprecated code, and be able to fix it. When committing this fix, testing at 8.4 would then crash (not fail). Maybe this is OK? Or maybe we should not test at 8.4 from this point?
  • (Time Z) When 8.5.0 is released, Rules only tests on 8.5 (which is now the pre-release/supported version) and we no longer test at 8.4, nor at 8.6 the new dev. Scheduler would then be able to remove the @group legacy tag.

With Scheduler, I have daily tests running at 8.3, 8.4 and 8.5 but I think you are saying that just 8.4 is sufficient?

I have also linked #2923267: Allow test classes to specify skipped deprecations too which would be extremely useful, as it would (a) limit the deprecation suppression to known messages added by the maintainer (so other deprecations are not hidden by accident) and (b) likely to involve fewer changed files, compared to adding the 'legacy' tag to every test class.

catch’s picture

What about testing at 8.3 also

8.3 isn't supported since 8.4.0 came out, so there's no need to test on it any more.

(Time Y) When a new minor release is upcoming, 'pre-release' would be moved on to '8.5.x' and Rules (if doing daily testing) would get prompt notice that we are using this deprecated code, and be able to fix it. When committing this fix, testing at 8.4 would then crash (not fail). Maybe this is OK? Or maybe we should not test at 8.4 from this point?

When you move onto pre-release for branch tests, it'll stop testing on 8.4 unless specifically requested. As long as you don't need to make a contrib release in the time between 8.5.0-alpha1 and 8.5.0 there would be no need to test on 8.4 from that point.

jonathan1055’s picture

Thanks again @catch, that is very helpful. You have just re-vamped my understanding of the contrib testing pathway. Maybe it was documented somewhere, but it seems quite a few maintainers do not follow this, and always want all core versions tested and passing. Or only test at latest dev. There is obviously a case for checking against 8.5 currently, to discover the deprecations, but we should not mind the tests failing.

It would be great on the 'automated testing' page if maintainers could have access to a comment area where we can explain why tests fail at new versions, that it is a known problem and link to the issues which contain the pre-prepared fixes for the tech debt to be paid on the next minor release.

catch’s picture

You have just re-vamped my understanding of the contrib testing pathway. Maybe it was documented somewhere, but it seems quite a few maintainers do not follow this, and always want all core versions tested and passing.

I'm pretty sure some of these features were added in the past year or less.

wim leers’s picture

Title: Backport \Routing\EnhancerInterface to core 8.4 and 8.3 » Backport \Routing\EnhancerInterface to core 8.4

Per #7, 8.3 is no longer supported.

wim leers’s picture

#5: I do think it's valuable to make it possible for modules to test against not just pre-release, but also against development. It's the maintainers of those modules who can detect unexpected/unintentional BC breaks and report back within hours/days of that change occurring. Which means that core won't have to revert potentially weeks of work.

Given that, I do also think it's valuable to always ensure that it's possible for a contrib module to stop using deprecated code against the minor (8.5 atm), and allow them to fix that in the current minor (8.4 atm).

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.4 was released on January 3, 2018 and is the final full bugfix release for the Drupal 8.4.x series. Drupal 8.4.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.5.0 on March 7, 2018. (Drupal 8.5.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.5.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

borisson_’s picture

I don't think 8.4 is still supported right now. That means we can close this issue.

tim.plunkett’s picture

Status: Needs review » Closed (outdated)