Handle data dependencies in CLI commands

Created on 30 July 2025, 9 days ago

Overview

Code components now have data dependencies introduced in πŸ“Œ Improve the way to detect if the code component has drupalSettings Active . This is not yet handled in the CLI tool.

Proposed resolution

Add the new property in the typing. Make sure it's added by the scaffold command, written by the download command, and handled by the upload command.

This is an incremental change to open the possibility of manually providing data dependencies. The DX will be fixed in πŸ“Œ Automatically detect first-party imports in code components uploaded with the CLI tool Active .

πŸ“Œ Task
Status

Active

Version

1.0

Component

CLI Tool

Created by

πŸ‡³πŸ‡±Netherlands balintbrews Amsterdam, NL

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @balintbrews
  • First commit to issue fork.
  • πŸ‡¬πŸ‡§United Kingdom justafish London, UK
  • πŸ‡³πŸ‡±Netherlands balintbrews Amsterdam, NL

    I was thinking about backwards compatibility with the 0.x branch, and I was ready to go ahead and start different versions for the CLI to address that, but @justafish had a better idea:

    We could see if in our upload command we receive a 422 error complaining about the dataDependencies property not being recognized β€” which would happen with the 0.x branch. In that case, we could retry the request while removing dataDependencies from the payload.

  • Merge request !1405#3538775 "Handle data dependencies" β†’ (Open) created by bnjmnm
  • Pipeline finished with Running
    7 days ago
    #562611
  • Pipeline finished with Failed
    7 days ago
    Total: 403s
    #562719
  • Pipeline finished with Failed
    7 days ago
    Total: 1097s
    #562733
  • Pipeline finished with Success
    4 days ago
    Total: 3689s
    #564261
  • πŸ‡³πŸ‡±Netherlands balintbrews Amsterdam, NL
  • πŸ‡¦πŸ‡ΊAustralia larowlan πŸ‡¦πŸ‡ΊπŸ.au GMT+10

    Is there any way we can write a test for this? We have the hello-world template component - can we add a test that it validates against the open api file?

    https://www.npmjs.com/package/openapi-request-validator looks like what we want

    That would prevent changes in Drupal breaking this in the future.

  • πŸ‡ΊπŸ‡ΈUnited States bnjmnm Ann Arbor, MI

    Re #7 discussed this with some folks including @balintbrews / @effulgentsia / @hooroomoo and it was determined that the scenario that needs to be tested here is better implemented as an integration test, as the unit would require a degree of mocking that would limit the test's ability to catch actual problems. Currently, integration tests aren't set up at all and would significantly expand the scope of this issue. The discussion concluded that we should prioritize getting the fix in to address some of the immediate needs of other projects, and focus on integration test implementation in a separate (and likely much larger) issue.

  • πŸ‡¦πŸ‡ΊAustralia larowlan πŸ‡¦πŸ‡ΊπŸ.au GMT+10

    A simple PHPUnit test that validated hello-world/component.yml against the #/components/schemas/NewCodeComponent spec in the open API file would have caught this regression. Any objections to me adding that to this branch?

  • πŸ‡¦πŸ‡ΊAustralia larowlan πŸ‡¦πŸ‡ΊπŸ.au GMT+10

    pushed #9, openapi++

  • Pipeline finished with Success
    2 days ago
    #566603
Production build 0.71.5 2024