Netflix / hubcommander

A Slack bot for GitHub organization management -- and other things too
Apache License 2.0
1.28k stars 156 forks source link

!CreateRepo should have a team parameter #28

Closed jaybrueder closed 6 years ago

jaybrueder commented 7 years ago

Currently, the !CreateRepo will always assign a new repo to the specified default team.

However, I want to choose the target team in the command like so:

!CreateRepo <NewRepoName> <GitHubOrgAliasToPutTheRepoInToHere> <TargetTeam>

<TargetTeam> could be an optional parameter. If it is not supplied, the repo will go into the default team. Just like the current behaviour. If it is supplied, it will got into the specified team instead.

I would be happy to modify the !CreateRepo command and supply a pull request.

mikegrima commented 7 years ago

Hi @jaybrueder !

This is not currently on my roadmap, but you are more than welcome to submit a PR for it -- provided that we have the ability of disabling that capability.

Primary reason is that for my use case, we have tight enforcement around which teams are granted access.

Thanks!

mikegrima commented 7 years ago

This will be dependent on #30 . I plan on refactoring some of the logic for argument parsing, as it is currently very copy+pasty.

This will make it easier to have required and optional arguments so these types of features can be easily added in the future.

mikegrima commented 7 years ago

Hello @jaybrueder !

I have been hard at work on #30 via #40 , and am currently in the process of converting all the existing commands over to the new decorated model.

We will need to think about how to make optional arguments toggleable via the plugin configuration. I have some neat ways for checking things in my decorator -- but would like to find ways to make things a bit more streamlined.

If you get a chance, please review #40 , and let me know if there are spots where we can make this this particular feature more doable.

yaron-idan commented 7 years ago

I've also ran into this requirement in our use of hubcommander. How about implementing a new command to add specific permissions to teams? For example - change team permissions from pull to push - !ChangeTeamPermissions <RepoName> <TeamName> <NewPermission>?

mikegrima commented 7 years ago

@yaron-idan That makes sense.

This is not high on my priority list for this quarter. But would be happy to merge in a PR for that command.

yaron-idan commented 6 years ago

Cool, I've opened a PR with the code for this command, would be happy if it can be reviewed.

mikegrima commented 6 years ago

@yaron-idan Neat! I will take a look within the next few days.

mikegrima commented 6 years ago

Implemented and merged in #78