Applies a set of automated changes to a AWS TF fork working directory.
yarn
- restore packagesyarn apply --cwd [DIR]
- apply patches to a directoryyarn suggest --cwd [DIR]
- generate suggestions for pending replacements and write into the manual replacements.- Search for "TODO" in
patches/manualReplacements.json
for pending docs fixes. - Re-apply patches once edited.
- Consider failure cases:
- Worst case is replacing something we shouldn't.
- Second worst is missing a replacement without warning.
- Throwing an error due to an unexpected scenario is a good outcome.
- Instruct the user how to fix the issue in the patcher.
- Aim for patches to be idempotent. Re-applying a patch multiple times should have no adverse effects.
- Generate a diff
git diff v4.35.0..upstream-v4.35.0 > upstream.patch
- Convert diff to replacements
yarn start parse-patch upstream.patch --outFile patches/patchReplacements.json
Approximate method:
Parse diff for website/docs
files (ignore renames and internal/service
)
- Find diffs where the same line has a removal and addition (rewrite). Create replacements for where "terraform" or "hashicorp" has been removed.
- Find diffs where a single note has been removed.
- Find diffs where a block of text has been removed.