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

Bug: --period flag is broken #66

Open
2 tasks done
jpmcb opened this issue Nov 6, 2023 · 2 comments
Open
2 tasks done

Bug: --period flag is broken #66

jpmcb opened this issue Nov 6, 2023 · 2 comments
Labels
🐛 bug Something isn't working pizza-cli

Comments

@jpmcb
Copy link
Member

jpmcb commented Nov 6, 2023

Describe the bug

The period flag seems to have broken at some point:

❯ pizza insights contributors https://github.com/open-sauced/app -p 45
Error: error while calling 'ContributorsServiceAPI.FindAllChurnPullRequestContributors' with repository 501028599': 400 Bad Request
error while calling 'ContributorsServiceAPI.NewPullRequestContributors' with repository 501028599': 400 Bad Request
error while calling 'ContributorsServiceAPI.FindAllRecentPullRequestContributors' with repository 501028599': 400 Bad Request
error while calling 'ContributorsServiceAPI.FindAllRepeatPullRequestContributors' with repository 501028599: 400 Bad Request

Usage:
  pizza insights contributors url... [flags]

Flags:
  -f, --file string    Path to yaml file containing an array of git repository urls
  -h, --help           help for contributors
  -p, --period int32   Number of days, used for query filtering (default 30)

Global Flags:
      --beta                Shorthand for using the beta OpenSauced API endpoint ("https://beta.api.opensauced.pizza"). Supersedes the
                            '--endpoint' flag
      --disable-telemetry   Disable sending telemetry data to OpenSauced
  -e, --endpoint string     The API endpoint to send requests to (default "https://api.opensauced.pizza")
  -o, --output string       The formatting for command output. One of: (table, yaml, csv, json) (default "table")

Steps to reproduce

  1. call the insights command with a repo and the -p / --period flag defined
  2. Notice the 400, bad request responses

Browsers

No response

Additional context (Is this in dev or production?)

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

Contributing Docs

  • I agree to follow this project's Contribution Docs
@jpmcb jpmcb added the 🐛 bug Something isn't working label Nov 6, 2023
@k1nho
Copy link
Contributor

k1nho commented Nov 7, 2023

I think this might be because the API only accepts 7,30,90 as valid range values, so any other value just fails.

@jpmcb
Copy link
Member Author

jpmcb commented Nov 7, 2023

Ahh, you're totally right. Great catch @k1nho - it's pretty confusing from the pizza CLI perspective to not have some of that information surfaced. Maybe we consider adding a client side restriction so you can only enter valid API values.

@k1nho k1nho mentioned this issue Nov 9, 2023
19 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working pizza-cli
Projects
None yet
Development

No branches or pull requests

2 participants