- Issue created by @pfrenssen
- First commit to issue fork.
- Merge request !58refactor(DataProducer): Conver doc annotations to attributes → (Merged) created by klausi
- 🇦🇹Austria klausi 🇦🇹 Vienna
Pull request ready.
This was the final prompt for AI: "convert the doc block annotation to php attributes. use statement: "use Drupal\graphql\Attribute\DataProducer;". For ContextDefinition use Drupal\Core\Plugin\Context\ContextDefinition. keep the top doc comment sentence. use named parameters for all ContextDefinition constructors, the data type property is called "data_type". Use TranslatableMarkup for @Translation. make sure the use statements on top of the file are sorted alphabetically. for each property of ContextDefintion use a new line. If the data type of a context definition starts with "entity:" then use the class EntityContextDefinition with use statement Drupal\Core\Plugin\Context\EntityContextDefinition. If the data type of a context definition is exactly "entity" then use the class ContextDefinition with use statement Drupal\Core\Plugin\Context\ContextDefinition. Make sure that all multiline array elements have a comma at the end. Ensure that all context definitions in "consumes" are present in the attribute conversion and have the same name. the number of entries in "consumes" needs to be the same. If the class already has an attribute then skip the file."
I took me 5 hours to create this pull request. Was I really faster with AI? Maybe a bit, but fiddling and reviewing changes also takes time. This might be a typical case where a developer thinks they are more productive with AI and suddenly 5 hours have passed.
At least I enjoyed the refactoring more as I did not have to type out or copy/paste all the modifications. I would estimate that 95% of the changes the AI created correctly and the 5% rest I had to fix manually.
I'm very thankful for the automated tests, which caught a lot of small mistakes that I then had to feed back into the prompt.
I used Github copilot in agent mode with model Gemini 2.5 Pro.
- 🇧🇬Bulgaria pfrenssen Sofia
Thanks a lot for this and for sharing the process!
Automatically closed - issue fixed for 2 weeks with no activity.