Repository navigation
Support default base repositories - #7
Conversation
| ``` | ||
|
|
||
| Additionally, if there is a repository in the org named `.github`, it will be | ||
| used as a base repository if none is specified. |
There was a problem hiding this comment.
Do you think you could add a config example for how this works? Would it just be files without the _extends?
There was a problem hiding this comment.
The config example below is does that...is there something more you would like to see in it?
There was a problem hiding this comment.
would this work for personal accounts, too? Say I’d create gr2m/.github to see defaults for apps that I install, would that work?
There was a problem hiding this comment.
@gr2m, yes, that would be the intention.
|
And I reviewed without updating my much longer comment facepalm after I realized my first comment was irrelevant. Any ways, I realized that you implemented version 2 of #1 (comment) which has some risks, such as the danger of certain bots and their destructive power, like stale, see: atom/atom#15494. There are definitely use cases where orgs might want 1 or a few repos excluded from the universal configs, but maybe that could be added to the specific repos through a I think if we do go this route, we need to make it more explicit in the readme the universal power over repos that the |
Would it be sufficient for such repos to just specify all the settings they want to have control over? It's not perfect, but it does keep things simple. |
|
From the best practices docs
☝️is one thing we need to consider with adding this functionality. I don't think having a file in the A few ideas:
|
|
What is the bulk action in this instance?
If this is something that requires a config in the individual repository, it works against one of the purposes of this feature (to have configurations for some repos without adding any files).
I think this would work. |
Might be more efficient/practical for large orgs to have a list of disabled repositories. Also thanks @bkeepers for better explaining the destructive power of "bulk actions"! |
|
I agree with the convenience of listing disabled repos, but a couple thoughts thoughts:
Maybe we could have some config that says whether the list is an opt-out list or an opt-in list? |
|
Hmm, that's a good point, I was thinking more about convenience.
That could be doable, but is a bit more painful implementation wise. |
|
Yes, it would be =\ Maybe something else we could do is rather than an opt-in list of repos, we have an opt-in list of repo patterns/regexes...if someone wants all, they can just use Another issue is that once the |
|
When you install the GitHub app, you select whether you want it installed for the org or select repositories. Is that itself not sufficient control for which repositories the application is applied to? What does an additional list of either included or excluded repos in the probot config add that isn't accomplished by simply choosing which repos to install the app on? (I feel like I'm most certainly overlooking something, so am genuinely curious) |
|
@willnorris the main reason for an include exclude list is that some apps (like stale) have power to take bulk action that may not be wanted on every single repo which is the reasoning for the opt out/opt in. I think in this case however, there's a lot of folks who want only some of their repositories to have the app act on them. Therefore, I think we should move forward with an optOut list that includes only repositories you don't want the app to act on.
New repos are usually empty and without issues/PRs, which are usually things the apps need to act on, so I'm not super worried about this use case. I think the solution is being extremely explicit in our docs about the power of the
I'm not opposed to this for the future, but I think v1.0 of org wide config should just be an opt out list. |
|
I was imagining that the org-wide config would be treated as a default, but not an automatically extended base config. So if there is a repo config, then only that file applies. That file can choose to extend another config, but that doesn't happen automatically. If there is no repo config, then the org config applies if present. You can achieve both opt-out and opt-in flows depending on how you name the config file in your org config. Opt-out# octocat/.github:stale.yml
daysUntilStale: 60
daysUntilClose: 7
# octocat/repo1
# no explicit .github/stale.yml file, so org config applies
# octocat/repo2:.github/stale.yml
# empty file. opted out of org config
# octocat/repo3:.github/stale.yml
# explicitly extends base config, and overrides some values
_extends: octocat/.github/stale.yml
daysUntilStale: 30Opt-inTo achieve opt-in, you simply rename the org-wide file, for example by prepending an underscore. This means that there technically isn't a default org-wide config that gets automatically applied, but there is a base file that can be extended on an opt-in basis. # octocat/.github:_stale.yml
daysUntilStale: 60
daysUntilClose: 7
# octocat/repo1
# no explicit .github/stale.yml file, so the stale app never does anything
# octocat/repo2:.github/stale.yml
# explicitly extends base config, thereby opting in to the org-wide config.
# Can optionally override values if desired
_extends: octocat/.github/_stale.yml@cco3 reminded me that some apps might choke on the empty files, since they may be assuming that certain values are present. We'd need to double check that. Would this cover the use cases people have in mind? (We walked through all of Google's use cases, and are pretty sure this covers ours) |
|
The idea of renaming the org wide file and prepending it with a special character like an underscore had not occurred to me, and I really like it! 👍 But I'd like to hear some more feedbacks from other folks in @probot/maintainers about this topic, since there are so many different use cases for this. |
I feel like what's outlined in #7 (comment) is a pretty solid solution, given that it allows for an Org to explicitly opt-in or opt-out all its repositories to the config. What worries me is we don't have any way to ensure the downstream repositories have access to view the default config. It's possible for an admin to configure permissions on the I'm not sure if there's a scalable way to enforce this at the moment, and I think it's an edge case, but we should at least write documentation to state that an admin should ensure that everyone in the Org has at least |
Agreed. This sounds like an organizational problem that is outside the scope of probot (an org owner can do a LOT of things that individual repo admins can't control, far beyond just probot). But adding clear documentation of best practices sounds like a clear win. |
|
Someone else commented and then deleted their comment, but it raises a good point:
Yes, I would certainly think that it should. I'm pretty sure the current implementation in the PR is agnostic to whether it's an org or user repo, but we should definitely verify that. I can't think of a good reason why this shouldn't also work for personal accounts. |
|
It was me who commented 👋 I also think it’ll work :) I still see my comment here: https://github.com/probot/probot-config/pull/7/files#r191297970 But odd that the comment is not appearing in the PR timeline
|
aha, found it. It's in the thread above 😄 |
|
OK, I'll rework this change to conform to @willnorris's suggestion. |
|
Change updated |
|
Friendly ping. Does this change look alright? Anything I should change? |
|
Sorry for the delay! I'd love to see a more extensive documentation update according to what we've discussed here and would be happy to help with that if necessary. I think the examples outlined in #7 (comment) are a great starting point for this. |
|
OK, I'll add something. All the functionality has been described in the README, so at this point we are talking about offering recipes for common problems. I'm not sure whether or not this should go in its own section. I'll write something up, but feel free to chime in if you have opinions. |
|
I agree since this is pretty major, it might warrant it's only section, to be as clear as possible. |
|
OK, well this is a good exercise, because as I write it, I realize that specifying the path of an inherited file wasn't already part of the functionality. How would we prefer to do this? Like @willnorris said: Or we could standardize on the
We'd be introducing something mildly backwards incompatible given that the previous change would use this and grab a file without an underscore, but I'm not sure if that's a major concern since that was never in a versioned release. |
|
OK, I think using syntax similar to what @willnorris suggested would be best, given that one may want to have several alternative configurations at different paths in a .github project. Anyway, I've put up another change at #8 for this. |
bkeepers
left a comment
There was a problem hiding this comment.
I really like this approach, and agree we can solve the bulk actions issue with documentation.
Thanks @cco3 and @willnorris for pushing us toward this solution.
|
Thanks! This isn't ready to merge just yet:
|
That can maybe wait for a followup PR? It would be nice to get this merged so folks can start testing it out and reporting back any issues. :) |
|
Out of date comment, sorry. It's already written at this point. |
|
So is this ready to 🚢 from your perspective @cco3 ? |
This change considers `.github` within the same org to be a default base repository if none is specified. This works even when no config file is specificed in the inheriting repository.
|
Yes, just rebased it on the other change...good to go. |
|
Thanks so much for your work on this @cco3! I'm excited to see organizational level config become easier through probot 🎉 |
|
No problem! Happy to help! |
This change considers
.githubwithin the same org to be a defaultbase repository if none is specified. This works even when no config
file is specificed in the inheriting repository.
Issue: #1
Dependency: #6