helpers
helpers copied to clipboard
Use declarative approach for scripts
Many times we want to reach a state (e.g., add people to a certain repo, set a set of labels in a repo, ...). For this kind of work, we want to use a paradigm like:
- Specify the state we want to reach
- The script understands what's the different between the current and target state
- E.g., we want to have N people added to the repo, but now there is a subset M of them -> so we need to add N - M
- A --dry-run mode allows to see / validate the plan
- A --backup mode saves the state before changing it
- When we run the script, a log with the summary of what was done is generated to inspect
This is an extension of our incremental / idempotent approach.
- It also makes it easy to roll back changes (using --backup)
We should:
- [ ] Document it somehow
- [ ] Write the new scripts to use this approach
- [ ] Start back porting the old scripts
FYI @heanhsok @Shaunak01 @Shayawnn @indrayudd @tkpratardan @aver81 @aangelo9 @madhurlak0810 @sandeepthalapanane
Let's assign it to @sandeepthalapanane since a couple of his scripts can use this approach (the repo sync and managing the GH invites)