Add optional --skip-git-repos option to bake_config.py script #991
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Use Case
We license external Toolkit bundles from GPL (@GPLgithub) and also develop our own TK bundles in house which we store in our Github org repos. In order to maintain their code privacy, the TK config lives in GPL's org on Github. When a new version is tagged, a CI job is run that bakes the GPL bundles into our config using the
developer/bake_config.py
script with the command:This works great except that it bakes all of the bundles of
type: git
, which includes our internal bundles resulting in a very bloated config with lots of unnecessary bundles baked in (Our users have access to our org's repos and don't need our bundles baked into the config).Proposed Change
This PR adds an optional
--skip-git-repos
option to augment the existing--skip-bundle-types
option. It accepts 1 or more comma-separated string patterns that will be matched with hosted git repo names. Any bundle using agit
,git_branch
, orgithub_release
descriptor type will have the filteredpath
value checked with each of the string patterns provided. If there is a match, the bundle will be skipped and not be baked into the config.Descriptor path values are filtered down to their
organization/repo
name for the (case-insensitive) comparisons. So the path value,[email protected]:someorgname/tk-multi-someapp.git
would have a value ofsomeorgname/tk-multi-someapp
for the comparison.Examples:
--skip-git-repos someorgname/tk-multi-someapp
would skip any hosted git repo starting withsomeorgname/tk-multi-someapp
--skip-git-repos someorgname/
would skip any hosted git repo in the organizationsomeorgname
--skip-git-repos someorgname/tk-multi-someapp, anotherorg/
would skip any hosted git repo starting withsomeorgname/tk-multi-someapp
and any repo in the organizationanotherorg
For our use-case described above, we want to skip baking all of the git repos hosted in our organization so we only bake GPL's bundles.
CI checks
Happy to modify code as-needed to get tests passing. I don't have visibility into the violations remaining however. :)