Note
For additional FAQs, see:
Is Code Assembly available on all Acquia hosting environments?
No. Code Assembly is available only on Cloud Next environments.
Does Code Assembly work with all versions of Drupal?
Code Assembly requires Composer as a dependency manager. Therefore, it must be used with the current Drupal version.
Can I change the PHP version of Code Assembly?
Yes, you can configure Code Assembly to use the PHP version that your application requires. For more information, see Building artifacts with Code Assembly.
How is Code Assembly different from Code Studio?
Code Assembly provides a simplified workflow, which does not require integration with a Continuous Integration (CI) tool. Code Studio provides capabilities for every stage of the software development lifecycle, and supports advanced DevOps workflows, with a testing pipeline optimized for Drupal. Ensure that you do not use Code Assembly with a CI/CD pipeline to build and deploy hosting artifacts.
How is Code Assembly different from Pipelines?
Pipelines provides a more robust CI/CD solution than Code Assembly. You must not use Code Assembly if you are already using Pipelines.
Can I switch to Code Studio if I use Code Assembly?
Yes. Both the products are designed to be interchangeable. Ensure that you disable Code Assembly before using Code Studio in your application.
Can I use Code Assembly if I use Code Studio or Pipelines?
Yes. However, the use of Code Assembly might be redundant in these cases because a CI/CD tool typically builds the hosting artifact and pushes it to the Acquia hosting repository as part of build and deploy processes.
Can I run Code Assembly on a branch that contains code and dependencies besides the recommended files?
No. Code Assembly displays a warning and stops execution.
Is there a check to ensure that Code Assembly does not run when I use a CI/CD workflow?
Yes, Code Assembly checks for a /vendor
directory and stops running when it detects the directory.
Which Cloud Hooks run when Code Assembly executes?
If a Cloud Next environment is configured to follow a branch that Code Assembly manages, a successful deployment into that environment triggers the post-code-deploy
and post-code-update
Cloud Hooks. For more information, see Automating with Cloud Hooks.
How can I fix the following user configuration errors?
In certain scenarios, Code Assembly tasks might fail to produce the hosting artifact. In such cases, task log contains details about these user application configuration issues. The following table includes all such issues and their solutions:
Error | Description | Error message | Solution |
---|---|---|---|
PHP version is not set in composer.json | You must define the PHP version in the composer.json file to ensure that Code Assembly creates the hosting artifact. | {"level":"ERROR",
"ts":"2023-09-22T10:05:51.644Z",
"logger":"cloud-innovation",
"caller":"[email protected]/command.go:940",
"msg":"SKIPPING BUILD: encountered an application configuration error",
"error":"unable to set version from composer.json: configuration error: PHP version is not set in composer.json"}
| To add the desired PHP version to the composer config extra.acquia.code-assembly.php_version 8.2
This command adds the following lines to the …
},
"extra": {
"acquia": {
"code-assembly.php_version": "8.2"
}
}
}
|
Branch contains a “vendor” directory | If you enable Code Assembly, and the source branch or the working branch of a PHP application already contains a vendor directory, this branch does not create a hosting artifact. | {"level":"ERROR",
"ts":"2023-09-22T10:05:51.644Z",
"logger":"cloud-innovation",
"caller":"[email protected]/command.go:940",
"msg":"SKIPPING BUILD: encountered an application configuration error",
"error":"configuration error: hosting artifact is already pushed to this branch"}
| If you do not want to use this branch for deployments, delete the vendor directory from the repository. If you do not delete the vendor directory, you must manually manage the build process for this branch, as the system considers the branch to be a hosting artifact. When you enable Code Assembly, the branches that automatically deploy to environments are the branches that Code Assembly built, and have the naming convention, CODE-ASSEMBLY-BUILD-<BRANCHNAME>. To deploy branches that do not follow this naming convention, you must deploy them manually. |
Vendor directory is renamed in composer.json | For PHP applications, Code Assembly only supports vendor as the vendor directory for Composer. If you rename the vendor directory in the composer.json file, the system generates a user configuration error, and prevents Code Assembly from creating a hosting artifact. | {"level":"ERROR",
"ts":"2023-09-22T10:05:51.644Z",
"logger":"cloud-innovation",
"caller":"[email protected]/command.go:940",
"msg":"SKIPPING BUILD: encountered an application configuration error",
"error":"configuration error: found '<vendorDir>' as vendor. Code Assembly expects your Composer dependencies to be located in the 'vendor' directory at the root of your codebase. Please remove the 'vendor-dir' definition from your composer.json file and try again"}
| Remove the vendor-dir definition from the composer.json file. |
Troubleshooting Code Assembly build failures
Code Assembly reports output, including the command output from Composer and NPM, to the task log on the primary application screen in the Cloud Platform user interface.
A Composer or NPM failure is one of the major reasons for build failures in Code Assembly. Therefore, ensure that you refer to the following troubleshooting materials before contacting Acquia Support: