Skip to content
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

Add sastre and tailor CLI options for apply_pr #62

Merged
merged 8 commits into from
Aug 24, 2018

Conversation

gdalmau
Copy link
Contributor

@gdalmau gdalmau commented Jun 24, 2018

Description

Allow to use apply_pr as sastre or tailor.

See sastre --help or tailor --help

$ sastre --help
Usage: sastre [OPTIONS]

Options:
  --owner TEXT           GitHub owner name  [default: gisce]
  --repository TEXT      GitHub repository name  [default: erp]
  --host TEXT            Host to apply  [required]
  --src TEXT             Remote src path  [default: /home/erp/src]
  --pr TEXT              Pull request to apply  [required]
  --from-number INTEGER  From commit number
  --from-commit TEXT     From commit hash (included)
  --force-hostname TEXT  Force hostname
  --help                 Show this message and exit.

Development

  • Add console scripts for sastre and tailor
  • "Deprecate" apply_pr (show a warning message that you can use sastre and tailor)
  • Create a decorator to add command options (based on Support for shared arguments? pallets/click#108 (comment)) and define common options for the different commands
  • Update README documentation
  • Update WIKI usage documentation

@ecarreras
Copy link
Member

It looks very well! Maybe we can use this to add subcommands to sastre/tailor instead to have N commands as pointed in #31 (comment)

For example:

sastre deploy 2456 ssh://user@host

@gdalmau gdalmau added WIP and removed to be merged labels Jul 10, 2018
Jaume Florez added 5 commits August 13, 2018 18:23
- Remove redundant code with alias
- Add empty command catcher
- Add all current commands into the new group
- Add __doc__ to all current commands
- Set CHECK_PR to DEPRECATED
- Click will use the new commands throgh "call" methods
- The "apply_pr" can be imported and used from 3rd party for the following commands
  - apply_pr
  - status_pr
  - check_prs_status
@jaumef
Copy link
Contributor

jaumef commented Aug 13, 2018

I've updated this to work as a click group (as "sastre COMMAND ARGUMENTS [OPTIONS]")

  • ADD tailor Click.Group
  • REMOVE Entry Points for old commands
  • ADD tailor/sastre Entry Point to tailor group
  • ADD docs to methods
  • ADD Deprecation to "check_pr"

Also encapsulated some commands so we can use them from apply_pr package:

  • apply_pr (now the command is called deploy)
  • status_pr (now the command is called status)
  • check_prs_status (now the command is called check_prs)

New usage:

sastre --help
Usage: sastre [OPTIONS] COMMAND [ARGS]...

Options:
  --help  Show this message and exit.

Commands:
  check_pr          DEPRECATED - Check for applied commits on PR
  check_prs         Check the status of the PRs for a set of PRs
  create_changelog  Create a changelog for the given milestone
  deploy            Deploy a PR into a remote server via Fabric
  status            Update the status of a deploy into GitHub

@ecarreras
Copy link
Member

I've added a new item in the checklist to modify the README documentation

@ecarreras ecarreras merged commit f9caff4 into devel Aug 24, 2018
@ecarreras ecarreras deleted the add_sastre_cli_for_apply_pr branch August 24, 2018 06:10
@ecarreras ecarreras mentioned this pull request Aug 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants