Skip to content

Conversation

Jack251970
Copy link
Member

@Jack251970 Jack251970 commented Aug 7, 2025

Changes

Remove unnecessary runtime files for Flow.Launcher

Size Change

Original:

image

After:

image

Copy link

gitstream-cm bot commented Aug 7, 2025

Be a legend 🏆 by adding a before and after screenshot of the changes you made, especially if they are around UI/UX.

@coderabbitai coderabbitai bot added the enhancement New feature or request label Aug 7, 2025
Copy link
Contributor

coderabbitai bot commented Aug 7, 2025

📝 Walkthrough

Walkthrough

The project file was updated to include two new MSBuild targets that automatically remove unnecessary runtime-specific directories from the build and publish outputs after the respective processes complete. This cleanup targets directories for various non-required platforms and architectures.

Changes

Cohort / File(s) Change Summary
MSBuild Targets Addition
Flow.Launcher/Flow.Launcher.csproj
Added RemoveUnnecessaryRuntimesAfterBuild and RemoveUnnecessaryRuntimesAfterPublish targets to delete specific runtime directories after build and publish operations.

Sequence Diagram(s)

sequenceDiagram
    participant Developer
    participant MSBuild
    participant FileSystem

    Developer->>MSBuild: Build or Publish project
    MSBuild->>MSBuild: Execute Build/Publish
    MSBuild->>MSBuild: Run RemoveUnnecessaryRuntimesAfterBuild/AfterPublish
    MSBuild->>FileSystem: Delete unnecessary runtime directories
Loading

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Suggested reviewers

  • jjw24

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.


📜 Recent review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 9f5d578 and b9c18e7.

📒 Files selected for processing (1)
  • Flow.Launcher/Flow.Launcher.csproj (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • Flow.Launcher/Flow.Launcher.csproj
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
  • GitHub Check: gitStream workflow automation
  • GitHub Check: gitStream.cm
  • GitHub Check: gitStream.cm
  • GitHub Check: gitStream.cm
  • GitHub Check: build
✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch remove_runtime_files

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ 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.
    • Explain this complex logic.
    • 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 explain this code block.
  • 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 explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

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 generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests 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.

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
Contributor

@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

🧹 Nitpick comments (1)
Flow.Launcher/Flow.Launcher.csproj (1)

63-82: Duplication & maintainability: share logic with the build target

RemoveUnnecessaryRuntimesAfterPublish repeats the entire directory list. Any future tweak must be made in two places, risking drift.

Consider:

  1. Define the list once:
<PropertyGroup>
  <RuntimeDirsToRemove>
    browser-wasm;
    linux-arm;
    …;
    osx-x64
  </RuntimeDirsToRemove>
</PropertyGroup>
  1. Use a single helper target that receives either $(OutputPath) or $(PublishDir) as a parameter and runs the guarded RemoveDir logic shown above, then call that helper from both AfterTargets="Build" and AfterTargets="Publish".

This eliminates duplication and centralises the risky path list.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between dfe9616 and 2d1aa23.

📒 Files selected for processing (1)
  • Flow.Launcher/Flow.Launcher.csproj (1 hunks)
🧰 Additional context used
🧠 Learnings (5)
📓 Common learnings
Learnt from: taooceros
PR: Flow-Launcher/Flow.Launcher#2616
File: Flow.Launcher/Flow.Launcher.csproj:7-7
Timestamp: 2024-10-08T15:52:58.573Z
Learning: In the Flow Launcher project, the version number in the `Flow.Launcher.csproj` file is dynamically updated during the CI/CD process.
📚 Learning: in the flow launcher project, the version number in the `flow.launcher.csproj` file is dynamically u...
Learnt from: taooceros
PR: Flow-Launcher/Flow.Launcher#2616
File: Flow.Launcher/Flow.Launcher.csproj:7-7
Timestamp: 2024-10-08T15:52:58.573Z
Learning: In the Flow Launcher project, the version number in the `Flow.Launcher.csproj` file is dynamically updated during the CI/CD process.

Applied to files:

  • Flow.Launcher/Flow.Launcher.csproj
📚 Learning: when implementing collection item removal operations in flow launcher, always handle index boundarie...
Learnt from: Jack251970
PR: Flow-Launcher/Flow.Launcher#3561
File: Flow.Launcher/ViewModel/SelectBrowserViewModel.cs:53-58
Timestamp: 2025-05-21T10:37:07.696Z
Learning: When implementing collection item removal operations in Flow Launcher, always handle index boundaries carefully. After removing an item from a collection, ensure the updated index remains within valid bounds (>= 0 and < collection.Count) to prevent IndexOutOfRangeExceptions, especially when decrementing indexes.

Applied to files:

  • Flow.Launcher/Flow.Launcher.csproj
📚 Learning: the `$flowversion` parameter in the `post_build.ps1` script is intentionally left unset for dynamic ...
Learnt from: taooceros
PR: Flow-Launcher/Flow.Launcher#2616
File: Scripts/post_build.ps1:2-5
Timestamp: 2024-10-12T22:14:51.524Z
Learning: The `$flowVersion` parameter in the `post_build.ps1` script is intentionally left unset for dynamic assignment during script execution. The script contains logic to handle cases where this parameter remains unset.

Applied to files:

  • Flow.Launcher/Flow.Launcher.csproj
📚 Learning: in flow launcher, the updatepluginmanifestasync method in pluginsmanifest.cs already has comprehensi...
Learnt from: Jack251970
PR: Flow-Launcher/Flow.Launcher#3572
File: Flow.Launcher/App.xaml.cs:214-216
Timestamp: 2025-07-06T12:21:37.947Z
Learning: In Flow Launcher, the UpdatePluginManifestAsync method in PluginsManifest.cs already has comprehensive internal try-catch handling that logs exceptions and returns false on failure rather than throwing, making external try-catch wrappers unnecessary.

Applied to files:

  • Flow.Launcher/Flow.Launcher.csproj
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: gitStream workflow automation
  • GitHub Check: gitStream.cm
  • GitHub Check: build

@Jack251970 Jack251970 changed the title Remove unnecessary runtime files Set RuntimeIdentifier to win-x64 for directory build properties Aug 7, 2025
@Jack251970 Jack251970 changed the title Set RuntimeIdentifier to win-x64 for directory build properties Remove unnecessary runtime files Aug 7, 2025
Copy link

gitstream-cm bot commented Aug 7, 2025

🥷 Code experts: no user but you matched threshold 10

Jack251970, VictoriousRaptor have most 👩‍💻 activity in the files.
onesounds, jjw24 have most 🧠 knowledge in the files.

See details

Flow.Launcher/Flow.Launcher.csproj

Activity based on git-commit:

Jack251970 VictoriousRaptor
AUG 0 additions & 1 deletions
JUL 7 additions & 8 deletions
JUN 5 additions & 0 deletions 3 additions & 0 deletions
MAY
APR 3 additions & 1 deletions
MAR 1 additions & 5 deletions 1 additions & 1 deletions

Knowledge based on git-blame:
onesounds: 16%
jjw24: 12%

✨ Comment /gs review for LinearB AI review. Learn how to automate it here.

@Jack251970 Jack251970 enabled auto-merge August 7, 2025 01:36
@jjw24
Copy link
Member

jjw24 commented Aug 7, 2025

Are these unnecessary files introduced by the .Net upgrade?

Copy link
Member

@jjw24 jjw24 left a comment

Choose a reason for hiding this comment

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

Is there a better way to have the project not build these files than to remove them post-build?

@Jack251970
Copy link
Member Author

Are these unnecessary files introduced by the .Net upgrade?

Not sure. I noticed this when I was checking another package size issue.

@Jack251970
Copy link
Member Author

Jack251970 commented Aug 7, 2025

Is there a better way to have the project not build these files than to remove them post-build?

As far as I know, one another way is to set specific TargetIdentifier to win64 or win86 for Flow and it will remove the runtime folder. But this needs to build Flow with different architecture.

@Jack251970
Copy link
Member Author

Setting <RuntimeIdentifiers>win-x64;win-x86</RuntimeIdentifiers> makes no difference

@Jack251970 Jack251970 merged commit 4ae58c8 into dev Aug 7, 2025
21 checks passed
@Jack251970 Jack251970 deleted the remove_runtime_files branch August 7, 2025 19:51
@taooceros
Copy link
Member

Setting <RuntimeIdentifiers>win-x64;win-x86</RuntimeIdentifiers> makes no difference

I remember that this is problematic

@jjw24 jjw24 added bug Something isn't working and removed enhancement New feature or request 1 min review labels Aug 8, 2025
@jjw24 jjw24 added this to the 2.0.0 milestone Aug 8, 2025
TBM13 pushed a commit to TBM13/Flow.Launcher that referenced this pull request Aug 13, 2025
@coderabbitai coderabbitai bot mentioned this pull request Aug 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants