github-community-projects / github-community-projects/safe-settings
❗ Significant changes coming in `safe-settings` v2
- Dominant language
- JavaScript
- Stars
- 921
- Forks
- 226
- Avg merge
- 18h 3m
- Merged PRs (30d)
- 14
Description
## Background
This issue is to inform you that some significant changes are coming with #194 PR.
The full list of changes could be observed [here](https://github.com/github/safe-settings/compare/decyjphr/suborg-scalability..main-enterprise):
The `suborg-scalability` branch has been kept up to date with the changes in main-enterprise. The list of changes that are in `main-enterprise` and not in `suborg-scalability` are [here](https://github.com/github/safe-settings/compare/decyjphr/suborg-scalability...main-enterprise) (Hopefully there are none by the time we merge )
## Why
### New features being added:
1. `safe-settings` will not call ` syncAll` for subOrg changes. It will instead call ` syncSubOrgs` which builds the subOrg configs and repo configs for the specific repos based on the subOrg config.
2. `safe-settings` can now scale to 1000s of repos because it compares the current configuration in GitHub with the changes being applied and only calls the API if there are changes
3. In order to scale for 1000's of repos, when a PR is created for config changes, the check will not produce a verbose list of changes.
4. If there are multiple repo and suborg config file changes in a `push`/`commit`, the code will process every config file in the commit : [case1](https://github.com/github/safe-settings/blob/a1c3eef62a8bdb53ae67248f0e1760ea61b805b9/index.js#L241), [case2](https://github.com/github/safe-settings/blob/a1c3eef62a8bdb53ae67248f0e1760ea61b805b9/index.js#L248)
1. To make it easy to try`safe-settings`, you can now turn it on for only specific repos and allow for more gradual adoption. To enable it for specific repos use the `include` setting in the [`deployment-config.yml`](https://github.com/github/safe-settings/blob/decyjphr/suborg-scalability/docs/sample-settings/sample-deployment-settings.yml) file:
```yaml
restrictedRepos:
# You can exclude certain repos from safe-settings processing
# If no file is specified, then the following repositories - 'admin', '.github', 'safe-settings' are exempted by default
exclude: ['admin', '.github', 'safe-settings']
# Alternatively you can only include certain repos
include: ['test']
```
### Additional Toil
- It is a lot of work to keep the `suborg-scalability` up to date with changes in the `main-enterprise` branch - More conflicts, more testing etc.
- Avoid features already in the branch to be re-invented in the `main-enterprise` branch
## Risks
- There is a potential that some things that were working in `main-enterprise` could be broken (inadvertently) after the merge.
- Any WIP in forks would require additional effort to integrate the new changes.
## Versioning
I'll start a new version with these changes as `2.x`
Also, I am planning to create a branch with the code from the current `main-enterprise`
## Next Steps
- Please add your comments to indicate your opinion on this merge
- The merge won't happen for a few days; weeks, if that is the prevailing opinion.
- If you can test the code in the branch, thank you 🙏🏾
Contributor guide
Assessment
This issue has not been assessed yet.