-
-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: implement pizza offboard
command
#207
base: beta
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This works, but it wasn't clear to me that I had to put a space between people or emails I wanted to offboard. I tried using a comma initially.
It'd also be nice to detect the .sauced.yaml like we do with generate.
A future feature could be loading a CSV of people to offboard, but now I'm scope creeping. 😅
const offboardLongDesc string = `[WIP] Removes a user from the \".sauced.yaml\" config and \"CODEOWNERS\" files. | ||
Requires the user's name OR email.` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of [WIP]
, could be "Caution: Experimental command."
Could also include examples
like we do elsewhere
opts.ttyDisabled, _ = cmd.Flags().GetBool("tty-disable") | ||
opts.configPath, _ = cmd.Flags().GetString("config") | ||
|
||
opts.path, _ = cmd.Flags().GetString("path") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This flag likely needs to get marked as required. Otherwise, it attempts to use the default value:
❯ pizza offboard jpmcb
Error: error generating config file: error creating file: open : no such file or directory
|
||
return nil | ||
}, | ||
RunE: func(cmd *cobra.Command, _ []string) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should also initiate a Posthog client / runner for use with this command.
err = generateConfigFile(opts.configPath, attributions) | ||
if err != nil { | ||
return fmt.Errorf("error generating config file: %v", err) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something here seems to be broken since I get errors when it tries to re-generate the config if I don't provide a config:
pizza offboard jpmcb -p ./
I'd expect it'd look in the directory provided by -p
to actually find a .sauced.yaml
or fallback to the one in the user's home directory
Description
Implements a new
pizza offboard
command that allows the user to offboard someone from the.sauced.yaml
config andCODEOWNERS
files by their attributed name or email.Related Tickets & Documents
Closes #117
Mobile & Desktop Screenshots/Recordings
Steps to QA
.sauced.yaml
andCODEOWNERS
filespizza offboard <usernames/emails>
with the user(s) you want to offboardpizza offboard zeudev [email protected]
--path
(-p
) flag to specify what repository you are updating--config
(-c
) global flag to specify the configTier (staff will fill in)
[optional] What gif best describes this PR or how it makes you feel?