Skip to content

Conversation

@RGO230
Copy link
Contributor

@RGO230 RGO230 commented Jul 2, 2025

@RGO230 RGO230 self-assigned this Jul 2, 2025
@RGO230 RGO230 assigned AZabolotnikov and RGO230 and unassigned RGO230 and AZabolotnikov Jul 3, 2025
@RGO230 RGO230 assigned AZabolotnikov and unassigned RGO230 Jul 9, 2025
@sonarqubecloud
Copy link

sonarqubecloud bot commented Jul 9, 2025

@AZabolotnikov AZabolotnikov assigned DenTray and RGO230 and unassigned AZabolotnikov Jul 31, 2025
@DenTray DenTray removed their assignment Aug 12, 2025
@astorozhevsky astorozhevsky requested a review from Copilot August 28, 2025 09:37
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 modifies the error response page formatting for Swagger validation errors, addressing issue #163. The changes enhance error presentation with structured markdown formatting and proper error context display.

  • Reformats error page display with markdown structure including headers and visual separators
  • Updates error handling to include exception type information alongside error messages
  • Fixes test parameter ordering and adds new test case for incorrect documentation structure

Reviewed Changes

Copilot reviewed 44 out of 44 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
resources/views/error.blade.php Updates error page template with structured markdown formatting
src/Services/SwaggerService.php Modifies exception handling to capture and pass exception type information
tests/SwaggerServiceTest.php Updates test expectations and adds new test case for documentation structure errors
tests/TestCase.php Fixes parameter order in exportContent method call
tests/fixtures/SwaggerServiceTest/*.html Updates all error fixture files to match new markdown-formatted error template

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

@RGO230 RGO230 assigned AZabolotnikov and unassigned RGO230 Sep 1, 2025
@AZabolotnikov AZabolotnikov assigned RGO230 and unassigned AZabolotnikov Sep 4, 2025
@RGO230 RGO230 assigned AZabolotnikov and RGO230 and unassigned RGO230 and AZabolotnikov Nov 4, 2025
@RGO230 RGO230 assigned AZabolotnikov and unassigned RGO230 Nov 4, 2025
@DenTray DenTray requested a review from Copilot November 6, 2025 07:30
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

Copilot reviewed 62 out of 64 changed files in this pull request and generated 8 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +271 to +274
[
'tmpDoc' => 'documentation/invalid_format__missing_ref_file',
'fixture' => 'php_8.4_invalid_format_missing_ref_file.html',
],
Copy link

Copilot AI Nov 6, 2025

Choose a reason for hiding this comment

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

Duplicate test case entry detected. Lines 267-270 and 271-274 have identical values for both 'tmpDoc' and 'fixture'. Remove the duplicate entry to avoid redundant test execution.

Suggested change
[
'tmpDoc' => 'documentation/invalid_format__missing_ref_file',
'fixture' => 'php_8.4_invalid_format_missing_ref_file.html',
],

Copilot uses AI. Check for mistakes.
],
headers: [
'authorization' => 'Bearer some_token',
'authorization' => 'Bearer some_timplementationoken',
Copy link

Copilot AI Nov 6, 2025

Choose a reason for hiding this comment

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

Corrected spelling of 'some_timplementationoken' to 'some_token'.

Suggested change
'authorization' => 'Bearer some_timplementationoken',
'authorization' => 'Bearer some_token',

Copilot uses AI. Check for mistakes.
Comment on lines 315 to 322
if (version_compare(PHP_VERSION, '8.4.0', '<=')) {
$this->mockDriverGetDocumentation($this->getJsonFixture($tmpDoc));

$content = app(SwaggerService::class)->getDocFileContent();

$this->assertExceptionHTMLEqualsFixture($fixture, $content['info']['description']);
} else {
$this->markTestSkipped('This test requires PHP version <= 8.4.0');
Copy link

Copilot AI Nov 6, 2025

Choose a reason for hiding this comment

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

Incorrect version comparison operator. The condition should be '<' instead of '<=' to check for PHP versions before 8.4.0. Currently, this test will run on PHP 8.4.0 when it should be skipped, which contradicts the skip message on line 322 stating 'This test requires PHP version <= 8.4.0' (note: the message itself is misleading as '<= 8.4.0' would include 8.4.0).

Suggested change
if (version_compare(PHP_VERSION, '8.4.0', '<=')) {
$this->mockDriverGetDocumentation($this->getJsonFixture($tmpDoc));
$content = app(SwaggerService::class)->getDocFileContent();
$this->assertExceptionHTMLEqualsFixture($fixture, $content['info']['description']);
} else {
$this->markTestSkipped('This test requires PHP version <= 8.4.0');
if (version_compare(PHP_VERSION, '8.4.0', '<')) {
$this->mockDriverGetDocumentation($this->getJsonFixture($tmpDoc));
$content = app(SwaggerService::class)->getDocFileContent();
$this->assertExceptionHTMLEqualsFixture($fixture, $content['info']['description']);
} else {
$this->markTestSkipped('This test requires PHP version < 8.4.0');

Copilot uses AI. Check for mistakes.
{
if ($exportMode || $this->globalExportMode) {
$this->exportContent($fixtureName, $data);
$this->exportContent($data, $fixtureName);
Copy link

Copilot AI Nov 6, 2025

Choose a reason for hiding this comment

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

The parameter order in this call has been swapped. Based on the method signature at line 59 which defines exportContent($content, string $fixtureName), the first parameter should be the content. Verify that all calls to assertEqualsFixture still work correctly with this parameter order change, as exportContent now expects content first.

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

@RGO230 RGO230 Nov 6, 2025

Choose a reason for hiding this comment

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

method realization

protected function exportContent($content, string $fixtureName): void
    {
        file_put_contents($this->getFixturePath($fixtureName), $content);
    }

public function testMergeTempDocumentation()
{
$this->mockParallelTestingToken();
$this->mockParallelTestingToken('workerID');
Copy link

Copilot AI Nov 6, 2025

Choose a reason for hiding this comment

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

Method mockParallelTestingToken is called but was removed from TestCase.php (see lines 213-217 of the diff). This will cause a fatal error. Either restore this method or use an alternative implementation.

Copilot uses AI. Check for mistakes.
public function testMergeToEmptyTempDocumentation()
{
$this->mockParallelTestingToken();
$this->mockParallelTestingToken('workerID');
Copy link

Copilot AI Nov 6, 2025

Choose a reason for hiding this comment

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

Method mockParallelTestingToken is called but was removed from TestCase.php (see lines 213-217 of the diff). This will cause a fatal error. Either restore this method or use an alternative implementation.

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

method was moved in helpers package

public function testSaveProcessTmpDataCheckTokenBasedPath()
{
$this->mockParallelTestingToken();
$this->mockParallelTestingToken('workerID');
Copy link

Copilot AI Nov 6, 2025

Choose a reason for hiding this comment

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

Method mockParallelTestingToken is called but was removed from TestCase.php (see lines 213-217 of the TestCase.php diff). This will cause a fatal error. Either restore this method or use an alternative implementation.

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

method was moved in helpers package

@DenTray
Copy link
Collaborator

DenTray commented Nov 6, 2025

@RGO230 please review copilot's comments and increase test coverage

@DenTray DenTray assigned RGO230 and unassigned AZabolotnikov Nov 6, 2025
@sonarqubecloud
Copy link

sonarqubecloud bot commented Nov 6, 2025

@RGO230 RGO230 assigned AZabolotnikov and unassigned RGO230 Nov 6, 2025
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.

4 participants