Skip to content

feat: Document review request events in Timeline struct - #3391

Merged
gmlewis merged 3 commits into
google:masterfrom
jbrill:reviewer-docs-issue-timeline
Dec 17, 2024
Merged

feat: Document review request events in Timeline struct#3391
gmlewis merged 3 commits into
google:masterfrom
jbrill:reviewer-docs-issue-timeline

Conversation

@jbrill

@jbrilljbrill commented Dec 16, 2024

Copy link
Copy Markdown
Contributor

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
@codecov

codecovBot commented Dec 16, 2024

Copy link
Copy Markdown

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
jbrillforce-pushed the reviewer-docs-issue-timeline branch from f46f7be to 4a77129CompareDecember 17, 2024 15:57
@jbrill
jbrill marked this pull request as ready for review December 17, 2024 16:05
@jbrilljbrill changed the title docs: review_requested and review_request_removed to issues_timeline.gofeat: add review_requested and review_request_removed to event types as comment in issues_timeline.goDec 17, 2024
@jbrilljbrill changed the title feat: add review_requested and review_request_removed to event types as comment in issues_timeline.gofeat: document review request events in Timeline structDec 17, 2024
@jbrill
jbrillforce-pushed the reviewer-docs-issue-timeline branch 2 times, most recently from 7986ead to 041b2ddCompareDecember 17, 2024 16:35
@jbrill

Copy link
Copy Markdown
ContributorAuthor

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

@jbrill
jbrillforce-pushed the reviewer-docs-issue-timeline branch 2 times, most recently from 041b2dd to da5b558CompareDecember 17, 2024 16:54
@jbrill
jbrillforce-pushed the reviewer-docs-issue-timeline branch from da5b558 to 2647563CompareDecember 17, 2024 16:55
@gmlewisgmlewis changed the title feat: document review request events in Timeline structfeat: Document review request events in Timeline structDec 17, 2024

@gmlewisgmlewis left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thank you, @jbrill !

Comment threadgithub/issues_timeline_test.go Outdated
"github.com/google/go-cmp/cmp"
)

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

@gmlewisgmlewisDec 17, 2024

Copy link
Copy Markdown
Collaborator

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
Copy Markdown
ContributorAuthor

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
Copy Markdown
Collaborator

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
Copy Markdown
ContributorAuthor

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 gmlewisDecember 17, 2024 17:54

@gmlewisgmlewis left a comment

Copy link
Copy Markdown
Collaborator

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:masterDec 17, 2024
jlaportebot added a commit to jlaportebot/go-github that referenced this pull request Jun 28, 2026
Sign up for freeto 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

@jbrill@gmlewis