Problem/Motivation
found in #3277830: [DrupalCon] Automatic Updates beta test result
The temporary directory write issue in the container. It seems like the automatic_updates module tried to create a directory in the /tmp directory in the container and it was not able to do that. As a workaround, I changed the temporary directory for the Drupal site in settings.php using
$settings['file_temp_path'] = 'sites/default/files/tmp';
Right now we don't prevent but I could see there being complications. Basically file_temp_path could be anything and we might want some restrictions.
But re @travisCarden Composer Stager does support staging directory under the active directory https://www.drupal.org/project/automatic_updates/issues/3277830#comment-...
Proposed resolution
TBD
Remaining tasks
User interface changes
API changes
Data model changes
Issue fork automatic_updates-3299094
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
Comment #3
tedbowComment #4
wim leersIs this what you meant?
Is this still relevant?
Comment #5
tedbowUpdated the title.
I think this is still relevant to at least figure out what we want to do.
I think we would do one of these.
We could do 1 as an MVP and then come back later support number 2)
Comment #6
omkar.podey commentedComment #7
wim leersPerhaps stating the obvious, but this will needs tests 🤓
Comment #9
omkar.podey commentedWe may want to use realpath() for the staging_root and project_root, I'm not sure if we will hit that edge case wher staging root is something like
vfs:root/active/../stagewhich means stage is not inside of active but the validator would think that for now.Comment #10
omkar.podey commentedComment #11
omkar.podey commentedComment #12
omkar.podey commentedComment #13
omkar.podey commentedComment #14
omkar.podey commentedComment #15
wim leers7 remarks — 6 nits, 1 critical one about test coverage.
Already looking good though! 👍
Comment #16
omkar.podey commentedComment #17
wim leers2 remarks on the MR. 99% done!
Comment #18
omkar.podey commentedComment #19
wim leersPerfect! 🤩
Comment #20
tedbowLooks good. Just need to subscribe to
StatusCheckEventalsoSee MR comment and #3321684: Most validators that subscribe to PreCreate to check readiness to update should also subscribe to PreApply]
Comment #21
tedbowComment #22
omkar.podey commentedComment #23
wim leers268a4cc8 addressed #20 👍
@tedbow: do we want add a kernel test that checks that all validators subscribing to
PreCreateEventalso subscribe toStatusCheckEventexcept for the few that we know don't need it? That would prevent regressions. Could be a nice & simple follow-up 😊Comment #24
tedbowThanks for queuing up the extra tests. setting back to Needs work to fix the test failures
Comment #25
omkar.podey commentedYeah it fails because D9 doesn't support Symfony 5.4 (where the new class
Symfony\Component\Filesystem\Pathwas introduced), probably need to make a helper method.Comment #26
omkar.podey commentedComment #27
wim leersError: Class 'Symfony\Component\Filesystem\Path' not found😱
Looks like this does not exist in Drupal 9.4 or 9.5 …😬 which means we cannot use
Path::canonicalize().This is why:
🤔
Comment #28
wim leersThat method was added in https://github.com/symfony/filesystem/commit/d5ca5f7080a759dcb65300a55d5.... I propose to copy it verbatim into our code and just remove that in #3321474: Adopt PHP 8.1-only capabilities such as constructor property promotion + drop BC layers, where we will require Drupal >=10 anyway 🤓
Comment #29
omkar.podey commentedDo we also want to copy over the test ? , and i am disabling phpcs and cspell checks on the Path class.
Comment #30
omkar.podey commentedStill need to add a
@todoto be removed in 8.x-3.xComment #31
omkar.podey commentedComment #32
omkar.podey commentedComment #33
wim leersNits only, fixed those, RTBC! 😊
Comment #34
wim leersComment #35
wim leersUpdated #3321474 for #28: #3321474-9: Adopt PHP 8.1-only capabilities such as constructor property promotion + drop BC layers.
Comment #36
tedbowLooks pretty good!
Just a couple MR comments
Comment #37
wim leers+1 for @tedbow's remarks, and found one more edge case to worry about.
Comment #38
wim leers🤣
That's because now you've added proper validation, so the
vfs://test cases are no longer accepted. Until we move away from VFS entirely in #3328234: Improve test DX *and* confidence: stop using VFS, you'll need to change it toif (str_starts_with('vfs://'…) || Path::isAbsolute(…)) { … }🤓Comment #39
omkar.podey commentedComment #40
wim leersOne last nit!
Comment #41
omkar.podey commentedComment #42
wim leersReady! 🚢 Just have comment nits (mostly relating to #3328234: Improve test DX *and* confidence: stop using VFS), will apply those.
Comment #44
tedbowThanks! 🎉