Skip to content

chore: added App IEndpoint type#794

Merged
sbansla merged 6 commits intomainfrom
add-app-endpoint-type
Sep 25, 2025
Merged

chore: added App IEndpoint type#794
sbansla merged 6 commits intomainfrom
add-app-endpoint-type

Conversation

@sbansla
Copy link
Copy Markdown
Contributor

@sbansla sbansla commented Aug 7, 2025

Fixes

Added app IEndpoint type and its test case.

Checklist

  • I acknowledge that all my contributions will be made under the project's license
  • I have made a material change to the repo (functionality, testing, spelling, grammar)
  • I have read the Contribution Guidelines and my PR follows them
  • I have titled the PR appropriately
  • I have updated my branch with the main branch
  • I have added tests that prove my fix is effective or that my feature works
  • I have added the necessary documentation about the functionality in the appropriate .md file
  • I have added inline documentation to the code I modified

If you have questions, please file a support ticket, or create a GitHub Issue in this repository.

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Aug 7, 2025

Quality Gate Failed Quality Gate failed

Failed conditions
0.0% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

@sbansla sbansla requested a review from Copilot September 25, 2025 03:25
@sbansla sbansla marked this pull request as ready for review September 25, 2025 03:25
@sbansla sbansla requested review from Copilot and removed request for Copilot and tiwarishubham635 September 25, 2025 03:26
Copy link
Copy Markdown

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 adds a new App IEndpoint type to handle app-related endpoints in the Twilio SDK. The implementation ensures proper prefixing with "app:" and includes corresponding test coverage.

  • Added App class implementing IEndpoint interface with automatic prefix handling
  • Included comprehensive test coverage for various input scenarios

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/Twilio/Types/App.cs Implements the App class with prefix validation and string conversion
test/Twilio.Test/Types/AppTest.cs Adds unit tests for the App class ToString method

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

Comment thread src/Twilio/Types/App.cs
Comment on lines +18 to +21
if (!app.ToLower().StartsWith(PREFIX))
{
app = PREFIX + app;
}
Copy link

Copilot AI Sep 25, 2025

Choose a reason for hiding this comment

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

The prefix check uses app.ToLower().StartsWith(PREFIX) but PREFIX is lowercase 'app:'. This means inputs like 'APP:test' or 'App:test' will incorrectly have the prefix added again, resulting in 'app:APP:test' or 'app:App:test'. Use case-insensitive comparison: !app.StartsWith(PREFIX, StringComparison.OrdinalIgnoreCase)

Copilot uses AI. Check for mistakes.
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.

It is working fine, check again.
app= "hello", outcome(_app) = "app:hello"
app= "app:hello", outcome(_app) = "app:hello"
app= "App:hello", outcome(_app) = "App:hello"

@sonarqubecloud
Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
0.0% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

@sbansla sbansla merged commit 6b275a4 into main Sep 25, 2025
10 of 11 checks passed
@sbansla sbansla deleted the add-app-endpoint-type branch September 25, 2025 08:47
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