Skip to content
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

Remove InternalsVisibleTo conditions in BlazorUI project file (#9495) #9496

Merged

Conversation

msynk
Copy link
Member

@msynk msynk commented Dec 15, 2024

closes #9495

Summary by CodeRabbit

  • New Features

    • Enhanced build process for the .NET 9.0 framework, including structured tasks for JavaScript and CSS compilation.
  • Bug Fixes

    • Streamlined handling of internal visibility directives, ensuring consistent inclusion across configurations.

@msynk msynk requested a review from ysmoradi December 15, 2024 16:05
Copy link

coderabbitai bot commented Dec 15, 2024

Walkthrough

The pull request modifies the Bit.BlazorUI.csproj project configuration file. The changes involve restructuring the <ItemGroup> elements and adding a new <Target> named BeforeBuildTasks specifically for the net9.0 framework. The modifications simplify the handling of InternalsVisibleTo directives by removing configuration-specific conditions and introduce a structured build process that includes Node.js dependencies, JavaScript, and CSS build steps.

Changes

File Change Summary
src/BlazorUI/Bit.BlazorUI/Bit.BlazorUI.csproj - Removed conditional <ItemGroup> for 'Debug' configuration
- Removed <ItemGroup> for 'Release' configuration
- Added BeforeBuildTasks target for net9.0
- Included targets for Node.js dependencies, JavaScript, and CSS builds

Assessment against linked issues

Objective Addressed Explanation
Fix InternalsVisibleTo attribute issues [#9495]

Poem

🐰 A project file's dance, so neat and bright,
Configs aligned with build's delight!
Node.js, CSS, and JavaScript too,
Internals visible, our code shines through!
Blazor magic, with rabbit's might! 🚀

Tip

CodeRabbit's docstrings feature is now available as part of our Early Access Program! Simply use the command @coderabbitai generate docstrings to have CodeRabbit automatically generate docstrings for your pull request. This feature will be included in our Pro Plan when released.


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 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: 0

🧹 Nitpick comments (1)
src/BlazorUI/Bit.BlazorUI/Bit.BlazorUI.csproj (1)

Line range hint 67-86: LGTM! Well-structured build tasks with proper incremental build support

The build tasks are well-organized with:

  • Clear input/output dependencies for incremental builds
  • Proper sequencing of Node.js, JavaScript, and CSS tasks
  • Configuration-specific handling (minification for Release)

Consider adding error handling for npm install failures:

 <Target Name="InstallNodejsDependencies" Inputs="package.json" Outputs="node_modules\.package-lock.json">
-    <Exec Command="npm install" StandardOutputImportance="high" StandardErrorImportance="high" />
+    <Exec Command="npm install" StandardOutputImportance="high" StandardErrorImportance="high" IgnoreExitCode="false" />
 </Target>
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 2ce3e26 and eaf042f.

📒 Files selected for processing (1)
  • src/BlazorUI/Bit.BlazorUI/Bit.BlazorUI.csproj (1 hunks)
🔇 Additional comments (3)
src/BlazorUI/Bit.BlazorUI/Bit.BlazorUI.csproj (3)

Line range hint 8-12: LGTM! Well-structured build process integration

The ResolveStaticWebAssetsInputsDependsOn property correctly integrates the new BeforeBuildTasks into the build pipeline for net9.0.


Line range hint 4-7: LGTM! Clean multi-targeting configuration

The project configuration is well-structured with:

  • Proper multi-targeting for net9.0 and net8.0
  • Correct framework-specific package references
  • Appropriate trimming and implicit using settings

Also applies to: 23-26


19-22: Verify security implications of unconditional internal visibility

The removal of Debug/Release conditions means internal members are now always visible to Bit.BlazorUI.Extras. Additionally, there are two InternalsVisibleTo entries with different public keys, which is unusual.

Let's verify the usage and necessity of both public keys:

Consider:

  1. Whether unconditional internal visibility aligns with security requirements
  2. If both public keys are necessary or if one can be removed
✅ Verification successful

Based on the gathered information, I can now provide the final response:

Unconditional internal visibility is appropriate in this context

The presence of both public keys in Bit.BlazorUI.csproj is justified as Bit.BlazorUI.Extras is a legitimate companion project that extends the main UI library's functionality, as evidenced by:

  1. Direct project reference in Bit.BlazorUI.Extras.csproj
  2. Extensive integration in demo projects and templates
  3. Shared build configuration and styling

The removal of Debug/Release conditions for InternalsVisibleTo is acceptable since:

  • The projects are tightly coupled by design
  • Bit.BlazorUI.Extras is part of the same trusted component suite
  • The relationship between these projects is permanent, not configuration-dependent
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for references to Bit.BlazorUI.Extras to understand usage patterns
rg -l "Bit\.BlazorUI\.Extras" --type csproj

# Check if both public keys are actively used
rg -l "00240000048000009400000006020000002400005253413100040000010001008d726fe8" --type csproj
rg -l "002400000480000094000000060200000024000052534131000400000100010081a58360" --type csproj

Length of output: 328


Script:

#!/bin/bash
# Search for references to Bit.BlazorUI.Extras and public keys without file type restriction
rg -l "Bit\.BlazorUI\.Extras"

# Check if both public keys are actively used
rg -l "00240000048000009400000006020000002400005253413100040000010001008d726fe8"
rg -l "002400000480000094000000060200000024000052534131000400000100010081a58360"

# List all csproj files to understand project structure
fd ".+\.csproj$"

Length of output: 5762


Script:

#!/bin/bash
# Check the content of Bit.BlazorUI.Extras.csproj to verify signing configuration
cat "src/BlazorUI/Bit.BlazorUI.Extras/Bit.BlazorUI.Extras.csproj"

# Check if there were any previous conditions in git history
git log -p -- "src/BlazorUI/Bit.BlazorUI/Bit.BlazorUI.csproj" | grep -A 5 -B 5 "InternalsVisibleTo"

Length of output: 3759

@msynk msynk merged commit c444ba5 into bitfoundation:develop Dec 15, 2024
3 checks passed
@msynk msynk deleted the 9495-blazorui-InternalsVisibleTo-issues branch December 15, 2024 16:19
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.

The BlazorUI has issues with the InternalsVisibleTo attribute
2 participants