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

Extend the Pull Request API #195

Merged
merged 3 commits into from
Dec 7, 2024
Merged

Conversation

4np
Copy link
Contributor

@4np 4np commented Dec 4, 2024

Context

This PR:

  • extends the PullRequest API to:
    • fetch code review comments (see doc)
    • create a new regular code review comment (an alias for creating issue comment, as documented by GitHub, see doc)
    • create a new code review comment by commit ID, path and line number (see doc)
  • adds a new Comment structure, scoped onto PullRequest as it differs from the issue comment.
  • scopes the existing Comment structure onto Issue
  • adds unit tests for the new logic

…(regular comments as well as comments to specific commits / line numbers)

- Add support for fetching requested reviewers (users and teams) for a Pull Request
- Fix lint warnings
@4np
Copy link
Contributor Author

4np commented Dec 4, 2024

I think there's something not right with your CI:

Xcode 16.1 / Swift 6.0.2

$ swift --version
swift-driver version: 1.115 Apple Swift version 6.0.2 (swiftlang-6.0.2.1.2 clang-1600.0.26.4)
Target: arm64-apple-macosx14.0
$ swift test|grep -e "Executed " -e "Test Suite '"
...
Test Suite 'All tests' started at 2024-12-04 17:55:24.257.
Test Suite 'OctoKitPackageTests.xctest' started at 2024-12-04 17:55:24.258.
Test Suite 'ConfigurationTests' started at 2024-12-04 17:55:24.258.
Test Suite 'ConfigurationTests' passed at 2024-12-04 17:55:24.262.
	 Executed 7 tests, with 0 failures (0 unexpected) in 0.004 (0.004) seconds
Test Suite 'FollowTests' started at 2024-12-04 17:55:24.262.
Test Suite 'FollowTests' passed at 2024-12-04 17:55:24.267.
	 Executed 8 tests, with 0 failures (0 unexpected) in 0.005 (0.005) seconds
Test Suite 'GistTests' started at 2024-12-04 17:55:24.267.
Test Suite 'GistTests' passed at 2024-12-04 17:55:24.272.
	 Executed 10 tests, with 0 failures (0 unexpected) in 0.005 (0.005) seconds
Test Suite 'IssueTests' started at 2024-12-04 17:55:24.272.
Test Suite 'IssueTests' passed at 2024-12-04 17:55:24.278.
	 Executed 13 tests, with 0 failures (0 unexpected) in 0.006 (0.006) seconds
Test Suite 'LabelTests' started at 2024-12-04 17:55:24.278.
Test Suite 'LabelTests' passed at 2024-12-04 17:55:24.281.
	 Executed 9 tests, with 0 failures (0 unexpected) in 0.002 (0.002) seconds
Test Suite 'MilestoneTests' started at 2024-12-04 17:55:24.281.
Test Suite 'MilestoneTests' passed at 2024-12-04 17:55:24.283.
	 Executed 5 tests, with 0 failures (0 unexpected) in 0.002 (0.002) seconds
Test Suite 'NotificationTests' started at 2024-12-04 17:55:24.283.
Test Suite 'NotificationTests' passed at 2024-12-04 17:55:24.287.
	 Executed 16 tests, with 0 failures (0 unexpected) in 0.004 (0.005) seconds
Test Suite 'OctokitSwiftTests' started at 2024-12-04 17:55:24.287.
Test Suite 'OctokitSwiftTests' passed at 2024-12-04 17:55:24.288.
	 Executed 2 tests, with 0 failures (0 unexpected) in 0.000 (0.000) seconds
Test Suite 'PlanTests' started at 2024-12-04 17:55:24.288.
Test Suite 'PlanTests' passed at 2024-12-04 17:55:24.288.
	 Executed 1 test, with 0 failures (0 unexpected) in 0.000 (0.000) seconds
Test Suite 'PreviewHeaderTests' started at 2024-12-04 17:55:24.288.
Test Suite 'PreviewHeaderTests' passed at 2024-12-04 17:55:24.288.
	 Executed 1 test, with 0 failures (0 unexpected) in 0.000 (0.000) seconds
Test Suite 'PublicKeyTests' started at 2024-12-04 17:55:24.288.
Test Suite 'PublicKeyTests' passed at 2024-12-04 17:55:24.289.
	 Executed 2 tests, with 0 failures (0 unexpected) in 0.001 (0.001) seconds
Test Suite 'PullRequestTests' started at 2024-12-04 17:55:24.289.
Test Suite 'PullRequestTests' passed at 2024-12-04 17:55:24.303.
	 Executed 20 tests, with 0 failures (0 unexpected) in 0.013 (0.014) seconds
Test Suite 'ReactionsTests' started at 2024-12-04 17:55:24.303.
Test Suite 'ReactionsTests' passed at 2024-12-04 17:55:24.303.
	 Executed 1 test, with 0 failures (0 unexpected) in 0.000 (0.000) seconds
Test Suite 'ReleasesTests' started at 2024-12-04 17:55:24.303.
Test Suite 'ReleasesTests' passed at 2024-12-04 17:55:24.307.
	 Executed 7 tests, with 0 failures (0 unexpected) in 0.003 (0.004) seconds
Test Suite 'RepositoryTests' started at 2024-12-04 17:55:24.307.
Test Suite 'RepositoryTests' passed at 2024-12-04 17:55:24.315.
	 Executed 23 tests, with 0 failures (0 unexpected) in 0.008 (0.008) seconds
Test Suite 'ReviewTests' started at 2024-12-04 17:55:24.315.
Test Suite 'ReviewTests' passed at 2024-12-04 17:55:24.318.
	 Executed 8 tests, with 0 failures (0 unexpected) in 0.003 (0.003) seconds
Test Suite 'SearchTests' started at 2024-12-04 17:55:24.318.
Test Suite 'SearchTests' passed at 2024-12-04 17:55:24.319.
	 Executed 3 tests, with 0 failures (0 unexpected) in 0.001 (0.001) seconds
Test Suite 'StarsTests' started at 2024-12-04 17:55:24.319.
Test Suite 'StarsTests' passed at 2024-12-04 17:55:24.321.
	 Executed 14 tests, with 0 failures (0 unexpected) in 0.002 (0.003) seconds
Test Suite 'StatusesTests' started at 2024-12-04 17:55:24.321.
Test Suite 'StatusesTests' passed at 2024-12-04 17:55:24.323.
	 Executed 4 tests, with 0 failures (0 unexpected) in 0.002 (0.002) seconds
Test Suite 'UserTests' started at 2024-12-04 17:55:24.323.
Test Suite 'UserTests' passed at 2024-12-04 17:55:24.326.
	 Executed 8 tests, with 0 failures (0 unexpected) in 0.002 (0.002) seconds
Test Suite 'OctoKitPackageTests.xctest' passed at 2024-12-04 17:55:24.326.
	 Executed 162 tests, with 0 failures (0 unexpected) in 0.064 (0.068) seconds
Test Suite 'All tests' passed at 2024-12-04 17:55:24.326.
	 Executed 162 tests, with 0 failures (0 unexpected) in 0.064 (0.069) seconds

Xcode 15.4 / Swift 5.10

$ swift --version
swift-driver version: 1.90.11.1 Apple Swift version 5.10 (swiftlang-5.10.0.13 clang-1500.3.9.4)
Target: arm64-apple-macosx14.0
$ swift test|grep -e "Executed " -e "Test Suite '"     
...                                                                                                                    
Test Suite 'All tests' started at 2024-12-04 17:52:50.680.
Test Suite 'OctoKitPackageTests.xctest' started at 2024-12-04 17:52:50.682.
Test Suite 'ConfigurationTests' started at 2024-12-04 17:52:50.682.
Test Suite 'ConfigurationTests' passed at 2024-12-04 17:52:50.689.
	 Executed 7 tests, with 0 failures (0 unexpected) in 0.007 (0.007) seconds
Test Suite 'FollowTests' started at 2024-12-04 17:52:50.689.
Test Suite 'FollowTests' passed at 2024-12-04 17:52:50.696.
	 Executed 8 tests, with 0 failures (0 unexpected) in 0.007 (0.007) seconds
Test Suite 'GistTests' started at 2024-12-04 17:52:50.696.
Test Suite 'GistTests' passed at 2024-12-04 17:52:50.703.
	 Executed 10 tests, with 0 failures (0 unexpected) in 0.006 (0.006) seconds
Test Suite 'IssueTests' started at 2024-12-04 17:52:50.703.
Test Suite 'IssueTests' passed at 2024-12-04 17:52:50.714.
	 Executed 13 tests, with 0 failures (0 unexpected) in 0.011 (0.011) seconds
Test Suite 'LabelTests' started at 2024-12-04 17:52:50.714.
Test Suite 'LabelTests' passed at 2024-12-04 17:52:50.721.
	 Executed 9 tests, with 0 failures (0 unexpected) in 0.007 (0.007) seconds
Test Suite 'MilestoneTests' started at 2024-12-04 17:52:50.721.
Test Suite 'MilestoneTests' passed at 2024-12-04 17:52:50.724.
	 Executed 5 tests, with 0 failures (0 unexpected) in 0.003 (0.003) seconds
Test Suite 'NotificationTests' started at 2024-12-04 17:52:50.724.
Test Suite 'NotificationTests' passed at 2024-12-04 17:52:50.731.
	 Executed 16 tests, with 0 failures (0 unexpected) in 0.007 (0.007) seconds
Test Suite 'OctokitSwiftTests' started at 2024-12-04 17:52:50.731.
Test Suite 'OctokitSwiftTests' passed at 2024-12-04 17:52:50.731.
	 Executed 2 tests, with 0 failures (0 unexpected) in 0.000 (0.000) seconds
Test Suite 'PlanTests' started at 2024-12-04 17:52:50.731.
Test Suite 'PlanTests' passed at 2024-12-04 17:52:50.732.
	 Executed 1 test, with 0 failures (0 unexpected) in 0.000 (0.000) seconds
Test Suite 'PreviewHeaderTests' started at 2024-12-04 17:52:50.732.
Test Suite 'PreviewHeaderTests' passed at 2024-12-04 17:52:50.732.
	 Executed 1 test, with 0 failures (0 unexpected) in 0.000 (0.000) seconds
Test Suite 'PublicKeyTests' started at 2024-12-04 17:52:50.732.
Test Suite 'PublicKeyTests' passed at 2024-12-04 17:52:50.733.
	 Executed 2 tests, with 0 failures (0 unexpected) in 0.001 (0.001) seconds
Test Suite 'PullRequestTests' started at 2024-12-04 17:52:50.733.
Test Suite 'PullRequestTests' passed at 2024-12-04 17:52:50.756.
	 Executed 20 tests, with 0 failures (0 unexpected) in 0.022 (0.023) seconds
Test Suite 'ReactionsTests' started at 2024-12-04 17:52:50.756.
Test Suite 'ReactionsTests' passed at 2024-12-04 17:52:50.757.
	 Executed 1 test, with 0 failures (0 unexpected) in 0.002 (0.002) seconds
Test Suite 'ReleasesTests' started at 2024-12-04 17:52:50.757.
Test Suite 'ReleasesTests' passed at 2024-12-04 17:52:50.768.
	 Executed 7 tests, with 0 failures (0 unexpected) in 0.011 (0.011) seconds
Test Suite 'RepositoryTests' started at 2024-12-04 17:52:50.768.
Test Suite 'RepositoryTests' passed at 2024-12-04 17:52:50.780.
	 Executed 23 tests, with 0 failures (0 unexpected) in 0.011 (0.012) seconds
Test Suite 'ReviewTests' started at 2024-12-04 17:52:50.780.
Test Suite 'ReviewTests' passed at 2024-12-04 17:52:50.786.
	 Executed 8 tests, with 0 failures (0 unexpected) in 0.006 (0.006) seconds
Test Suite 'SearchTests' started at 2024-12-04 17:52:50.786.
Test Suite 'SearchTests' passed at 2024-12-04 17:52:50.790.
	 Executed 3 tests, with 0 failures (0 unexpected) in 0.004 (0.004) seconds
Test Suite 'StarsTests' started at 2024-12-04 17:52:50.790.
Test Suite 'StarsTests' passed at 2024-12-04 17:52:50.793.
	 Executed 14 tests, with 0 failures (0 unexpected) in 0.003 (0.003) seconds
Test Suite 'StatusesTests' started at 2024-12-04 17:52:50.793.
Test Suite 'StatusesTests' passed at 2024-12-04 17:52:50.799.
	 Executed 4 tests, with 0 failures (0 unexpected) in 0.005 (0.006) seconds
Test Suite 'UserTests' started at 2024-12-04 17:52:50.799.
Test Suite 'UserTests' passed at 2024-12-04 17:52:50.802.
	 Executed 8 tests, with 0 failures (0 unexpected) in 0.003 (0.003) seconds
Test Suite 'OctoKitPackageTests.xctest' passed at 2024-12-04 17:52:50.802.
	 Executed 162 tests, with 0 failures (0 unexpected) in 0.115 (0.120) seconds
Test Suite 'All tests' passed at 2024-12-04 17:52:50.802.
	 Executed 162 tests, with 0 failures (0 unexpected) in 0.115 (0.122) seconds

@pietbrauer
Copy link
Member

I updated main to Xcode 16 which seems to run fine. Please rebase and try again.

Copy link
Member

@pietbrauer pietbrauer left a comment

Choose a reason for hiding this comment

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

Thanks a lot for your work!

@pietbrauer pietbrauer merged commit cd108b3 into nerdishbynature:main Dec 7, 2024
9 checks passed
@4np
Copy link
Contributor Author

4np commented Dec 7, 2024

Glad to be able to contribute, thanks for creating the framework @pietbrauer 😀

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