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

GitHub action #2986

Draft
wants to merge 11 commits into
base: dev
Choose a base branch
from
Draft

GitHub action #2986

wants to merge 11 commits into from

Conversation

taooceros
Copy link
Member

@taooceros taooceros commented Sep 21, 2024

Add a github action workflow to build artifact.

Why?

  • It's faster than appveyor
  • appveyor has a limit of download for artifact which is pretty easy to be reached when we are testing new artifacts.

Copy link
Contributor

coderabbitai bot commented Sep 21, 2024

📝 Walkthrough
Walkthrough

Walkthrough

The changes introduce a new GitHub Actions workflow defined in the .github/workflows/dotnet.yml file, which automates the build process for a .NET project. The workflow is triggered by specific events, including manual dispatch and pushes to designated branches. It encompasses steps for checking out the code, updating project versions, restoring dependencies, building the project, running tests, and uploading build artifacts. Additionally, modifications to the Scripts/post_build.ps1 file refine the logic for identifying files to delete based on their names and version information.

Changes

File Path Change Summary
.github/workflows/dotnet.yml Added a new GitHub Actions workflow for building a .NET project, including setup, build, test, and artifact upload steps.
Scripts/post_build.ps1 Modified logic for file deletion by updating the method of retrieving files to delete.

Poem

In the meadow where code does play,
A workflow hops in, brightening the day.
With builds and tests, it dances around,
Artifacts ready, joyfully found.
A rabbit's cheer for the changes we see,
Hooray for the code, as happy as can be! 🐇✨

Suggested labels

enhancement, CI/CD, cm-changes

Suggested reviewers

  • Garulf
  • Yusyuriv
  • jjw24
  • deefrawley

Tip

⚡🧪 Multi-step agentic review comment chat (experimental)
  • We're introducing multi-step agentic chat in review comments. This experimental feature enhances review discussions with the CodeRabbit agentic chat by enabling advanced interactions, including the ability to create pull requests directly from comments.
    - To enable this feature, set early_access to true under in the settings.

📜 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 0017971 and 01b4b27.

📒 Files selected for processing (1)
  • Scripts/post_build.ps1 (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • Scripts/post_build.ps1
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: build

🪧 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.

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.

@github-actions github-actions bot added this to the 1.19.2 milestone Sep 21, 2024

This comment has been minimized.

This comment has been minimized.

@jjw24
Copy link
Member

jjw24 commented Sep 21, 2024

This is a test pr?

@taooceros
Copy link
Member Author

Yeah mainly for arm64

@jjw24 jjw24 modified the milestones: 1.19.2, Future Sep 24, 2024
@taooceros taooceros mentioned this pull request Dec 2, 2024

This comment has been minimized.

Copy link

gitstream-cm bot commented Dec 2, 2024

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

This comment has been minimized.

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: 0

🧹 Nitpick comments (1)
.github/workflows/dotnet.yml (1)

31-40: Setup .NET Step and Trailing Whitespace Cleanup
The .NET setup step correctly specifies the version using actions/setup-dotnet@v4 with dotnet-version: 7.0.x. One minor issue: static analysis has flagged a trailing whitespace on line 38. Please remove any trailing spaces to ensure YAML lint compliance.

🧰 Tools
🪛 YAMLlint (1.35.1)

[error] 38-38: 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 27b6434 and 7f887f5.

📒 Files selected for processing (1)
  • .github/workflows/dotnet.yml (1 hunks)
🧰 Additional context used
🪛 YAMLlint (1.35.1)
.github/workflows/dotnet.yml

[error] 38-38: trailing spaces

(trailing-spaces)

⏰ Context from checks skipped due to timeout of 90000ms (5)
  • GitHub Check: gitStream workflow automation
  • GitHub Check: gitStream.cm
  • GitHub Check: gitStream workflow automation
  • GitHub Check: gitStream.cm
  • GitHub Check: build
🔇 Additional comments (11)
.github/workflows/dotnet.yml (11)

6-13: Review Workflow Trigger Configuration and Event Selection
The workflow is configured to trigger on manual dispatch (workflow_dispatch), pushes to the dev and master branches, and pull requests. This is a sound setup for many scenarios. However, since the PR objectives mention arm64 support, please verify that these triggers and the current runner selection fully support arm64-specific builds—or if additional conditional logic or a matrix strategy is needed.


17-21: Check Job Runner and Environment Settings for ARM64 Support
The job runs on windows-latest with environment variables such as a hardcoded FlowVersion. While hardcoding the version is consistent with previous discussions (see past review comments), note that windows-latest typically targets x64 architectures. Confirm that this is intentional given the PR’s focus on arm64 support. If arm64 builds are required, you might need to adjust the runner configuration (or introduce a matrix) to accommodate that architecture.


24-30: Validate the Project Version Update Step
The step that updates the project version using the vers-one/[email protected] action is implemented correctly. The glob pattern ("**/SolutionAssemblyInfo.cs") appropriately targets the necessary files, and the version is composed from the FlowVersion and BUILD_NUMBER environment variables.


41-47: Verify vpk Installation Logic
The step checking for the vpk tool and installing it if absent is clear and robust. The use of Get-Command provides a safe check before installation.


48-49: Confirm Dependency Restoration
Using dotnet restore --locked-mode ensures strict adherence to locked dependency versions, which is excellent for reproducible builds.


50-51: Build Step Validation
The build command (dotnet build --no-restore -c Release) efficiently utilizes the previous restore step and adheres to the Release configuration.


52-55: Service Initialization Considerations
The workflow configures and starts the Windows Search service (using sc config and net start) to support tests like ExplorerTest. Please verify that initiating this service in the GitHub Actions environment does not adversely affect other steps or lead to unexpected side effects.


56-57: Test Execution Confirmation
The test step, which executes dotnet test with no rebuild and enhanced verbosity, is correctly structured.


58-60: Post-Build Task Execution Review
The post-build task runs a PowerShell script (Scripts\post_build.ps1) with the proper versioning arguments. Please ensure that the script exists in the expected location and includes appropriate error handling.


61-96: Artifact Upload Steps Consistency and Maintenance
The series of artifact upload steps—covering the Plugin Nupkg, Flow Installer, Portable Version, Full nupkg, and Release Information—are consistently implemented using actions/upload-artifact@v4. Double-check that all file path patterns correctly match the output directories and that any future changes to output naming conventions are promptly updated in this workflow.


1-97: Overall Workflow Assessment
This new GitHub Actions workflow file effectively automates the build, test, and artifact upload pipeline for the .NET project. The structure is clear and adheres to best practices. Just ensure that the current runner configuration and environment settings align with the arm64 support objectives of this PR.

🧰 Tools
🪛 YAMLlint (1.35.1)

[error] 38-38: trailing spaces

(trailing-spaces)

This comment has been minimized.

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: 0

🧹 Nitpick comments (2)
.github/workflows/dotnet.yml (2)

14-22: Job and Environment Setup
The jobs section properly defines the build job with runs-on: windows-latest and sets the necessary environment variables. Note that the FlowVersion is hardcoded as 1.19.5 which aligns with our previous approach (as seen in AppVeyor). While this is acceptable for now, consider parameterizing the version in future updates for enhanced flexibility.


35-40: Caching Configuration Comment and Trailing Whitespace
The caching configuration is currently commented out, which is acceptable given our existing practices in AppVeyor.
Note: There is trailing whitespace detected on line 38. Removing this extra space will ensure compliance with YAML linting rules.

Proposed Diff:

-#            Flow.Launcher.Core/packages.lock.json            
+#            Flow.Launcher.Core/packages.lock.json
🧰 Tools
🪛 YAMLlint (1.35.1)

[error] 38-38: 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 7f887f5 and 8a5b699.

📒 Files selected for processing (1)
  • .github/workflows/dotnet.yml (1 hunks)
🧰 Additional context used
🪛 YAMLlint (1.35.1)
.github/workflows/dotnet.yml

[error] 38-38: trailing spaces

(trailing-spaces)

⏰ Context from checks skipped due to timeout of 90000ms (4)
  • GitHub Check: gitStream.cm
  • GitHub Check: gitStream.cm
  • GitHub Check: gitStream.cm
  • GitHub Check: build
🔇 Additional comments (16)
.github/workflows/dotnet.yml (16)

1-3: Clear Workflow Documentation
The workflow header and accompanying comments clearly explain the purpose and provide a reference to the official GitHub documentation.


4-5: Workflow Naming is Appropriate
The workflow is aptly named "Build", which succinctly reflects its function.


6-13: Workflow Trigger Configuration
The workflow is correctly triggered on manual dispatch, pushes to the "dev" and "master" branches, as well as pull requests. This comprehensive trigger setup ensures builds are run in all the required contexts.


23-31: Source Checkout and Version Update
The use of actions/checkout@v4 and the version updater (vers-one/[email protected]) is correctly implemented. The concatenation of FlowVersion with the build number to update the project version is clear and effective.


32-34: .NET Environment Setup
Setting up the .NET environment using actions/setup-dotnet@v4 with dotnet-version: 7.0.x is well configured and ensures consistency in the build environment.


41-42: vpk Tool Installation
The step to install the vpk tool using dotnet tool install -g vpk is straightforward and should function as expected.


43-44: Dependency Restoration
Executing dotnet restore --locked-mode to restore project dependencies is correctly implemented.


45-46: Build Step Execution
The build command (dotnet build --no-restore -c Release) is well-chosen for a Release configuration build and optimizes the process by skipping an additional restore.


47-51: Service Initialization
The step initializing the Windows Search service is clearly documented and critical for running ExplorerTest. Ensure that this method of service startup remains consistent across the Windows-latest runners used by GitHub Actions.


52-52: Test Execution
The command to run tests (dotnet test --no-build --verbosity normal -c Release) is succinctly and appropriately configured.


53-55: Post-Build Task Execution
Invoking the PowerShell script post_build.ps1 with the required version and build parameters is correct. This step effectively finalizes post-build tasks.


56-63: Plugin Artifact Upload
The artifact upload step for the Plugin NuGet package is set up correctly with clear artifact naming and proper compression settings.


64-69: Installer Artifact Upload
Uploading the Flow Installer executable is clearly defined and should reliably capture the intended artifact using the specified file pattern.


70-76: Portable Version Artifact Upload
The configuration for uploading the portable version artifact is correct, with clear naming and compression parameters.


77-84: Full NuGet Package Artifact Upload
The step for uploading the full NuGet package (FlowLauncher-*-full.nupkg) is correctly configured. Verify that the specified pattern accurately matches the generated package file.


85-91: Release Information Artifact Upload
The final artifact upload, which captures the release information from the RELEASES file, is correctly established.

This comment has been minimized.

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: 0

🧹 Nitpick comments (5)
.github/workflows/dotnet.yml (5)

14-22: Job Setup and Environment Variables
The 'build' job is configured to run on a Windows environment, with environment variables such as FlowVersion (hardcoded as 1.19.5), NUGET_CERT_REVOCATION_MODE, and BUILD_NUMBER set appropriately. If hardcoding the version is intentional—as confirmed in previous discussions—this is acceptable; otherwise, consider parameterizing this value for greater flexibility.


31-40: .NET Setup and Caching Configuration
Setting up .NET with version 7.0.x is correctly handled. The commented-out caching settings indicate previous configuration attempts; if caching is beneficial for your workflow, consider enabling them (after also addressing formatting issues such as the trailing spaces on line 38 flagged by YAMLlint).

🧰 Tools
🪛 YAMLlint (1.35.1)

[error] 38-38: trailing spaces

(trailing-spaces)


47-50: Initialize Windows Search Service
The steps to configure and start the Windows Search (WSearch) service are necessary for running tests such as ExplorerTest. Consider introducing error handling in case the service fails to start, which could otherwise interrupt the workflow.


53-55: Post-Build Task Execution
Invoking the PowerShell script post_build.ps1 to perform additional tasks is a sound approach. It might be worthwhile to verify that the script includes robust error handling and logging, to ease future troubleshooting.


77-84: Artifact Upload: Full Nupkg
The full NuGet package upload uses the artifact name FlowLauncher-*-full.nupkg. Note the slight naming difference (no period between "Flow" and "Launcher") when compared to other artifact names. Confirm whether this discrepancy is intentional or if consistency should be enforced.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 8a5b699 and cb47632.

📒 Files selected for processing (1)
  • .github/workflows/dotnet.yml (1 hunks)
🧰 Additional context used
🪛 YAMLlint (1.35.1)
.github/workflows/dotnet.yml

[error] 38-38: trailing spaces

(trailing-spaces)

⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: gitStream workflow automation
  • GitHub Check: gitStream.cm
  • GitHub Check: build
🔇 Additional comments (10)
.github/workflows/dotnet.yml (10)

1-3: Header Comments and Workflow Overview
The header comments clearly explain the purpose of this workflow and provide a useful link for more details.


4-13: Workflow Triggers Configuration
The workflow is triggered on manual dispatch, pushes to the dev and master branches, and pull requests. This setup is straightforward and aligns with your PR objectives. Ensure that branch names remain consistent with your repository strategy.


23-30: Version Update Step
The step using the vers-one/dotnet-project-version-updater action targets all SolutionAssemblyInfo.cs files correctly and updates the version using FlowVersion and BUILD_NUMBER. This ensures the assembly version reflects the current build accurately.


41-44: Tool Installation and Dependency Restoration
Installing the vpk tool and restoring dependencies using dotnet restore --locked-mode are both implemented appropriately, ensuring that tooling and packages are in sync with your build expectations.


45-46: Build Step
The build command (dotnet build --no-restore -c Release) is concise and effective, using the pre-restored dependencies to speed up the build process.


51-52: Test Execution Step
Executing tests with dotnet test --no-build --verbosity normal -c Release is efficient and avoids redundant builds. Ensure that your test suite is comprehensive to maintain quality.


56-62: Artifact Upload: Plugin Nupkg
The configuration for uploading the Plugin NuGet package is clearly specified with the correct artifact name and path. Double-check that the wildcard pattern (Flow.Launcher.Plugin.*.nupkg) aligns with the produced file naming conventions.


63-69: Artifact Upload: Flow Installer
The upload step for the Flow Installer executable correctly identifies the artifact and uses an appropriate path pattern (Flow-Launcher-*.exe). This consistency supports reliable artifact packaging.


70-76: Artifact Upload: Portable Version
Uploading the portable version is handled correctly, with clear naming (Flow-Launcher-Portable.zip) and path settings.


85-91: Artifact Upload: Release Information
The final step reliably packages the RELEASES file, ensuring that release information is preserved and uploaded as an artifact.

This comment has been minimized.

Copy link

gitstream-cm bot commented Mar 16, 2025

🥷 Code experts: jjw24

jjw24 has most 🧠 knowledge in the files.

See details

Scripts/post_build.ps1

Knowledge based on git-blame:
jjw24: 16%

To learn more about /:\ gitStream - Visit our Docs

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: 0

🧹 Nitpick comments (1)
Scripts/post_build.ps1 (1)

74-75: Comment contradicts the actual implementation

The comment on line 74 states "dotnet pack is not used because ran into issues," but the implementation now uses dotnet pack. Either update the comment to reflect the current implementation or document any special considerations that were addressed to make dotnet pack work.

-    # dotnet pack is not used because ran into issues, need to test installation and starting up if to use it.
+    # Now using dotnet pack instead of nuget pack for better integration with modern .NET SDK projects
     dotnet pack $spec -Version $version -BasePath $input -OutputDirectory $output -Properties Configuration=Release
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between cb47632 and 9cd4e80.

📒 Files selected for processing (1)
  • Scripts/post_build.ps1 (2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: gitStream workflow automation
  • GitHub Check: gitStream.cm
  • GitHub Check: build
🔇 Additional comments (3)
Scripts/post_build.ps1 (3)

36-36: Path update makes sense for GitHub Actions environment

Using $env:NUGET_PACKAGES instead of the previous $USERPROFILE path is more precise and works better in CI environments like GitHub Actions. This change properly aligns with the PR's objective of moving from AppVeyor to GitHub Actions.


43-43: Good fix for file filtering logic

The change to use -Filter parameter with $i.Name is an improvement over the previous approach. This ensures proper filtering by accessing the Name property of the FileInfo object, which makes the duplicate detection logic more accurate.


82-82: Path consistency improvement for Squirrel alias

This change aligns with the update on line 36, consistently using $env:NUGET_PACKAGES to locate Squirrel.exe. This is a good practice to ensure all references to the same tool use the same environment variable.

This comment has been minimized.

This comment has been minimized.

@taooceros taooceros marked this pull request as draft March 16, 2025 21:56

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

Copy link

@check-spelling-bot Report

🔴 Please review

See the 📂 files view, the 📜action log, or 📝 job summary for details.

❌ Errors Count
❌ forbidden-pattern 22
⚠️ ignored-expect-variant 1
⚠️ non-alpha-in-dictionary 19

See ❌ Event descriptions for more information.

If the flagged items are 🤯 false positives

If items relate to a ...

  • binary file (or some other file you wouldn't want to check at all).

    Please add a file path to the excludes.txt file matching the containing file.

    File paths are Perl 5 Regular Expressions - you can test yours before committing to verify it will match your files.

    ^ refers to the file's path from the root of the repository, so ^README\.md$ would exclude README.md (on whichever branch you're using).

  • well-formed pattern.

    If you can write a pattern that would match it,
    try adding it to the patterns.txt file.

    Patterns are Perl 5 Regular Expressions - you can test yours before committing to verify it will match your lines.

    Note that patterns can't match multiline strings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants