-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
dev-cmd/contributions: Quarters are our most common unit of time #21023
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
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.
Pull Request Overview
This PR adds a --quarter= flag to the brew contributions command to simplify querying contributions by calendar quarter, eliminating the need to manually calculate and input date ranges with --from and --to flags.
- Adds
--quarter=flag that accepts quarter values and defaults to the current quarter - Updates date calculation logic to derive from/to dates from the specified quarter
- Adds
quarter_dateshelper method mapping quarters (1-4) to ISO 8601 date ranges for the current year
Reviewed Changes
Copilot reviewed 1 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| Library/Homebrew/dev-cmd/contributions.rb | Implements quarter flag, quarter-to-date conversion logic, and updates command documentation |
| Library/Homebrew/sorbet/rbi/dsl/homebrew/dev_cmd/contributions.rbi | Adds Sorbet type signature for the new quarter method |
Files not reviewed (1)
- Library/Homebrew/sorbet/rbi/dsl/homebrew/dev_cmd/contributions.rbi: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@issyl0 Unfortunately we don't do the dates on raw quarters. The last few dates we've done have been: |
|
Of course we don't - that would be too obvious. 😉 |
|
@issyl0 Stop wait 😅! I still think this PR would be worthwhile, it's just maybe that we default to those |
|
We've already changed invoice dates once, haven't we? And it wasn't too bad? Having "OK it's the start of a new quarter let's check eligibility for people's submissions" is more intuitive because it aligns with calendars? But also if you want to default this quarter detection to the Homebrew quarters, I will - as long as Q1 starts in January and Q4 ends in December? 😱 |
We could change it but the reason we changed last time is to align so we'd know before people booked FOSDEM flights in December?
Who knows 😭 |
|
Could even do something wild like |
25dc0ce to
14d8d22
Compare
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.
Pull Request Overview
Copilot reviewed 1 out of 2 changed files in this pull request and generated 2 comments.
Files not reviewed (1)
- Library/Homebrew/sorbet/rbi/dsl/homebrew/dev_cmd/contributions.rbi: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
MikeMcQuaid
left a comment
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.
Thanks @issyl0, looking great! Think once comments are addressed this should be good to self-merge.
- We frequently assess contributions over quarters. Inputting the dates in `--from` and `--to` requires effort and can lead to missing a day's contributions upon misremembering "thirty days hath September, April, June, and November...". - Hence, add a `--quarter=` flag to specify the quarter to search. If omitted, the past year is used as before. If `--from` or `--to` are set, they take precedence over `--quarter=`. - The `--quarter` option is only valid for the current year. To look at previous years, use `--from` and `--to` as before.
- These aren't standard quarterly dates. We've chosen our own so that we can use September to December's maintainer activity stats as part of checking eligibility for expensed attendance at the AGM in February each year.
14d8d22 to
198e2be
Compare
brew stylewith your changes locally?brew typecheckwith your changes locally?brew testswith your changes locally?--fromand--torequires effort and can lead to missing a day's contributions upon misremembering "thirty days hath September, April, June, and November...".--quarter=flag to specify the quarter to search. If omitted, the past year is used as before. If--fromor--toare set, they take precedence over--quarter=.--quarteroption is only valid for the current year. To look at previous years, use--fromand--toas before.Before:
After: