Skip to content

Fix GitHub check URL #9549

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

Merged
merged 2 commits into from
Mar 20, 2025
Merged

Fix GitHub check URL #9549

merged 2 commits into from
Mar 20, 2025

Conversation

vermakhushboo
Copy link
Member

@vermakhushboo vermakhushboo commented Mar 20, 2025

What does this PR do?

Fixed and verified that the github check URL is correct for both functions and sites

Test Plan

(Write your test plan here. If you changed any code, please provide us with clear instructions on how you verified your changes work. Screenshots may also be helpful.)

Related PRs and Issues

  • (Related PR or issue)

Checklist

  • Have you read the Contributing Guidelines on issues?
  • If the PR includes a change to an API's metadata (desc, label, params, etc.), does it also include updated API specs and example docs?

Summary by CodeRabbit

  • New Features
    • Enhanced resource routing with dynamic URL generation that now supports multiple resource types, ensuring more accurate and consistent linking across your application.
  • Bug Fixes
    • Improved error handling for invalid resource types, ensuring exceptions are thrown for unsupported collections.

@vermakhushboo vermakhushboo requested a review from Meldiron March 20, 2025 12:35
Copy link

coderabbitai bot commented Mar 20, 2025

Walkthrough

The update refactors the URL generation in the runGitAction method within Builds.php. It switches from a static string concatenation to a dynamic approach using a match expression. This expression determines the resource type based on its collection (supporting both "functions" and "sites") and throws an exception if the collection does not match. The same logic is consistently applied to handling the comment update process, ensuring accurate URL construction in different scenarios.

Changes

File(s) Change Summary
src/Appwrite/.../Builds.php Replaced static URL concatenation with a match expression in the runGitAction method to dynamically determine the resource type based on its collection. Also applied this logic for updating resource comments, with exceptions thrown for unrecognized collections.

Sequence Diagram(s)

sequenceDiagram
    participant Caller
    participant Worker as runGitAction
    participant Matcher as "Match Expression Logic"

    Caller->>Worker: invoke runGitAction(resource)
    Worker->>Matcher: Evaluate resource collection via match
    alt Recognized Resource (functions/sites)
        Matcher-->>Worker: Return resource type
        Worker->>Caller: Return dynamically constructed URL
    else Unrecognized Resource
        Worker-->>Caller: Throw exception
    end
Loading

Poem

I'm a bouncy rabbit in a field of code,
Hopping through branches on a dynamic road.
Functions or sites, my path now clear,
With match expressions, exceptions steer.
Code carrots crunch, as my heart's in mode!
🐇✨


📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c2d0ade and ec6683c.

📒 Files selected for processing (1)
  • src/Appwrite/Platform/Modules/Functions/Workers/Builds.php (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (19)
  • GitHub Check: E2E Service Test (Users)
  • GitHub Check: E2E Service Test (FunctionsSchedule)
  • GitHub Check: E2E Service Test (Databases)
  • GitHub Check: E2E Service Test (Webhooks)
  • GitHub Check: E2E Service Test (Locale)
  • GitHub Check: E2E Service Test (Proxy)
  • GitHub Check: E2E Service Test (Projects)
  • GitHub Check: E2E Service Test (Migrations)
  • GitHub Check: E2E Service Test (Teams)
  • GitHub Check: E2E Service Test (GraphQL)
  • GitHub Check: E2E Service Test (Functions)
  • GitHub Check: E2E Service Test (Storage)
  • GitHub Check: E2E Service Test (Avatars)
  • GitHub Check: E2E Service Test (Console)
  • GitHub Check: E2E Service Test (Account)
  • GitHub Check: E2E General Test
  • GitHub Check: Benchmark
  • GitHub Check: Unit Test
  • GitHub Check: scan
🔇 Additional comments (1)
src/Appwrite/Platform/Modules/Functions/Workers/Builds.php (1)

1207-1211: URL construction is now dynamic based on resource type.

The PR successfully implements a dynamic approach to URL generation using a match expression that determines the resource type based on its collection. This addresses the requirement to support both 'functions' and 'sites', making the URL construction more versatile and robust by throwing an exception for invalid resource types.

✨ Finishing Touches
  • 📝 Generate Docstrings

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

github-actions bot commented Mar 20, 2025

Security Scan Results for PR

Docker Image Scan Results

Package Version Vulnerability Severity
binutils 2.42-r0 CVE-2025-0840 HIGH
libexpat 2.6.4-r0 CVE-2024-8176 HIGH
libxml2 2.12.7-r0 CVE-2024-56171 HIGH
libxml2 2.12.7-r0 CVE-2025-24928 HIGH
libxml2 2.12.7-r0 CVE-2025-27113 HIGH

Source Code Scan Results

🎉 No vulnerabilities found!

Copy link

github-actions bot commented Mar 20, 2025

✨ Benchmark results

  • Requests per second: 903
  • Requests with 200 status code: 162,661
  • P99 latency: 0.203622001

⚡ Benchmark Comparison

Metric This PR Latest version
RPS 903 1,142
200 162,661 205,645
P99 0.203622001 0.162729066

@Meldiron Meldiron merged commit c323c22 into feat-sites Mar 20, 2025
56 of 57 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
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy