[MGNLHOOK-36] Demonstration project: Netlify and Vercel Created: 12/Apr/22 Updated: 26/Oct/23 Resolved: 17/Apr/23 |
|
| Status: | Closed |
| Project: | Magnolia Webhooks |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 2.0.1 |
| Type: | Story | Priority: | Neutral |
| Reporter: | Javier Benito | Assignee: | Phong Le Quoc |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Σ Remaining Estimate: | Not Specified | Remaining Estimate: | Not Specified |
| Σ Time Spent: | 4d 5.25h | Time Spent: | 4d 5.25h |
| Σ Original Estimate: | Not Specified | Original Estimate: | Not Specified |
| Issue Links: |
|
|||||||||||||||||||||||||
| Sub-Tasks: |
|
|||||||||||||||||||||||||
| Team: | ||||||||||||||||||||||||||
| Documentation update required: |
Yes
|
|||||||||||||||||||||||||
| Date of First Response: | ||||||||||||||||||||||||||
| Epic Link: | Demonstration projects | |||||||||||||||||||||||||
| Sprint: | DevX 34, DevX 35 | |||||||||||||||||||||||||
| Story Points: | 3 | |||||||||||||||||||||||||
| T-Shirt Size: | Small | |||||||||||||||||||||||||
| Approved: |
Yes
|
|||||||||||||||||||||||||
| Description |
|
Implement as described here: https://wiki.magnolia-cms.com/display/DEVINT/Webhooks+-+Proposal+for+Demo+Projects See Epic ticket: https://jira.magnolia-cms.com/browse/MGNLHOOK-15 |
| Comments |
| Comment by Christopher Zimmermann [ 05/Apr/23 ] |
|
Reviewing the demo project. Interesting that you used the SaaS format for repo structure rather than the one from the demos with "magnolia" and "spa" root directories. But why not, will then be compatible with SaaS later. But due to this structure - the .gitignore should include `apache-tomcat`, `downloads` at least, as when dev uses the CLI those directories will be created. (In PR) Readme should not link to https://git.magnolia-cms.com/projects/demos/repos/minimal-headless-spa-demos/browse, that is very confusing as it is a different projects also with different directory structure. (In PR) For ngrok - should have one sentance about why we use it in the demo. Should not use "brew" as I believe thats Mac only. (In PR) For netlify - we cannot link to SaaS docs. Those aare not public and are a different context for now. For netlify and vercel - I think it will currently rebuild site when any file changes, that's not what a developer wants - it should not update when light-modules change, only when frontend project changes. For netlify - can we not include a netlify configuration file? For vercel - can we not include a vercel configuration file? Why does "Modify our code" include last step "Rollback (2)"? Added PR to address some of these marked (PR) above: |
| Comment by Phong Le Quoc [ 06/Apr/23 ] |
|
— Why does "Modify our code" include last step "Rollback (2)"? — This rollback and .env.local mean SPA run on local and when we publish pages, Netlify will be redeployed by our webhook trigger. Our main purpose.
If we connect direct Magnolia CMS and Netlify, the pages always rebuild already for editing. So webhook is not needed |
| Comment by Phong Le Quoc [ 06/Apr/23 ] |
|
– For netlify and vercel - I think it will currently rebuild site when any file changes, that's not what a developer wants - it should not update when light-modules change, only when frontend project changes. – That is configuration on Netlify. It will rebuild when any changes on Git.
Active buildsNetlify will build your site according to your continuous deployment settings when you push to your Git provider.
Stopped buildsNetlify will not build your site automatically. You can build locally via the CLI and then publish new deploys manually via the CLI or the API.
I don't know if there is any config to custom this.
|
| Comment by Christopher Zimmermann [ 06/Apr/23 ] |
|
Oh I didn't get that "Rollback (2) meant to undo the changes in step 2 above, I see. But is it really needed? I guess it just makes the developer experience better if they continue to work on the SPA locally - is that the idea? Assuming yes - how about changing to "Optionally, rollback the changes in step (2) above - then the Page Editor will load your local SPA so you can keep developing it." I don't understand "If we connect direct Magnolia CMS and Netlify, the pages always rebuild already for editing. So webhook is not needed". Without the webhook, then pages would not rebuild on a content publication right? |
| Comment by Christopher Zimmermann [ 06/Apr/23 ] |
|
Regarding " it should not update when light-modules change, only when frontend project changes." Maybe this is possible with "ignore" command, but actually it looks kind of tricky to get it right. For example if a push includes changes to SPA and light-modules then we want it to still build. It would be great if you can investigate a bit, but lets do like a 1 hour time box, because it might be a rabbit-hole (hard to do.), and not worth it. See: https://docs.netlify.com/configure-builds/file-based-configuration/ |
| Comment by Phong Le Quoc [ 07/Apr/23 ] |
|
1. You are right. In addition, I want to show the effect of publication/webhook (see item 2). We might change to Optionally, rollback the changes in steps (1) and (2) above - then the Page Editor will load your local SPA so you can keep developing it. and remove Duplicate webhook-ssg-demo/.env to .env.local 2. Yes, without webhook the pages would not rebuild on a content publication. But the pages are always rebuilt when we edit them. So we don't need to rebuild when publication.
|