Closed (fixed)
Project:
Lupus Decoupled Drupal
Version:
1.x-dev
Component:
Code
Priority:
Major
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
20 Oct 2023 at 13:53 UTC
Updated:
23 Jan 2024 at 11:54 UTC
Jump to comment: Most recent
Comments
Comment #2
roderikI'm afraid this is now a duplicate of #3402425: Fix PHPCS and maybe other errors which I opened to fix "some errors I am seeing" -- not realizing (in the beginning) that it was because of the recently added .gitlab-ci.yml.
As far as I know, all issues are fixed in #3402425: Fix PHPCS and maybe other errors after custom_elements gets a new release. Let's see.
Comment #3
roderikPHPCS / eslint / PHPStan (level 3) are passing now.
This issue is now waiting to see if PHPUnit complaining about custom_elements is going to be resolved by it... or otherwise this issue will have to make sure to pull its -dev release in.
Comment #4
roderikWith the other issue merged and dependent modules having their config schema added:
PHPUnit now shows one remaining failure in at least two issues' jobs, e.g. https://git.drupalcode.org/issue/lupus_decoupled-3320802/-/jobs/379582
So that looks like it is present in the main branch / still needs to be investigated and fixed in this issue. Apparently /ce-api/node/1 is unreachable (though /node/1 is reachable).
Comment #7
arthur_lorenz commentedAfter some debugging I'm confident that I have located the issue: The BackendApiRequest middleware is checking for the
/ce-apiprefix in the server's REQUEST_URI. Since the base url in gitlab ci ishttp://localhost/web, the actual uri that is checked at that point is/web/ce-api/node/1which the middleware does not recognize as a valid ce api request and therefore passes the request through without altering it.I did not have time fix it yet though.
Comment #8
arthur_lorenz commentedI fixed the middleware to work with path prefixes.
Comment #9
roderikOh joy, website install prefixes to shake out bugs!
One comment.
Comment #10
arthur_lorenz commentedThx, good catch, I improved the string replacement.
Comment #11
roderikChecked the string replacement thing. (Probably the first time I've consciously seen substr_replace(). Neat.)
Apart from that: I feel confident RTBC'ing because the change is restricted to the internals of this one middleware, and the changes feel predictable.
(Also, it's not trivial to make a test for the feedback I had earlier because the standard prefix is /ce-api.)
Comment #12
fago* The resulting pipeline does still not pass. Our fix is not fix the pipeline really, but installation with base-paths. Let's open an issue that clearly documents the fix we are doing, fix it there + keep this here open until we can really make it done - with green tests
* Changes seem good, but this is very foundational, so we need to be 100% sure to not cause regressions here. That said, I think this misses test-coverage. Could we add a small unit-test here where we mock $request object, so we could fire it up with all kind of URI combinations and verify it's all correct? (--> in the other issue then)
Comment #13
arthur_lorenz commentedI can not confirm this. The pipeline is passing
Otherwise you are right, this should rather be handled and documented in a separate issue.
Comment #15
fagowith the fix from that issue, the pipeline passed now! https://git.drupalcode.org/project/lupus_decoupled/-/pipelines/74214