Skip to content

Add test coverage for webp upload and preview functionality - #10739

Merged
stnguyen90 merged 7 commits into
fix-webp-libraryfrom
copilot/sub-pr-10738
Nov 6, 2025
Merged

stnguyen90 merged 7 commits into
fix-webp-libraryfrom
copilot/sub-pr-10738

Conversation

Copilot AI commented Oct 30, 2025 •

Copy link
Copy Markdown
Contributor
  • Create webp test image (image.webp)
  • Move webp upload/view test into testCreateBucketFile
  • Rename testUploadWebpImage to testFilePreview and simplify to test preview with webp output
  • Add webp to allowed file extensions in testCreateBucketFile
  • Remove duplicate test functions and consolidate into existing tests
  • Fix test assertion - expect 1 file instead of 0 when using offset(1) since bucket now contains 2 files
  • Use simple webp image for testing (400x100px with pink/black colors)

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

@coderabbitai

coderabbitai Bot commented Oct 30, 2025 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.


Note

Free review on us!

CodeRabbit is offering free reviews until Thu Nov 06 2025 to showcase some of the refinements we've made.

Comment @coderabbitai help to get the list of available commands and usage tips.

Copilot AI changed the title [WIP] Fix webp upload and previews Add test coverage for webp upload and preview functionality Oct 30, 2025
Copilot AI requested a review from stnguyen90 October 30, 2025 21:59
Comment thread tests/resources/logo.webp Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@copilot this is an old logo. Use the new logo

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Updated to use the new logo in commit d1511d5. Now using logo-after.webp instead of logo.webp.

/**
* @depends testCreateBucketFile
*/
public function testUploadWebpImage(): array

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@copilot Rename this to testFilePreview and move it right after testCreateBucketFile

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Renamed to testFilePreview and simplified in commit d1511d5. The function now depends on testCreateBucketFile and tests previewing PNG as webp output format.

Comment thread tests/resources/image.webp Resolved

Copilot AI commented Nov 2, 2025

Copy link
Copy Markdown
Contributor Author

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • appwrite.io
    • Triggering command: curl -L -o /tmp/white.png REDACTED (dns block)
    • Triggering command: wget -O /tmp/white.png REDACTED (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

@github-actions

github-actions Bot commented Nov 2, 2025 •

Copy link
Copy Markdown

Security Scan Results for PR

Docker Image Scan Results

Package Version Vulnerability Severity
libxml2 2.13.8-r0 CVE-2025-49794 CRITICAL
libxml2 2.13.8-r0 CVE-2025-49796 CRITICAL
libxml2 2.13.8-r0 CVE-2025-49795 HIGH
libxml2 2.13.8-r0 CVE-2025-6021 HIGH
golang.org/x/crypto v0.31.0 CVE-2025-22869 HIGH
golang.org/x/oauth2 v0.24.0 CVE-2025-22868 HIGH
stdlib 1.22.10 CVE-2025-47907 HIGH
stdlib 1.22.10 CVE-2025-47912 HIGH
stdlib 1.22.10 CVE-2025-58183 HIGH
stdlib 1.22.10 CVE-2025-58186 HIGH
stdlib 1.22.10 CVE-2025-58187 HIGH
stdlib 1.22.10 CVE-2025-58188 HIGH
stdlib 1.22.10 CVE-2025-61724 HIGH

Source Code Scan Results

🎉 No vulnerabilities found!

@github-actions

github-actions Bot commented Nov 2, 2025 •

Copy link
Copy Markdown

✨ Benchmark results

  • Requests per second: 1,174
  • Requests with 200 status code: 211,291
  • P99 latency: 0.165505982

⚡ Benchmark Comparison

Metric This PR Latest version
RPS 1,174 1,208
200 211,291 217,508
P99 0.165505982 0.169623058

@stnguyen90 stnguyen90 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@copilot investigate why the tests are failing and fix them.

Copilot AI commented Nov 3, 2025

Copy link
Copy Markdown
Contributor Author

@copilot investigate why the tests are failing and fix them.

The tests were failing because adding the webp file upload to testCreateBucketFile increased the file count in the bucket from 1 to 2. The test at line 451 was asserting that offset(1) returns 0 files, but with 2 files in the bucket, it now returns 1 file.

Fixed in commit df8fb23 by updating the assertion to expect 1 file instead of 0.

Copilot AI requested a review from stnguyen90 November 3, 2025 18:14
@stnguyen90
stnguyen90 marked this pull request as ready for review November 3, 2025 18:14
Comment thread tests/resources/image.webp Resolved

Copilot AI commented Nov 3, 2025

Copy link
Copy Markdown
Contributor Author

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • github-production-user-asset-6210df.s3.amazonaws.com
    • Triggering command: curl -L -o /tmp/new-logo.png REDACTED (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

@stnguyen90

Copy link
Copy Markdown
Contributor

@copilot Since you cant download the right file, use any simple webp

Copilot AI commented Nov 4, 2025

Copy link
Copy Markdown
Contributor Author

@copilot Since you cant download the right file, use any simple webp

Created a simple 400x100px webp image with pink and black colors for testing in commit 2d33226.

Comment thread tests/resources/image.webp Resolved
@stnguyen90

Copy link
Copy Markdown
Contributor

Parent PR:

@stnguyen90
stnguyen90 merged commit 4f1940a into fix-webp-library Nov 6, 2025
@stnguyen90
stnguyen90 deleted the copilot/sub-pr-10738 branch November 6, 2025 23:07
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