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

feat: Document review request events in Timeline struct #3391

Merged
merged 3 commits into from
Dec 17, 2024

Conversation

jbrill
Copy link
Contributor

@jbrill jbrill commented Dec 16, 2024

Add review request event documentation to Timeline struct

Updates the Timeline struct documentation to include review request-related events that were missing from the Event field description, matching the GitHub API behavior.

Changes

  • Added documentation for review_requested event
    • Occurs when an actor requests a review from a user/team
    • Notes that Requester or RequestedTeam will be populated
    • Reviewer will be populated
  • Added documentation for review_request_removed event
    • Occurs when an actor removes a review request
    • Reviewer will be populated
    • Notes that Requester or RequestedTeam will be populated

These events were already supported in the implementation via the corresponding struct fields, but were missing from the Event field's documentation.

Local Testing

  • Ran the test suite locally to ensure all changes are functioning as expected.
  • Verified that the documentation updates do not affect existing functionality.

Tests Written

  • Test: TestTimeline_ReviewRequests
    • Validates the handling of review_requested and review_request_removed events.
    • Ensures that the Requester and Reviewer fields are correctly populated.
    • Confirms that the Timeline struct accurately reflects the GitHub API's behavior for these events.

@jbrill jbrill marked this pull request as draft December 16, 2024 17:29
Copy link

codecov bot commented Dec 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.21%. Comparing base (2b8c7fa) to head (d5b9f7e).
Report is 201 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3391      +/-   ##
==========================================
- Coverage   97.72%   92.21%   -5.51%     
==========================================
  Files         153      173      +20     
  Lines       13390    14770    +1380     
==========================================
+ Hits        13085    13620     +535     
- Misses        215     1060     +845     
  Partials       90       90              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jbrill jbrill force-pushed the reviewer-docs-issue-timeline branch from f46f7be to 4a77129 Compare December 17, 2024 15:57
@jbrill jbrill marked this pull request as ready for review December 17, 2024 16:05
@jbrill jbrill changed the title docs: review_requested and review_request_removed to issues_timeline.go feat: add review_requested and review_request_removed to event types as comment in issues_timeline.go Dec 17, 2024
@jbrill jbrill changed the title feat: add review_requested and review_request_removed to event types as comment in issues_timeline.go feat: document review request events in Timeline struct Dec 17, 2024
@jbrill jbrill force-pushed the reviewer-docs-issue-timeline branch 2 times, most recently from 7986ead to 041b2dd Compare December 17, 2024 16:35
@jbrill
Copy link
Contributor Author

jbrill commented Dec 17, 2024

I've run all the scripts in step 4 of CONTRIBUTING.md. I believe this is ready for review 👍

@jbrill jbrill force-pushed the reviewer-docs-issue-timeline branch 2 times, most recently from 041b2dd to da5b558 Compare December 17, 2024 16:54
@jbrill jbrill force-pushed the reviewer-docs-issue-timeline branch from da5b558 to 2647563 Compare December 17, 2024 16:55
@gmlewis gmlewis changed the title feat: document review request events in Timeline struct feat: Document review request events in Timeline struct Dec 17, 2024
Copy link
Collaborator

@gmlewis gmlewis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, @jbrill !


"github.com/google/go-cmp/cmp"
)

func parseTime(t *testing.T, value string) time.Time {
Copy link
Collaborator

@gmlewis gmlewis Dec 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Honestly, there is really no need for this helper function, as there is no need to test the functionality of time.Parse in this repo since it is well-tested with each release of the Go compiler.

The vast majority of our tests use &Timestamp{referenceTime} although I do see some unfortunate deviations from this.

Let's please remove this helper function and use the existing referenceTime instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good. I've pushed up those changes to use &Timestamp{referenceTime}!

@gmlewis
Copy link
Collaborator

gmlewis commented Dec 17, 2024

Oh, and as described in CONTRIBUTING.md, please do not use force-push in this repo as we always squash-and-merge to create a clean commit history.

@jbrill
Copy link
Contributor Author

jbrill commented Dec 17, 2024

Oh, and as described in CONTRIBUTING.md, please do not use force-push in this repo as we always squash-and-merge to create a clean commit history.

Apologies -- pushed up a new commit with the test changes.

@jbrill jbrill requested a review from gmlewis December 17, 2024 17:54
Copy link
Collaborator

@gmlewis gmlewis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, @jbrill !
LGTM.
Merging.

@gmlewis gmlewis merged commit c4a49db into google:master Dec 17, 2024
6 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants