acquia / drupal-environment-detector

Provides common methods for detecting the current Acquia environment
GNU General Public License v2.0
10 stars 12 forks source link

Environment detector tries to create the files dir in a location that doesn't exist in IDEs #5

Closed anavarre closed 4 years ago

anavarre commented 4 years ago

env-detector

/mnt/files is not a valid mount point in IDEs. The expected root dir is /home/ide/project. Also sitegroup.IDE is not a thing in IDEs.

danepowell commented 4 years ago

@anavarre does this only happen in the context of a BLT application? There's a few things going on here, but I think this is mainly a BLT bug.

The Environment Detector provides a method getAhFilesRoot() that should return the root file storage location, which is outside of the docroot (so that it persists across servers and between code deployments). It sounds like no such thing exists in IDEs since they have no persistent file storage outside of the project.

If that's true, we should probably add comments to getAhFilesRoot() to clarify its purpose, and have it throw an exception if called on IDEs. Thoughts?

danepowell commented 4 years ago

Actually, I take all of that back :smile: This could be considered an IDE bug. IDEs intend to be a drop-in replacement for any other Acquia Hosting environment (for instance, where the server-side settings files are located). Given that that the file mount (/mnt/files/...) is a well-documented feature of Acquia Cloud, then the files mount should also be present in IDEs.

If we're going to break that paradigm, then we should also stop treating IDEs as an Acquia Hosting environment (e.g. setting AH_SITE_ENVIRONMENT and returning true for isAhEnv()) and that has larger, uglier implications.

danepowell commented 4 years ago

I think this was fixed on the IDE side?

anavarre commented 4 years ago

Not exactly as we haven't yet recreated the Cloud Platform logic with the /mnt mount point. But now we do have /var/www/html/sitegroup.ide automatically created.