Problem/Motivation

The container_rebuild_test test module uses the state system to record the number of container rebuilds.

The state system has caching in front of it, which isn't necessary or desirable for this kind of testing, so we should convert the module, and all tests that rely on it, to use the key value service directly.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

Issue fork drupal-3629274

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

catch created an issue. See original summary.

leandro713’s picture

Assigned: Unassigned » leandro713

liking to work on this

leandro713’s picture

Status: Active » Needs review

The merge request replaces the state service with direct access to its
underlying key/value collection in the container rebuild test module and its
functional test.

The now-unnecessary state cache refreshes have also been removed.

Local checks:

- PHP syntax checks passed.
- PHPCS passed.
- The functional test was not run locally because a functional test environment
is not configured. It is being exercised by CI.

AI-Generated: Yes. I used ChatGPT to help analyse and draft the initial change.
I reviewed the resulting diff and ran the reported checks locally.

catch’s picture

Status: Needs review » Needs work

This should use a custom collection name rather than 'state'.

leandro713’s picture

Status: Needs work » Needs review

Thanks! The merge request now uses the dedicated
`container_rebuild_test` key/value collection, with `count` as the key.
`RebuildScriptTest` has been updated accordingly.

leandro713’s picture

Assigned: leandro713 » Unassigned
smustgrave’s picture

leandro713’s picture

Thanks for pointing me to the policy. I have read it and would like to clarify how I used AI for this contribution.

I used ChatGPT to suggest an initial implementation and help draft the merge request text. I independently reviewed and understood every code change, ran the reported local checks, incorporated catch's feedback, and verified the updated result. I take full responsibility for the submitted work.

English is not my first language, and Drupal core issues can involve complex technical discussions. Before investing effort in a contribution, I use AI as a supporting tool to check that I have understood the problem correctly and to express my reasoning clearly in English. It does not replace my own technical judgement or responsibility; it helps me avoid misunderstandings caused by language.

If there is a specific part of the contribution or disclosure that does not meet the policy, please let me know and I will correct it.