Overview
Tugboat integration would be great because it would allow us to link to an instance of Drupal with Experience Builder installer. This would allow us to review issues and the state of the Experience Builder with a broader group of stakeholders.
Ideally we would have the node/1 created there by default so that all you would have to do is to log in and navigate to Experience Builder.
| Comment | File | Size | Author |
|---|---|---|---|
| #13 | Screenshot 2024-09-07 at 11.08.14 AM.png | 341.87 KB | abhisekmazumdar |
Issue fork experience_builder-3472103
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 #2
abhisekmazumdarI guess this changes will be somewhat like: https://www.drupal.org/project/drupal_cms/issues/3471003
Comment #3
q0rban commentedI'd be willing to help out with this, though I do not know anything about Experience Builder.
Is there a programmatic way you typically do this, or is this usually a manual task (logging in via the browser to create the node)?
Comment #4
abhisekmazumdarI don't see a programmatic way to create that node. I guess may be we do something with drush generate-content
Comment #5
wim leers@q0rban: Yay, thank you! 🚀
We currently do this manually when developing XB:
—
/CONTRIBUTING.mdBut we also have and end-to-end test that literally performs those steps, added months ago (#3452497: [MR Only] Edit any component prop, powered by a new FieldForComponentSuggester service, which will power the JS UI) in the super early XB days, but still serving its purpose:
\Drupal\Tests\experience_builder\Functional\EndToEndDemoIntegrationTest::test()And the Cypress end-to-end tests (similar to Nightwatch, but better) perform similar steps:
—
\Drupal\Tests\experience_builder\TestSite\XBTestSetup::setup()(@abhisekmazumdar in #4: look at that 😊)Proposal: if you can make this work to the point where it installs the Standard install profile, creates the first article node (and perhaps fails for now) and then navigates to
/node/1, I'm happy to fill in the few missing pieces. 😊😇Comment #7
abhisekmazumdar@q0rban, this is your world. How can we leverage this into the config.yml file? I see the WIP MR.
I can only think of a custom drush command, but I'm not sure if that would be overkill for this requirement. Alternatively, may be we could script this out and use it in the config.yml.
I will keep my eye on the MR.
Comment #8
q0rban commentedOkay, I think I've got this working with help from @marcoscano, if someone could add him as a contributor to this. I'm not sure how to do that.
Comment #9
abhisekmazumdarThe MR looks good:
TODO:
Build the React app. Steps mentioned on MR comment.
Comment #10
q0rban commentedThank you @abhisekmazumdar
What version of nodejs should be used for those npm commands?
Comment #11
balintbrews@q0rban, there is an
.nvmrcfile in theuifolder to define the required Node.js version:v20at the time of writing this comment.Comment #12
q0rban commentedThank you @balintbrews. I pushed up a fix to install nodejs and run the npm commands. Did that fix things? I'm not sure how to test.
On a side-note, this is my first time working with nvm, it's not really tailored for CI environments, is it? I couldn't find docs for using it in CI. Seems like it's more geared for human usage with a logged-in shell. Definitely open to suggestions if I'm doing something silly.
Comment #13
abhisekmazumdarNot sure why we still see
for
/xb/node/1Also
Comment #14
effulgentsia commented#13 implies that the
npm run buildcommand is failing (or isn't getting reached). Is there a way to see a log of what Tugboat outputs when it runs thenvm use,npm install, andnpm run buildcommands?Comment #15
balintbrewsWhether that's the case, I'm not completely sure. One change that might be useful in
.tugboat/config.ymlis doingnvm installinstead ofnvm use, which will not only install the specificed Node.js version, but will also start using it.With that said, I'm not fully convinced if we even need to use nvm in our CI. We won't be changing Node.js versions very often, so just setting it to the same major version we currently have in our
.nvmrcwould be sufficient in my opinion. I realize I pointed at the.nvmrcfile, but if using nvm introduces challenges, I think it's fine to let that go.Comment #18
q0rban commentednvm installis being run in theinitcommand group: https://git.drupalcode.org/project/experience_builder/-/merge_requests/2...Thank you, @effulgentsia. Here is the output of
npm run build. Any clues there?Comment #19
effulgentsia commentedHm, that's curious. So according to the end of #18, it's creating
dist/assets/index.jsand it's in the$TUGBOAT_ROOT/uidirectory when it does that, and yethttps://mr253-cojczkjc816gddq8fdjhi8vgvfblp7k3.tugboatqa.com/modules/con... returns a 404. That's a mystery.
Comment #20
q0rban commentedAh, interesting, I think I see what's going on. The module is being pulled into drupal/modules using composer + git, but I am running those npm commands inside of the checkout of the module, not the composer-installed location.
Comment #21
q0rban commentedOkay, I think I fixed that issue. I'm still not entirely sure what I'm looking for to see if it's working.
Comment #22
abhisekmazumdarYes it works 🎉 : https://mr253-cojczkjc816gddq8fdjhi8vgvfblp7k3.tugboatqa.com/xb/node/1
I can see the XB and all its components with default content as well.
Comment #23
wim leers#3472299: Update default config to make a fresh install result in an XB UI with an empty canvas will simplify this. And because that's in #3454094: Milestone 0.1.0: Experience Builder Demo, postponing this.
But that means this will only become simpler, so I'm confident we can merge it immediately after that! 😄🚀
Thank you, @q0rban! 👏
Comment #24
effulgentsia commentedYay, awesome to see this working now!!
Is Composer pulling in the version that's in the MR? Or is it only pulling in the branch tip without the changes in the MR? The MR in this issue isn't making any changes to the module code, but if the goal of Tugboat is to test out future MRs that do, we should make sure that actually works. I'm asking because the fact that what Composer puts into
drupal/modulesis a separate git clone rather than a symlink to what's inTUGBOAT_ROOTseems suspicious.Comment #25
wim leersI didn't review the MR in detail — I assumed that this would just follow the pattern that #3471003: Integrate with Tugboat to allow previewing merge requests used, whose very purpose was literally what @effulgentsia described in #24.
So: can you confirm that, @q0rban? 🤞
Comment #26
q0rban commentedThe short answer is yes, each new MR would have a preview with the changes that are in the MR applied.
The long answer requires an explanation of some of the steps in the config.yml. These steps come from https://www.drupal.org/docs/develop/git/using-git-to-contribute-to-drupa....
We are using drupal/recommended-project and using composer to require the MR branch into it. The way we are achieving that is as follows:
First, we create a branch that we can reference later. We use the unique Tugboat repo ID as the branch name so that we don't accidently conflict with a real branch that a contributor may have:
Then, inside the composer root of drupal/recommended-project, we set up a composer repository to point to the git checkout of the MR, and composer require experience_builder using the unique branch name above:
I believe using composer instead of a symlink is better, as you can be sure that any composer scripts are run as they would for an end-user. These are also the same steps that other d.o Tugboat integrations are using with success, so using them adheres to the principle of least astonishment for anyone else who may contribute to this config.yml in the future.
I am open to ideas and suggestions for improvement!
Comment #27
effulgentsia commented#26 makes total sense. Thanks for the explanation! That all looks correct to me.
From https://getcomposer.org/doc/05-repositories.md#path:
I'm not clear enough on Composer internals to know why in this case it isn't symlinking, but I guess it doesn't matter: it's getting the correct content which is all that matters.
Comment #28
q0rban commentedOh, maybe because I am using vcs instead of path. I didn't know about that option! That seems like it would simplify things for sure. I'll check it out. Thank you @effulgentsia!
Comment #29
q0rban commentedI made the change to path instead of vcs. It required modifying the composer stability to dev. So now the module in Drupal is a symlink to the git checkout. It simplified the config, so thank you for the recommendation.
Comment #30
wim leers#3472299: Update default config to make a fresh install result in an XB UI with an empty canvas landed!
Sounds like @effulgentsia is the most qualified person to review this one 😄 But I spotted some problems too. Once my feedback is addressed, I defer to @effulgentsia 🤓
Comment #31
q0rban commentedThank you! Feedback addressed. Over to @effulgentsia.
Comment #32
wim leersI'd like @effulgentsia to do a final pass, but LGTM! 😊
Thank you!
Comment #34
effulgentsia commentedThis looks great. Thank you, @q0rban, for driving this, and everyone else for your help!
Comment #35
effulgentsia commentedIs it 1) possible, and 2) desirable, to add a link to the XB project page to let people view the current state of XB (branch tip of 0.x) in Tugboat? For example, perhaps a new item #4 under "Track progress"? Are there docs somewhere for how to link to a Tugboat deployment like that?
Comment #36
effulgentsia commentedI opened #3475652: Should we add SDDS to XB's Tugboat? as a followup.
Comment #37
wim leers#35: desirable: +1 Possible: I don't know, but I bet @q0rban knows? :D
Back to RTBC to get his input :) Tagging to ensure we don't forget #35.
Comment #38
wim leersFYI: the first Tugboat-accelerated review is a fact: #3469672-30: The XB annotations and labels should not change size when zooming! 🚀
Comment #39
effulgentsia commentedWhat's needed for the "view live preview" Tugboat link to show up under an issue's MR? Does it need the issue status to be a certain value? Or the MR to be a non-draft? Or tests to pass? I'd like to have it in #3475363: [exploratory] PoC of Astro island components editable via StackBlitz but it's not showing up there.
Comment #40
q0rban commentedThe previews expire after 5 days. To recreate it, you can close the MR and reopen it.
If that still doesn’t fix it, make sure the branch for the MR has the tugboat config in it.
Comment #41
effulgentsia commentedClosing the MR and re-opening it did it. Thanks!
Comment #42
wim leers@q0rban Based on #40, it sounds like #35 is not possible?
Comment #43
q0rban commentedIt's not something built into the drupal.org integration presently, though I do really like the idea. This took a few hours to cobble together using the Tugboat API, nodejs backend, and react frontend, and does basically what you are asking for, albeit for the 0.x of drupal_cms. We could host something similar for this module, but I'd much rather have something built-in to d.o so that anyone could do it, if we can get the DA's support and some drupal dev help. What do you think?
Comment #44
wim leersI like it! :D
Comment #45
q0rban commentedClosing this issue since the initial Tugboat config is in.
I'll open another issue for a "Demo 0.x" button based on the discussion from #35.
Comment #46
q0rban commentedFollow-up issue: #3479646: Demo Experience Builder button on project landing page