Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fixed sending issue with token overload #36

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

mitchelsellers
Copy link
Contributor

@mitchelsellers mitchelsellers commented Jan 26, 2025

Updated non-breaking dependencies in NuGet packages

Summary by CodeRabbit

  • Package Updates

    • Updated test project package references:
      • Upgraded coverlet.collector, Microsoft.AspNetCore.Hosting.Abstractions, Microsoft.NET.Test.Sdk, Moq, xunit, and xunit.runner.visualstudio to their latest versions
    • Updated SendGrid and Microsoft.SourceLink.GitHub package versions
  • Code Improvements

    • Enhanced SendMessageAsync method to better handle token replacements in email messages
  • CI/CD Enhancements

    • Updated GitHub Actions in CI and release workflows to utilize newer versions for improved functionality and performance

- Fixes #32

Updated non-breaking dependencies in NuGet packages
Copy link

coderabbitai bot commented Jan 26, 2025

Walkthrough

This pull request focuses on updating package references in the SendGrid email utility project and modifying the SendGridService to properly handle template tokens. The changes include version updates for test project dependencies and SendGrid-related packages, along with a specific modification to the SendMessageAsync method to correctly pass tokens during message sending.

Changes

File Change Summary
...Email.SendGrid.Tests.csproj Updated package references:
- coverlet.collector: 6.0.2 → 6.0.4
- Microsoft.AspNetCore.Hosting.Abstractions: 2.2.0 → 2.3.0
- Microsoft.NET.Test.Sdk: 17.9.0 → 17.12.0
- Moq: 4.20.70 → 4.20.72
- xunit: 2.7.0 → 2.9.3
- xunit.runner.visualstudio: 2.5.7 → 3.0.1
...Email.SendGrid.csproj Updated package references:
- Microsoft.SourceLink.GitHub: 1.1.1 → 8.0.0
- SendGrid: 9.29.2 → 9.29.3
SendGridService.cs Modified SendMessageAsync method to pass tokens parameter instead of null

Assessment against linked issues

Objective Addressed Explanation
Process template tokens correctly [#32]

Possibly related PRs

Poem

🐰 A SendGrid tale of tokens bright,
Packages dancing with version's might,
From null to tokens, a method's delight,
Code leaps forward with rabbit's insight,
Sending emails with newfound height! 📧✨


🪧 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. (Beta)
  • @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.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

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

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f99e133 and 425221d.

📒 Files selected for processing (3)
  • src/NetCore.Utilities.Email.SendGrid.Tests/NetCore.Utilities.Email.SendGrid.Tests.csproj (1 hunks)
  • src/NetCore.Utilities.Email.SendGrid/NetCore.Utilities.Email.SendGrid.csproj (1 hunks)
  • src/NetCore.Utilities.Email.SendGrid/SendGridService.cs (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Codacy Static Code Analysis
🔇 Additional comments (2)
src/NetCore.Utilities.Email.SendGrid/SendGridService.cs (1)

61-61: LGTM! Token handling fix properly implemented.

The change correctly propagates the tokens parameter instead of passing null, fixing the token overload issue.

src/NetCore.Utilities.Email.SendGrid/NetCore.Utilities.Email.SendGrid.csproj (1)

43-47: LGTM! Package updates align with project requirements.

  • SendGrid update (9.29.2 → 9.29.3) is a patch version, likely containing bug fixes
  • Microsoft.SourceLink.GitHub update (1.1.1 → 8.0.0) aligns with net8.0 target framework

Comment on lines +10 to 23
<PackageReference Include="coverlet.collector" Version="6.0.4">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.AspNetCore.Hosting.Abstractions" Version="2.2.0" />
<PackageReference Include="Microsoft.AspNetCore.Hosting.Abstractions" Version="2.3.0" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="8.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="Moq" Version="4.20.70" />
<PackageReference Include="xunit" Version="2.7.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.7">
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageReference Include="Moq" Version="4.20.72" />
<PackageReference Include="xunit" Version="2.9.3" />
<PackageReference Include="xunit.runner.visualstudio" Version="3.0.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
Copy link

Choose a reason for hiding this comment

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

💡 Codebase verification

Microsoft.AspNetCore.Hosting.Abstractions 2.3.0 is incompatible with .NET 8.0

This package version is from the ASP.NET Core 2.x era and is not compatible with .NET 8.0. For .NET 8.0 projects:

  • Remove the explicit reference to Microsoft.AspNetCore.Hosting.Abstractions
  • These abstractions are now part of the Microsoft.AspNetCore.App shared framework in .NET 8.0
🔗 Analysis chain

Verify compatibility of Microsoft.AspNetCore.Hosting.Abstractions upgrade.

While most package updates are minor versions or patches, the jump from 2.2.0 to 2.3.0 for Microsoft.AspNetCore.Hosting.Abstractions is significant. Let's verify its compatibility with net8.0.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check package compatibility with net8.0

# Check if Microsoft.AspNetCore.Hosting.Abstractions 2.3.0 supports net8.0
curl -s "https://api.nuget.org/v3/registration5-gz-semver2/microsoft.aspnetcore.hosting.abstractions/2.3.0.json" | jq -r '.catalogEntry.dependencyGroups[].targetFramework'

# Check for any reported issues with this version
gh api graphql -f query='
{
  repository(owner: "dotnet", name: "aspnetcore") {
    issues(first: 5, filterBy: {labels: ["area/hosting"], states: OPEN}) {
      nodes {
        title
        url
        labels(first: 5) {
          nodes {
            name
          }
        }
      }
    }
  }
}'

Length of output: 585


Script:

#!/bin/bash
# Description: Verify package information using nuget.org API

# Check package versions
curl -s "https://api.nuget.org/v3/registration5-gz-semver2/microsoft.aspnetcore.hosting.abstractions/index.json" | jq -r '.items[].items[].catalogEntry.version'

# Get more details about version 2.3.0
curl -s "https://api.nuget.org/v3-flatcontainer/microsoft.aspnetcore.hosting.abstractions/index.json" | jq -r '.versions[]' | sort -V

Length of output: 672

Copy link

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
+0.00% (target: -1.00%) 0.00%
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (f99e133) 120 59 49.17%
Head commit (0faedcd) 120 (+0) 59 (+0) 49.17% (+0.00%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#36) 1 0 0.00%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

Codacy stopped sending the deprecated coverage status on June 5th, 2024. Learn more

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (2)
.github/workflows/release-build.yml (1)

24-24: Remove trailing whitespace.

There are trailing spaces on this line.

-        dotnet-version: 8.0.x
-        
+        dotnet-version: 8.0.x
🧰 Tools
🪛 yamllint (1.35.1)

[error] 24-24: trailing spaces

(trailing-spaces)

.github/workflows/ci-build.yml (1)

25-25: Remove trailing whitespace.

There are trailing spaces on this line.

-        dotnet-version: 8.0.x
-        
+        dotnet-version: 8.0.x
🧰 Tools
🪛 yamllint (1.35.1)

[error] 25-25: trailing spaces

(trailing-spaces)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 425221d and 0faedcd.

📒 Files selected for processing (2)
  • .github/workflows/ci-build.yml (1 hunks)
  • .github/workflows/release-build.yml (1 hunks)
🧰 Additional context used
🪛 yamllint (1.35.1)
.github/workflows/ci-build.yml

[error] 25-25: trailing spaces

(trailing-spaces)

.github/workflows/release-build.yml

[error] 24-24: trailing spaces

(trailing-spaces)

🔇 Additional comments (3)
.github/workflows/release-build.yml (2)

26-28: LGTM! Improved version pinning.

The change from 6.x to 6.0.5 for GitVersion improves build reproducibility by pinning to a specific version.


21-21: Verify compatibility with setup-dotnet@v4.

The upgrade from v3 to v4 of setup-dotnet is a major version bump that could introduce breaking changes. While v4 is the latest stable version with .NET 8 support, we should verify its compatibility.

Run this script to check the changelog and any known issues:

Also applies to: 26-28, 32-32

✅ Verification successful

The upgrade to setup-dotnet@v4 is safe to proceed

The breaking changes in v4 are internal improvements that actually enhance reliability, particularly for version installations. Your usage of .NET 8.0.x is well-supported in v4. While there are some open issues with v4, they don't affect your specific setup.

Note: Monitor the first few workflow runs after the upgrade, as there's an open issue (#588) about URL changes affecting some workflows.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for breaking changes in setup-dotnet v4

# Fetch the changelog and release notes
curl -s https://api.github.com/repos/actions/setup-dotnet/releases | jq -r '.[] | select(.tag_name=="v4.0.0") | .body'

# Check for any reported issues related to v4 migration
gh api graphql -f query='
{
  search(query: "repo:actions/setup-dotnet is:issue label:bug v4", type: ISSUE, first: 5) {
    nodes {
      ... on Issue {
        title
        url
        state
      }
    }
  }
}'

Length of output: 3228


Script:

#!/bin/bash
# Check .NET version specifications and global.json
echo "Checking .NET version specifications in workflow files:"
fd -e yml -e yaml . .github/workflows --exec grep -l "dotnet-version"

echo -e "\nChecking for global.json files:"
fd global.json

echo -e "\nIf global.json exists, show its content:"
fd global.json -x cat {}

echo -e "\nChecking specific .NET version patterns in workflow files:"
fd -e yml -e yaml . .github/workflows --exec grep -A 1 -B 1 "dotnet-version"

Length of output: 791

.github/workflows/ci-build.yml (1)

22-22: LGTM! Consistent workflow configurations.

The version updates in the CI workflow match those in the release workflow, maintaining consistency across the build pipeline:

  • Upgrade to setup-dotnet@v4
  • Update to gittools/actions v3.1.11
  • Pin GitVersion to 6.0.5

Also applies to: 27-29, 33-33

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Overload Not Sending Properly
1 participant