class Clean: tools = Steps(Echo("Reinstalling tools due to passed --clean flag."), Newline()) check = Warn( """ Removing archive due to passed --clean flag. """ )
class UpdateEmail: leader = Steps( Echo( Multi( [ "Registration: ", Text( "We’ll use your email to provide support and share product updates. You can unsubscribe at " "any time.", style={"dim": True}, ), ], processor=Processors.wrap(extra=8), ) ), Newline(), ) prompt = Prompt("What is your email address?") failure = Steps( Newline(), Warn( "We were unable to subscribe you to the Bento mailing list (which means you may miss out on " "announcements!). Bento will continue running. Please shoot us a note via [email protected] to debug. " ), )
class Check: unnecessary = Steps( Echo("Bento archive is already configured on this project."), Newline()) prompt = Confirm("Analyze this project for the first time?", options={"default": True}) header = Box("Bento Check") noninteractive = Warn( "Skipping project analysis due to noninteractive terminal.")
class Install: learn_more = Text( "To learn more, see the README.", processor=Processors.wrap_link([ Link( "README", "https://github.com/returntocorp/bento/blob/master/README.md#running-in-cicd", ) ]), ) banner = Steps( Echo( Multi( [ "Configuring a GitHub Action to automatically check your team's pull requests. ", learn_more, ], processor=Processors.wrap(), )), Newline(), ) progress = Progress( content=Multi([ "Creating GitHub Action configuration at ", Sub(0, style={ "bold": True, "dim": True }), Text("/", style={ "bold": True, "dim": True }), ]), extra=24, ) after_progress = Newline() finalize_ci = Steps( Warn("To finalize configuration of Bento's GitHub Action, please:"), Echo( Multi([ " $ git add .github/\n", ' $ git commit -m "Add Bento GitHub Action"\n', " $ git push\n", ])), )
class Overwrite: warn = Steps( Echo( Multi([ "It seems Bento is already installed for GitHub Actions at ", Sub(0, style={"bold": True}), ])), Newline(), Warn("If you continue, Bento will revert any changes " "you might have made manually to this CI configuration file."), Newline(), ) confirm = Confirm( "Do you want to revert Bento's GitHub Action to the default configuration?" ) after_confirm = Newline()
class Identify: success = Steps( Newline(), Echo(Multi(["Bento initialized for ", Sub(0, style={"bold": True})])), Newline(), ) failure = Steps( Newline(), Warn( "Bento can't automatically identify this project. Please manually configure this project:" ), Echo( Multi([ _step_item("configure a tool manually", "bento enable tool TOOL"), _step_item("list available tools", "bento enable tool --help"), ])), )