isomerpages / isomercms-backend

A static website builder and host for the Singapore Government
5 stars 1 forks source link

fix(rollback handler): convert to ts for safety #1044

Closed kishore03109 closed 10 months ago

kishore03109 commented 10 months ago

Now that there exists commits to 2 different branches, there needs to be a rollback handler to cater for the case of network failures that exist for a commit to 1 branch. else, we might have a scary situation whereby staging-lite updates, but staging doesnt, and this leads to a wrongly output production site. this effectively means that there should be any use of the writeroutehandler since any write can lead to deviation of staging and staging lite

Note that we dont need to do any thing with regards checking if a site is whitelisted for quickie since all sites have the staging lite branch infra already set up. the whitelisting only dictates whether or not the staging lite file gets updated or not.

Previously, we were not using the rollback properly, this pr converts the file to ts to allow for easier type checking. there were also some weird errors that occured that could be avoided with the retry. however, staging lite needs to be pushed with a .push(gitOptions), which the retry mechanism does not have. as a bandage, retry twice with the options, check in with @harishv7 on why there exists a retry in GitFileSystemService in the first place.

Manual tests for rollback handler

[Testing for quickie whitelisted site that is GGs]

[Testing for non-quickie whitelisted site that is GGs]

[Testing for GH sites for rollback handler] (all gh sites are NOT whitelisted for quickie)

[Testing normal crud operations]

Tests

In staging environment, kishore-test is quickie + zhongjun-test-amplify is NON-quickie + kishore-test-dev-gh on github (non qucikie)

kishore03109 commented 10 months ago

Current dependencies on/for this PR:

This stack of pull requests is managed by Graphite.

kishore03109 commented 10 months ago

Merge activity