Skip to content

Conversation

@StanBarrows
Copy link
Contributor

No description provided.

Copilot AI review requested due to automatic review settings October 17, 2025 10:25
Copy link

Copilot AI left a 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 finalizes the Beekeeper API integration by adding comprehensive support for post creation within streams, implementing test mocking infrastructure, and cleaning up the authentication user status configuration.

  • Added complete implementation for creating posts in streams with all optional parameters (files, polls, scheduling, etc.)
  • Introduced Saloon HTTP request mocking across all feature tests
  • Removed deprecated Reaction DTO and simplified AuthenticatedUserStatus configuration

Reviewed Changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tests/Unit/Requests/CreateAPostInAGivenStreamRequestTest.php New unit tests for post creation request validation and data mapping
tests/Feature/Requests/CreateAPostInAGivenStreamRequestTest.php New feature tests for post creation with mocked API responses
tests/Feature/Requests/UploadAFileRequestTest.php Added Saloon mocking to file upload tests
tests/Feature/Requests/ListArtifactsRequestTest.php Added Saloon mocking to artifact listing tests
tests/Feature/Requests/GetStatusOfAuthenticatedUserRequestTest.php Added Saloon mocking and removed reactions assertion
tests/Feature/Requests/CreateAChildToAnArtifactRequestTest.php Added Saloon mocking to artifact child creation tests
tests/TestCase.php Added SaloonServiceProvider for test mocking support
src/Requests/CreateAPostInAGivenStream.php New request class for creating posts in streams
src/Responses/CreateAPostInAGivenStreamResponse.php New response handler for post creation
src/Data/Streams/Post.php New DTO for post data with comprehensive field mapping
src/Data/Streams/Stream.php New DTO for stream data
src/Enums/Streams/Type.php New enum for stream types
src/Data/Configs/General.php Made companyAccount nullable
src/Data/Configs/AuthenticatedUserStatus.php Removed reactions field
src/Data/Configs/Reaction.php Deleted deprecated DTO
README.md Updated documentation with post creation examples and enum references

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

throw new Exception(
sprintf(
'%s: %s - %s',
'Request was not successful: ',
Copy link

Copilot AI Oct 17, 2025

Choose a reason for hiding this comment

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

The error message format contains redundant punctuation. Line 28 ends with ': ' which creates 'Request was not successful: : CODE' in the output. Remove the trailing colon and space from line 28.

Suggested change
'Request was not successful: ',
'Request was not successful',

Copilot uses AI. Check for mistakes.
Comment on lines +51 to +53
return [
'expand' => implode(',', $expand),
];
Copy link

Copilot AI Oct 17, 2025

Choose a reason for hiding this comment

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

When expand is an empty array, this returns 'expand' => '', which may send an unnecessary empty query parameter. Consider filtering the query array to exclude empty values or checking if expand is empty before adding it to the return array.

Suggested change
return [
'expand' => implode(',', $expand),
];
if (!empty($expand)) {
return [
'expand' => implode(',', $expand),
];
}
return [];

Copilot uses AI. Check for mistakes.
];
}

public function defaultBody(): array
Copy link

Copilot AI Oct 17, 2025

Choose a reason for hiding this comment

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

The defaultBody method contains significant code duplication with repeated patterns for converting Collections to arrays (lines 66-70, 92-96, 102-106, 112-116, 122-126, 132-136). Consider extracting this logic into a private helper method like 'convertToArray($value)' to reduce duplication and improve maintainability.

Copilot uses AI. Check for mistakes.
@StanBarrows StanBarrows merged commit 4c59e2b into main Oct 27, 2025
11 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