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

Add ability to test multiple OSes #275

Open
wants to merge 28 commits into
base: main
Choose a base branch
from
Open

Conversation

networkfusion
Copy link
Member

@networkfusion networkfusion commented Jun 14, 2024

Description

Adds smoke tests for compiling the tool against multiple OSes and framework versions.

  • .Net 8 as LTS.
  • .Net 6 for Mono support.

Motivation and Context

Improves ability to ensure the tool will work when used against them.

How Has This Been Tested?

Screenshots

Types of changes

  • Improvement (non-breaking change that improves a feature, code or algorithm)
  • Bug fix (non-breaking change which fixes an issue with code or algorithm)
  • New feature (non-breaking change which adds functionality to code)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Config and build (change in the configuration and build system, has no impact on code or features)
  • Dependencies (update dependencies and changes associated, has no impact on code or features)
  • Unit Tests (add new Unit Test(s) or improved existing one(s), has no impact on code or features)
  • Documentation (changes or updates in the documentation, has no impact on code or features)

Checklist:

  • My code follows the code style of this project (only if there are changes in source code).
  • My changes require an update to the documentation (there are changes that require the docs website to be updated).
  • I have updated the documentation accordingly (the changes require an update on the docs in this repo).
  • I have read the CONTRIBUTING document.
  • I have tested everything locally and all new and existing tests passed (only if there are changes in source code).
  • I have added new tests to cover my changes.

Summary by CodeRabbit

  • Chores
    • Updated vmImage settings in pipeline configuration for enhanced flexibility.
    • Added a comment in the build configuration to indicate potential future Arm64 builds.
    • Updated Nerdbank.GitVersioning package to version 3.6.139 for improved performance and security.

Switch build to any CPU
Copy link

coderabbitai bot commented Jun 14, 2024

Walkthrough

The changes primarily focus on modifying the job configurations in the azure-pipelines.yml file to improve flexibility and future capabilities, such as potential Arm64 support. Additionally, version updates for the Nerdbank.GitVersioning package across multiple packages.lock.json files were implemented.

Changes

File Summary
azure-pipelines.yml Altered vmImage and buildPlatform settings for flexibility and added TODO comments for Arm64 builds
nanoFirmwareFlasher.Library/... Updated Nerdbank.GitVersioning package from 3.6.133 to 3.6.139
nanoFirmwareFlasher.Tool/... Updated Nerdbank.GitVersioning package from 3.6.133 to 3.6.139

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>.
    • 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 generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @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 as 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 resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration 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.

@networkfusion networkfusion marked this pull request as draft June 14, 2024 16:43
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: 2

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between eb003fb and 54b8c91.

Files selected for processing (1)
  • azure-pipelines.yml (2 hunks)
Additional context used
yamllint
azure-pipelines.yml

[error] 24-24: trailing spaces (trailing-spaces)


[error] 40-40: wrong indentation: expected 2 but found 0 (indentation)


[error] 45-45: trailing spaces (trailing-spaces)


[error] 46-46: wrong indentation: expected 4 but found 2 (indentation)


[error] 64-64: line too long (82 > 80 characters) (line-length)


[error] 65-65: trailing spaces (trailing-spaces)


[error] 71-71: line too long (81 > 80 characters) (line-length)


[error] 72-72: trailing spaces (trailing-spaces)


[error] 74-74: line too long (119 > 80 characters) (line-length)


[error] 75-75: line too long (162 > 80 characters) (line-length)


[error] 76-76: trailing spaces (trailing-spaces)


[error] 80-80: line too long (98 > 80 characters) (line-length)


[error] 88-88: trailing spaces (trailing-spaces)


[error] 90-90: line too long (88 > 80 characters) (line-length)


[error] 91-91: trailing spaces (trailing-spaces)


[error] 101-101: line too long (87 > 80 characters) (line-length)


[error] 103-103: line too long (123 > 80 characters) (line-length)


[error] 115-115: trailing spaces (trailing-spaces)


[error] 122-122: trailing spaces (trailing-spaces)


[error] 139-139: line too long (103 > 80 characters) (line-length)


[error] 140-140: line too long (92 > 80 characters) (line-length)


[error] 141-141: line too long (87 > 80 characters) (line-length)


[error] 147-147: trailing spaces (trailing-spaces)


[error] 149-149: line too long (220 > 80 characters) (line-length)


[error] 153-153: trailing spaces (trailing-spaces)


[error] 172-172: line too long (83 > 80 characters) (line-length)


[error] 175-175: wrong indentation: expected 4 but found 2 (indentation)


[error] 191-191: trailing spaces (trailing-spaces)


[error] 193-193: trailing spaces (trailing-spaces)


[error] 199-199: line too long (94 > 80 characters) (line-length)


[error] 204-204: wrong indentation: expected 4 but found 2 (indentation)


[error] 242-242: line too long (98 > 80 characters) (line-length)


[error] 284-284: wrong indentation: expected 6 but found 8 (indentation)


[error] 286-286: line too long (104 > 80 characters) (line-length)


[error] 296-296: line too long (94 > 80 characters) (line-length)


[error] 308-308: wrong indentation: expected 6 but found 8 (indentation)


[error] 309-309: line too long (93 > 80 characters) (line-length)


[error] 341-341: line too long (104 > 80 characters) (line-length)


[error] 345-345: line too long (110 > 80 characters) (line-length)


[error] 375-375: trailing spaces (trailing-spaces)


[error] 388-388: trailing spaces (trailing-spaces)


[error] 425-425: line too long (98 > 80 characters) (line-length)


[error] 435-435: trailing spaces (trailing-spaces)


[error] 443-443: line too long (127 > 80 characters) (line-length)


[error] 467-467: line too long (86 > 80 characters) (line-length)


[error] 468-468: line too long (113 > 80 characters) (line-length)


[error] 469-469: line too long (97 > 80 characters) (line-length)


[error] 470-470: line too long (105 > 80 characters) (line-length)


[error] 471-471: line too long (98 > 80 characters) (line-length)


[error] 492-492: wrong indentation: expected 4 but found 2 (indentation)


[error] 505-505: wrong indentation: expected 4 but found 2 (indentation)


[error] 508-508: trailing spaces (trailing-spaces)

Additional comments not posted (1)
azure-pipelines.yml (1)

176-186: Dynamic VM image selection using $(imageName) enhances flexibility for multi-OS testing.

Verification successful

The imageName variable is correctly defined within the matrix strategy and is used in the vmImage setting. There are no other occurrences of imageName that need attention.

Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify the definition and usage of `imageName` variable in the pipeline.

# Test: Search for the definition of `imageName` and its usage.
rg --type yaml $'imageName'

Length of output: 243

azure-pipelines.yml Outdated Show resolved Hide resolved
azure-pipelines.yml Outdated Show resolved Hide resolved
@networkfusion networkfusion marked this pull request as ready for review June 14, 2024 21:04
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

Outside diff range and nitpick comments (1)
azure-pipelines.yml (1)

185-185: Consider adjusting the comment for clarity.

The comment # TODO: Attempt to aim for Arm64 builds could be more actionable. Consider specifying what needs to be done or what is blocking the Arm64 builds.

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 54b8c91 and 1a485dc.

Files ignored due to path filters (3)
  • .github/workflows/smoketest-build.yml is excluded by none and included by none
  • nanoFirmwareFlasher.Library/nanoFirmwareFlasher.Library.csproj is excluded by none and included by none
  • nanoFirmwareFlasher.Tool/nanoFirmwareFlasher.Tool.csproj is excluded by none and included by none
Files selected for processing (3)
  • azure-pipelines.yml (1 hunks)
  • nanoFirmwareFlasher.Library/packages.lock.json (2 hunks)
  • nanoFirmwareFlasher.Tool/packages.lock.json (1 hunks)
Files skipped from review due to trivial changes (2)
  • nanoFirmwareFlasher.Library/packages.lock.json
  • nanoFirmwareFlasher.Tool/packages.lock.json
Additional context used
yamllint
azure-pipelines.yml

[error] 24-24: trailing spaces (trailing-spaces)


[error] 40-40: wrong indentation: expected 2 but found 0 (indentation)


[error] 45-45: trailing spaces (trailing-spaces)


[error] 46-46: wrong indentation: expected 4 but found 2 (indentation)


[error] 64-64: line too long (82 > 80 characters) (line-length)


[error] 65-65: trailing spaces (trailing-spaces)


[error] 71-71: line too long (81 > 80 characters) (line-length)


[error] 72-72: trailing spaces (trailing-spaces)


[error] 74-74: line too long (119 > 80 characters) (line-length)


[error] 75-75: line too long (162 > 80 characters) (line-length)


[error] 76-76: trailing spaces (trailing-spaces)


[error] 80-80: line too long (98 > 80 characters) (line-length)


[error] 88-88: trailing spaces (trailing-spaces)


[error] 90-90: line too long (88 > 80 characters) (line-length)


[error] 91-91: trailing spaces (trailing-spaces)


[error] 101-101: line too long (87 > 80 characters) (line-length)


[error] 103-103: line too long (123 > 80 characters) (line-length)


[error] 115-115: trailing spaces (trailing-spaces)


[error] 122-122: trailing spaces (trailing-spaces)


[error] 139-139: line too long (103 > 80 characters) (line-length)


[error] 140-140: line too long (92 > 80 characters) (line-length)


[error] 141-141: line too long (87 > 80 characters) (line-length)


[error] 147-147: trailing spaces (trailing-spaces)


[error] 149-149: line too long (220 > 80 characters) (line-length)


[error] 153-153: trailing spaces (trailing-spaces)


[error] 172-172: line too long (83 > 80 characters) (line-length)


[error] 175-175: wrong indentation: expected 4 but found 2 (indentation)


[error] 183-183: trailing spaces (trailing-spaces)


[error] 191-191: line too long (94 > 80 characters) (line-length)


[error] 196-196: wrong indentation: expected 4 but found 2 (indentation)


[error] 216-216: trailing spaces (trailing-spaces)


[error] 239-239: line too long (98 > 80 characters) (line-length)


[error] 281-281: wrong indentation: expected 6 but found 8 (indentation)


[error] 283-283: line too long (104 > 80 characters) (line-length)


[error] 293-293: line too long (94 > 80 characters) (line-length)


[error] 305-305: wrong indentation: expected 6 but found 8 (indentation)


[error] 306-306: line too long (93 > 80 characters) (line-length)


[error] 338-338: line too long (104 > 80 characters) (line-length)


[error] 342-342: line too long (110 > 80 characters) (line-length)


[error] 376-376: trailing spaces (trailing-spaces)


[error] 389-389: trailing spaces (trailing-spaces)


[error] 426-426: line too long (98 > 80 characters) (line-length)


[error] 436-436: trailing spaces (trailing-spaces)


[error] 444-444: line too long (127 > 80 characters) (line-length)


[error] 469-469: line too long (86 > 80 characters) (line-length)


[error] 470-470: line too long (113 > 80 characters) (line-length)


[error] 471-471: line too long (97 > 80 characters) (line-length)


[error] 472-472: line too long (105 > 80 characters) (line-length)


[error] 473-473: line too long (98 > 80 characters) (line-length)


[error] 495-495: wrong indentation: expected 4 but found 2 (indentation)


[error] 508-508: wrong indentation: expected 4 but found 2 (indentation)


[error] 511-511: trailing spaces (trailing-spaces)

Additional comments not posted (2)
azure-pipelines.yml (2)

185-185: Review all jobs and steps for potential issues related to the change in the VM image.

Verification successful

We need to verify if there are any specific configurations or steps in the azure-pipelines.yml file that depend on the windows-latest image or x64 architecture. This will help us identify any potential issues when switching to Arm64 builds.


The search results indicate that the only reference to x64 in the azure-pipelines.yml file is the specific line you mentioned:

value: 'x64'  # TODO: Attempt to aim for Arm64 builds

This suggests that there are no other configurations or steps explicitly tied to the x64 architecture, and the comment is a reminder to attempt Arm64 builds in the future.

  • : The code does not show removed or replaced code, and the comment about aiming for Arm64 builds is accurate. No other steps or configurations in the pipeline are specifically tied to the x64 architecture.
Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify that all jobs and steps in the azure-pipelines.yml file are compatible with the new VM image settings.

# Test: Search for any job or step configurations that might be specific to the old VM image.
rg --type yaml $'windows-latest'

Length of output: 181



Script:

#!/bin/bash
# Description: Verify if there are any steps or configurations specific to the x64 architecture in the azure-pipelines.yml file.

# Test: Search for any job or step configurations that mention 'x64'.
rg --type yaml 'x64' azure-pipelines.yml

Length of output: 100


185-185: Ensure the $(imageName) variable is defined and correctly configured in the pipeline settings.

@@ -182,7 +182,7 @@ jobs:
- name: DOTNET_NOLOGO
value: true
- name: buildPlatform
value: 'x64'
value: 'x64' # TODO: Attempt to aim for Arm64 builds
Copy link

Choose a reason for hiding this comment

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

Update Windows-specific elements for compatibility with Ubuntu.

Please ensure that all Windows-specific elements such as PowerShell scripts, Windows-style paths, and environment variables are updated or replaced to ensure compatibility with the ubuntu-latest VM image.


strategy:
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
Copy link
Member

Choose a reason for hiding this comment

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

I'm not a super huge fan of testing on MacOS for costs reasons. So we will have to be very careful or run it on demand.

Copy link
Member Author

Choose a reason for hiding this comment

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

The macos-latest is a hosted (free) runner, To get the "full" benefit, it would be great to run on the macos-latest-xlarge image (as it builds on arm64) but that does indeed incur costs. Ultimately we need to wait for a free linux runner that is able to run on arm64.

Copy link
Member Author

Choose a reason for hiding this comment

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

But, would also add that there are lots of warnings that are made visible by having this smoke test.

Copy link
Member

Choose a reason for hiding this comment

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

Great then!

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

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 1a485dc and 57f18b4.

Files ignored due to path filters (1)
  • nanoFirmwareFlasher.Tool/nanoFirmwareFlasher.Tool.csproj is excluded by none and included by none
Files selected for processing (1)
  • azure-pipelines.yml (1 hunks)
Additional context used
yamllint
azure-pipelines.yml

[error] 24-24: trailing spaces (trailing-spaces)


[warning] 40-40: wrong indentation: expected 2 but found 0 (indentation)


[error] 45-45: trailing spaces (trailing-spaces)


[warning] 46-46: wrong indentation: expected 4 but found 2 (indentation)


[error] 65-65: trailing spaces (trailing-spaces)


[error] 71-71: trailing spaces (trailing-spaces)


[error] 73-73: trailing spaces (trailing-spaces)


[error] 97-97: trailing spaces (trailing-spaces)


[error] 104-104: trailing spaces (trailing-spaces)


[error] 129-129: trailing spaces (trailing-spaces)


[error] 135-135: trailing spaces (trailing-spaces)


[warning] 157-157: wrong indentation: expected 4 but found 2 (indentation)


[error] 165-165: trailing spaces (trailing-spaces)


[warning] 176-176: wrong indentation: expected 4 but found 2 (indentation)


[error] 196-196: trailing spaces (trailing-spaces)


[warning] 261-261: wrong indentation: expected 6 but found 8 (indentation)


[warning] 285-285: wrong indentation: expected 6 but found 8 (indentation)


[error] 356-356: trailing spaces (trailing-spaces)


[error] 369-369: trailing spaces (trailing-spaces)


[error] 416-416: trailing spaces (trailing-spaces)


[warning] 460-460: wrong indentation: expected 4 but found 2 (indentation)


[warning] 473-473: wrong indentation: expected 4 but found 2 (indentation)


[error] 476-476: trailing spaces (trailing-spaces)

Additional comments not posted (4)
azure-pipelines.yml (4)

167-167: Address formatting issues and trailing spaces.

There are several formatting issues and trailing spaces throughout the file as indicated by the static analysis tools. These should be cleaned up to maintain code quality and readability.

- value: 'x64'  # TODO: Attempt to aim for Arm64 builds
+ value: 'x64'  # TODO: Attempt to aim for Arm64 builds

Likely invalid or redundant comment.


167-167: Ensure compatibility of scripts with multiple OSes.

The pipeline uses several PowerShell scripts. With the introduction of 'ubuntu-latest' as a VM image, ensure these scripts are compatible with Linux environments or provide equivalent Bash scripts.


167-167: Update vmImage to use variable-based settings.

Changing vmImage from a hardcoded 'windows-latest' to a variable-based setting ($(imageName)) is a good practice for flexibility. However, ensure that the variable imageName is properly defined and managed within the pipeline to avoid configuration errors.


167-167: Consider the implications of the TODO comment for Arm64 builds.

The TODO comment suggests an aim to support Arm64 builds. This is a significant architectural shift that might require additional changes beyond just the build platform setting. Ensure that the entire pipeline, including dependencies and scripts, supports Arm64 architecture.

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.

5 participants