Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(bake): lightning deploys populate gdoc metadata #2907

Merged
merged 7 commits into from
Nov 12, 2023

Conversation

marcelgerber
Copy link
Member

@marcelgerber marcelgerber commented Nov 8, 2023

Fixes #2906.

❗ I didn't test this in any way yet!

The underlying issue here was that gdoc properties like linkedDocuments and imageMetadata didn't get populated in the lightning deploy code path (bakeGDocPost).

I instead extended bakeGDocPosts to optionally take an array of slugs that it should bake, and bake every published gdoc otherwise.

✅ In order to reenable lightning deploys, we will also have to revert ab2b183.

@ikesau
Copy link
Member

ikesau commented Nov 8, 2023

Thanks for this @marcelgerber !

I got rid of one last snag which is that posts with a new {.image} would be considered as only having updates to their body, thus triggering a lightning update (even though they would need new images to be baked)

So by correctly populating the before & after objects, and including imageMetadata in the list of properties to diff when determining if the update is a lightning update, we now trigger bakes correctly in all cases.

I tested this by running a local deploy server and trying various permutations:

  • Republish article with content changes only → only article is rebaked
  • Republish article with image, content changes only → only article is rebaked
  • Republish article with new image referenced → full bake
  • Republish article by removing an image → full bake
  • Start deploy server with two lightning updates in .queue → only both articles rebaked
  • Start deploy server with one lightning update and one regular update in .queue → full bake

The bolded case is not ideal behaviour, technically we only need to rebake the article there, but I don't think it's that common a usecase and the simpler we can keep lightning updates, the better IMO 🙂

@marcelgerber
Copy link
Member Author

Nice, thank you!

Copy link
Member

@ikesau ikesau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feel free to double check my working 😉

@marcelgerber marcelgerber merged commit 8752e9b into master Nov 12, 2023
12 checks passed
@marcelgerber marcelgerber deleted the fix-lightning-deploys branch November 12, 2023 06:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Lightning deploys cause broken pages
2 participants