Skip to content

Add support for generics <T> #3137

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

Merged
merged 210 commits into from
Apr 17, 2025
Merged

Add support for generics <T> #3137

merged 210 commits into from
Apr 17, 2025

Conversation

josesimoes
Copy link
Member

@josesimoes josesimoes commented Mar 31, 2025

Description

  • Update metadata structs to support new elements following MDP changes.
  • Add metadata structs for MethodRef and TypeSpec.
  • Implement new (and update existing) decoders for metadata tokens.
  • Refactor code to parse new assembly format and metadata tables.
  • Refactor code initializing locals, types and constructors.
  • Rename several existing struct elements for clarity sake.
  • Global replacement of NULL with nullptr to address compiler warnings.
  • Code style fixes and compiler warnings throughout code base.
  • Disable LTO for Azure RTOS and TI SimpleLink platforms build.
  • Disable build for ST_NUCLEO64_F091RC target.
  • Update variable counter for builds.
  • Update AZDO pipeline to allow running mscorlib unit tests against a specific PR.
  • Update AZDO pipeline to download a specific MDP version from the pipelines.
  • Update AZDO pipeline to use preview nano msbuild components.

Motivation and Context

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)
  • Dev Containers (changes related with Dev Containers, has no impact on code or features)
  • Dependencies/declarations (update dependencies or assembly declarations and changes associated, 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).

Summary by CodeRabbit

  • Refactor / Style
    • Modernized the codebase by replacing legacy null-pointer constants with modern type-safe ones and standardizing variable and type naming for improved consistency.
    • Updated method signatures and variable declarations to enhance clarity and maintainability.
  • Build & CI Improvements
    • Optimized project configurations and pipeline scripts to streamline builds and enhance overall performance.
  • Chore
    • Removed obsolete source files and consolidated configuration adjustments across multiple targets, laying a more robust foundation for future enhancements.

These changes improve maintainability and stability without altering the end-user functionality.

(missed merge from upstream)
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

🧹 Nitpick comments (4)
azure-pipelines-templates/check-mdp-for-build.yml (4)

5-12: PowerShell Task: MDP Build Check Initialization
The first task correctly sets up a PowerShell script to check for an associated PR and builds an authorization header using a GitHub token. Verify that the substitution for $(GitHubToken) reliably injects the token and that error handling in case of token issues is appropriate.


13-20: PR Retrieval via GitHub API
The script uses Invoke-WebRequest to obtain PR details and converts the result from JSON. This technique is appropriate, but consider adding error handling in case the API call fails (for example, due to network issues or an invalid token).


21-25: PR Number Verification
The condition checking that the retrieved PR number matches the expected environment variable is clear and concise. It may be beneficial to include additional logging or error handling for unexpected mismatches in automated contexts.


26-31: Extracting PR Commit Message & Matching Build ID
The script extracts the commit message and uses a regex to search for the build ID pattern ([build with MDP buildId (\d+)]). This approach is clear; however, ensure that all commit messages adhere strictly to this format to reliably capture the build ID.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between c113215 and 67932ad.

📒 Files selected for processing (4)
  • azure-pipelines-nightly.yml (1 hunks)
  • azure-pipelines-templates/check-mdp-for-build.yml (1 hunks)
  • src/CLR/Core/Serialization/BinaryFormatter_stub.cpp (3 hunks)
  • src/CLR/Debugger/Debugger.cpp (122 hunks)
✅ Files skipped from review due to trivial changes (1)
  • azure-pipelines-nightly.yml
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/CLR/Core/Serialization/BinaryFormatter_stub.cpp
🧰 Additional context used
🪛 YAMLlint (1.35.1)
azure-pipelines-templates/check-mdp-for-build.yml

[error] 1-1: wrong new line character: expected \n

(new-lines)

⏰ Context from checks skipped due to timeout of 90000ms (29)
  • GitHub Check: nf-interpreter (Build_WIN32_nanoCLR)
  • GitHub Check: nf-interpreter (Build_Azure_RTOS_targets SL_STK3701A)
  • GitHub Check: nf-interpreter (Build_ESP32_targets ESP32_ETHERNET_KIT_1.2)
  • GitHub Check: nf-interpreter (Build_ESP32_targets ESP32_S3_ALL)
  • GitHub Check: nf-interpreter (Build_ESP32_targets ESP32_H2_THREAD)
  • GitHub Check: nf-interpreter (Build_ESP32_targets ESP32_C6_THREAD)
  • GitHub Check: nf-interpreter (Build_ESP32_targets ESP32_C3)
  • GitHub Check: nf-interpreter (Build_STM32_targets ST_STM32F769I_DISCOVERY)
  • GitHub Check: nf-interpreter (Build_ESP32_targets ESP32_BLE_REV0)
  • GitHub Check: nf-interpreter (Build_ESP32_targets ESP32_PSRAM_REV0)
  • GitHub Check: nf-interpreter (Build_NXP_targets NXP_MIMXRT1060_EVK)
  • GitHub Check: nf-interpreter (Build_STM32_targets ST_STM32F429I_DISCOVERY)
  • GitHub Check: nf-interpreter (Build_TI_SimpleLink_targets TI_CC1352R1_LAUNCHXL_915)
  • GitHub Check: nf-interpreter (Check_Code_Style)
  • GitHub Check: nf-interpreter (Nightly build) (Build_STM32_targets ORGPAL_PALX)
  • GitHub Check: nf-interpreter (Nightly build) (Build_STM32_targets ORGPAL_PALTHREE)
  • GitHub Check: nf-interpreter (Nightly build) (Check_Build_Options)
  • GitHub Check: nf-interpreter (Check_Build_Options)
  • GitHub Check: build-target (TI_CC1352R1_LAUNCHXL, Debug, All, 915)
  • GitHub Check: build-target (NXP_MIMXRT1060_EVK, Debug, All)
  • GitHub Check: build-target (ESP32_H2_THREAD, Debug, ESP32)
  • GitHub Check: build-target (ESP32_C6_THREAD, Debug, ESP32)
  • GitHub Check: build-target (ESP32_C3, Debug, ESP32)
  • GitHub Check: build-target (ESP32_S3, Debug, ESP32)
  • GitHub Check: build-target (ESP32_S2_USB, Debug, ESP32)
  • GitHub Check: build-target (ESP_WROVER_KIT, Debug, ESP32)
  • GitHub Check: build-target (M5Core2, Debug, ESP32)
  • GitHub Check: build-target (ST_STM32F769I_DISCOVERY, Debug, All)
  • GitHub Check: build-target (SL_STK3701A, Debug, All)
🔇 Additional comments (14)
src/CLR/Debugger/Debugger.cpp (9)

23-23: Good modernization: Replacing NULL with nullptr

This is a good modernization of the codebase, replacing the C-style NULL with C++11's nullptr, which provides better type safety.


132-132: Consistent nullptr usage throughout the codebase

The consistent replacement of NULL with nullptr throughout the codebase improves type safety and readability. This is a good modern C++ practice.

Also applies to: 171-171, 216-216, 237-237


304-304: Improved member variable naming conventions

Renaming from m_flags to flags improves code consistency, though make sure this naming convention is consistent across the entire codebase.

Also applies to: 323-323


380-380: Type inference with auto keyword improves code readability

Using C++11's auto keyword for type inference improves code readability where the type is obvious from the right-hand side of the assignment. This is especially helpful for complicated typenames.

Also applies to: 431-431, 1001-1001, 1015-1015, 1031-1031, 1041-1041, 1065-1065, 1405-1405, 1548-1548, 1782-1782


2050-2061: Method signature update for consistency

Good update to the method signature, changing CLR_IDX idxAssm to CLR_INDEX indexAssm for better naming consistency. This makes the parameter name match its type and improves code clarity.


1899-1902: Added support for generic instances

Added handling for the DATATYPE_GENERICINST case to properly support generic types, aligning with the PR objective to add support for generics.


2439-2440: Modified return pattern for GetValue

The code has been modified to return the result of GetValue() directly instead of using WP_ReplyToCommand() with a nullptr. This simplifies the code path by letting GetValue handle the reply to command.

Also applies to: 2459-2460, 2872-2873, 2984-2985, 3035-3036, 3049-3050, 3073-3074, 3132-3133, 3164-3165, 3192-3193, 3409-3410


2796-2835: Added support for generic parameters in methods

Important addition to handle generic parameters in both generic type definitions (DATATYPE_VAR) and generic method definitions (DATATYPE_MVAR). This implementation correctly resolves the generic parameter positions and applies the appropriate data types.


2579-2587: Improved null safety in IsBlockEnumMaybe

Good enhancement to check for null class handler before accessing its members, preventing potential null pointer dereference. The additional check makes the function more robust.

azure-pipelines-templates/check-mdp-for-build.yml (5)

32-42: Build ID Extraction & Variable Setting
The conditional extraction of the build ID and setting it as a pipeline variable (using the ##vso[task.setvariable] command) is implemented correctly. It might improve robustness to add additional logging or alternate flows if the regex match fails.


43-45: Securing the GitHub Token
Defining the environment variable GITHUB_TOKEN correctly ensures token availability in the script. Just a reminder to safeguard this token so it is not inadvertently exposed in logs or outputs.


46-63: Artifact Download Task Configuration
The second task uses conditions effectively to determine when to download the MDP artifact. Parameters such as buildVersionToDownload, pipelineId, artifactName, and the specified itemPattern are well defined. Ensure that the MDP_BUILDID variable is correctly populated from the previous step, as this is critical for the artifact download to function as expected.


64-75: Setting MDP Path with Inline Script
The final task sets the NF_MDP_MSBUILDTASK_PATH variable using a succinct inline script. Verify that the path $(Pipeline.Workspace)/mdp/nanoFramework.Tools.MetadataProcessor.MsBuildTask.dll is correct in all intended pipeline contexts, and consider adding error checks if the file is not present after download.


1-3:

✅ Verification successful

Header & Newline Characters Issue
The header is complete with appropriate license information. However, YAMLlint reported an issue with the newline character on line 1 (expected LF \n). Please ensure the file uses consistent LF newlines throughout to avoid potential linting issues.


#!/bin/bash
# Check for CRLF characters in the file
file="azure-pipelines-templates/check-mdp-for-build.yml"
if grep -q $'\r' "$file"; then
    echo "CRLF newline characters detected in $file"
else
    echo "LF newline characters confirmed in $file"
fi

LF Newline Consistency Verified
The file azure-pipelines-templates/check-mdp-for-build.yml has been checked and confirmed to use consistent LF newline characters. This indicates that the YAMLlint warning regarding an expected LF newline on line 1 might be a misconfiguration or a false positive. Please review your YAMLlint settings if the warning persists.

  • Verified newline consistency using a grep-based check (output: "LF newline characters confirmed").
🧰 Tools
🪛 YAMLlint (1.35.1)

[error] 1-1: wrong new line character: expected \n

(new-lines)

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)
azure-pipelines-templates/check-mdp-for-build.yml (2)

1-3: Newline Formatting Issue

YAMLlint reported a newline character error. Please ensure that this file uses LF (\n) line endings rather than CRLF to comply with YAML standards.

🧰 Tools
🪛 YAMLlint (1.35.1)

[error] 1-1: wrong new line character: expected \n

(new-lines)


4-43: PowerShell Task for Checking MDP Build

The inline PowerShell script clearly retrieves PR details, constructs the authorization header, and extracts the MDP build ID from the commit message. However, to enhance robustness, consider adding error handling (e.g., try/catch blocks or checking the HTTP response status) to gracefully handle network issues or unexpected API responses.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 67932ad and edca5fe.

📒 Files selected for processing (1)
  • azure-pipelines-templates/check-mdp-for-build.yml (1 hunks)
🧰 Additional context used
🪛 YAMLlint (1.35.1)
azure-pipelines-templates/check-mdp-for-build.yml

[error] 1-1: wrong new line character: expected \n

(new-lines)

⏰ Context from checks skipped due to timeout of 90000ms (17)
  • GitHub Check: nf-interpreter (Check_Code_Style)
  • GitHub Check: nf-interpreter (Nightly build) (Build_STM32_targets ORGPAL_PALX)
  • GitHub Check: nf-interpreter (Nightly build) (Build_STM32_targets ORGPAL_PALTHREE)
  • GitHub Check: nf-interpreter (Nightly build) (Check_Build_Options)
  • GitHub Check: nf-interpreter (Check_Build_Options)
  • GitHub Check: build-target (TI_CC1352R1_LAUNCHXL, Debug, All, 915)
  • GitHub Check: build-target (NXP_MIMXRT1060_EVK, Debug, All)
  • GitHub Check: build-target (ESP32_H2_THREAD, Debug, ESP32)
  • GitHub Check: build-target (ESP32_C6_THREAD, Debug, ESP32)
  • GitHub Check: build-target (ESP32_C3, Debug, ESP32)
  • GitHub Check: build-target (ESP32_S3, Debug, ESP32)
  • GitHub Check: build-target (ESP32_S2_USB, Debug, ESP32)
  • GitHub Check: build-target (ESP_WROVER_KIT, Debug, ESP32)
  • GitHub Check: build-target (M5Core2, Debug, ESP32)
  • GitHub Check: build-target (ST_STM32F769I_DISCOVERY, Debug, All)
  • GitHub Check: build-target (SL_STK3701A, Debug, All)
  • GitHub Check: build-target (SL_STK3701A, Debug, AzureRTOS)
🔇 Additional comments (2)
azure-pipelines-templates/check-mdp-for-build.yml (2)

46-63: Download Pipeline Artifact Task Validation

The artifact download task is well-configured with a clear condition that checks for both DownloadMDP being true and MDP_BUILDID not being empty. Ensure that the upstream variable assignments are reliable so that this step triggers only under the intended circumstances.


64-75: Setting MDP Path Variable

The task setting the MDP path variable is implemented correctly using the Azure DevOps logging command. Verify that the use of a backslash (i.e., $(Pipeline.Workspace)\mdp) is intentional for the target environment. If not, consider using a forward slash for consistency on non‐Windows platforms.

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

🔭 Outside diff range comments (1)
azure-pipelines-templates/check-mdp-for-build.yml (1)

93-94: ⚠️ Potential issue

Fix Mismatched Parenthesis in Copy-Item Command
On line 93 the path string contains an extraneous closing parenthesis (${env:Pipeline_Workspace)}) which will cause the Copy-Item command to fail. Please remove the extra parenthesis so that the variable is correctly referenced.

Apply this diff:

-         Copy-Item -Path "${env:Pipeline_Workspace)}\mdp" -Destination $msbuildPath -Recurse
+         Copy-Item -Path "${env:Pipeline_Workspace}\mdp" -Destination $msbuildPath -Recurse
🧹 Nitpick comments (1)
azure-pipelines-templates/check-mdp-for-build.yml (1)

1-1: Correct Newline Formatting
The static analysis tool (YAMLlint) has flagged an issue on line 1 regarding the newline character. Please ensure that the file is using Unix-style (LF) newlines rather than Windows-style.

🧰 Tools
🪛 YAMLlint (1.35.1)

[error] 1-1: wrong new line character: expected \n

(new-lines)

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between edca5fe and 68620e2.

📒 Files selected for processing (3)
  • azure-pipelines-templates/check-mdp-for-build.yml (1 hunks)
  • azure-pipelines.yml (5 hunks)
  • src/CLR/Debugger/Debugger.cpp (122 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/CLR/Debugger/Debugger.cpp
🧰 Additional context used
🪛 YAMLlint (1.35.1)
azure-pipelines-templates/check-mdp-for-build.yml

[error] 1-1: wrong new line character: expected \n

(new-lines)

⏰ Context from checks skipped due to timeout of 90000ms (14)
  • GitHub Check: nf-interpreter (Nightly build) (Check_Build_Options)
  • GitHub Check: nf-interpreter (Check_Build_Options)
  • GitHub Check: build-target (TI_CC1352R1_LAUNCHXL, Debug, All, 915)
  • GitHub Check: build-target (NXP_MIMXRT1060_EVK, Debug, All)
  • GitHub Check: build-target (ESP32_H2_THREAD, Debug, ESP32)
  • GitHub Check: build-target (ESP32_C6_THREAD, Debug, ESP32)
  • GitHub Check: build-target (ESP32_C3, Debug, ESP32)
  • GitHub Check: build-target (ESP32_S3, Debug, ESP32)
  • GitHub Check: build-target (ESP32_S2_USB, Debug, ESP32)
  • GitHub Check: build-target (ESP_WROVER_KIT, Debug, ESP32)
  • GitHub Check: build-target (M5Core2, Debug, ESP32)
  • GitHub Check: build-target (ST_STM32F769I_DISCOVERY, Debug, All)
  • GitHub Check: build-target (SL_STK3701A, Debug, All)
  • GitHub Check: build-target (SL_STK3701A, Debug, AzureRTOS)
🔇 Additional comments (3)
azure-pipelines.yml (3)

1268-1270: Ensure Complete Dependency Specification in Unit Test Job
In the Run_UnitTests_mscorlib job, a new dependency on Check_Build_Options has been added (line 1270) alongside the existing dependency on Build_nanoCLR_CLI. This is a good step to guarantee that the outputs from the build options are available. Please verify that the order and overall job dependencies continue to reflect the intended build flow.


1279-1281: Introduce MDP Download Flag via Dependency Output
The new variable DownloadMDP is assigned on line 1280 from the output of the Check_Build_Options job (BuildOptions.USE_SPECIFIC_MDP). This addition will help conditionally trigger downstream logic for downloading the metadata processor artifact. Please ensure that the output variable name is correctly set in Check_Build_Options and that downstream templates or tasks correctly consume this flag.


1307-1308: Integrate MDP Build Check Template
A new template inclusion for check-mdp-for-build.yml has been added on line 1307 in the Run_UnitTests_mscorlib job. This change aims to verify if a specific MDP build is to be used. Please confirm that all required variables (such as MDP_BUILDID and DownloadMDP) are set appropriately and that the template’s logic integrates seamlessly with the rest of the job.

- Required because VS tries to load MDP from the directory and then all the other DLLs are missing.
- Should be reviewed upstream in order to pack all the directory.
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 (4)
azure-pipelines-templates/check-mdp-for-build.yml (3)

1-3: File Header and Line Endings
The header and copyright/licensing block appear standard. Note that YAMLlint reported a new line character issue—please ensure the file uses LF (\n) rather than CRLF.

🧰 Tools
🪛 YAMLlint (1.35.1)

[error] 1-1: wrong new line character: expected \n

(new-lines)


4-42: PowerShell Task: Check MDP for Build – PR Details & Build ID Extraction
This task defines an inline PowerShell script that:

  • Computes an authorization header using a Base64-encoded token.
  • Retrieves PR details from the GitHub API.
  • Checks that the retrieved PR number matches the current pull request.
  • Extracts the PR commit message and looks for a build ID pattern ([build with MDP buildId NNN]).

The logic correctly sets the MDP_BUILDID variable when a match is found.
Consider adding error handling for the web requests (e.g. in case the GitHub API call fails) to avoid unexpected pipeline errors.


64-92: PowerShell Task: Copy MDP to Build Tool
This inline PowerShell script locates the Visual Studio installation via vswhere and then copies the MDP DLL to the MSBuild location.

  • The script correctly builds paths using the output of vswhere.
  • One suggestion is to add error handling around the vswhere command (in case the executable is missing or returns an unexpected result).
azure-pipelines.yml (1)

95-138: Enhanced PR Build Handling & Metadata Detection in Check_Build_Options
Within the Check_Build_Options job, the newly added PowerShell block (lines 95–138) enhances the handling for PR builds by:

  • Recomputing the authorization header.
  • Retrieving commit details to skip builds for version update commits.
  • Fetching the PR details and commit message.
  • Setting variables based on the commit message:
    • It enables running mscorlib tests when the commit message contains either [run mscorlib tests] or a reference to nanoframework/CoreLibrary#....
    • It sets a flag to use a specific MDP build when the PR commit message matches \[build with MDP buildId (\d+)\].

Nitpick:
The message on line 129 currently reads:

-Write-Host "##[command] >> mscorlib tests are to be runned"
+Write-Host "##[command] >> mscorlib tests are to be run"

Please update the phrasing to correct the grammatical error.

Overall, this new logic meets the PR objectives for improved metadata handling and dynamic build configuration.

🧰 Tools
🪛 YAMLlint (1.35.1)

[error] 104-104: trailing spaces

(trailing-spaces)


[error] 108-108: 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 68620e2 and 828d8e3.

📒 Files selected for processing (2)
  • azure-pipelines-templates/check-mdp-for-build.yml (1 hunks)
  • azure-pipelines.yml (5 hunks)
🧰 Additional context used
🪛 YAMLlint (1.35.1)
azure-pipelines-templates/check-mdp-for-build.yml

[error] 1-1: wrong new line character: expected \n

(new-lines)

⏰ Context from checks skipped due to timeout of 90000ms (29)
  • GitHub Check: nf-interpreter (Build_WIN32_nanoCLR)
  • GitHub Check: nf-interpreter (Build_Azure_RTOS_targets SL_STK3701A)
  • GitHub Check: nf-interpreter (Build_ESP32_targets ESP32_ETHERNET_KIT_1.2)
  • GitHub Check: nf-interpreter (Build_ESP32_targets ESP32_S3_ALL)
  • GitHub Check: nf-interpreter (Build_ESP32_targets ESP32_H2_THREAD)
  • GitHub Check: nf-interpreter (Build_ESP32_targets ESP32_C6_THREAD)
  • GitHub Check: nf-interpreter (Build_ESP32_targets ESP32_C3)
  • GitHub Check: nf-interpreter (Build_ESP32_targets ESP32_BLE_REV0)
  • GitHub Check: nf-interpreter (Build_STM32_targets ST_STM32F769I_DISCOVERY)
  • GitHub Check: nf-interpreter (Build_ESP32_targets ESP32_PSRAM_REV0)
  • GitHub Check: nf-interpreter (Build_TI_SimpleLink_targets TI_CC1352R1_LAUNCHXL_915)
  • GitHub Check: nf-interpreter (Build_STM32_targets ST_STM32F429I_DISCOVERY)
  • GitHub Check: nf-interpreter (Build_NXP_targets NXP_MIMXRT1060_EVK)
  • GitHub Check: nf-interpreter (Check_Code_Style)
  • GitHub Check: nf-interpreter (Nightly build) (Build_STM32_targets ORGPAL_PALX)
  • GitHub Check: nf-interpreter (Nightly build) (Build_STM32_targets ORGPAL_PALTHREE)
  • GitHub Check: nf-interpreter (Nightly build) (Check_Build_Options)
  • GitHub Check: nf-interpreter (Check_Build_Options)
  • GitHub Check: build-target (TI_CC1352R1_LAUNCHXL, Debug, All, 915)
  • GitHub Check: build-target (NXP_MIMXRT1060_EVK, Debug, All)
  • GitHub Check: build-target (ESP32_H2_THREAD, Debug, ESP32)
  • GitHub Check: build-target (ESP32_C6_THREAD, Debug, ESP32)
  • GitHub Check: build-target (ESP32_C3, Debug, ESP32)
  • GitHub Check: build-target (ESP32_S3, Debug, ESP32)
  • GitHub Check: build-target (ESP32_S2_USB, Debug, ESP32)
  • GitHub Check: build-target (ESP_WROVER_KIT, Debug, ESP32)
  • GitHub Check: build-target (M5Core2, Debug, ESP32)
  • GitHub Check: build-target (ST_STM32F769I_DISCOVERY, Debug, All)
  • GitHub Check: build-target (SL_STK3701A, Debug, All)
🔇 Additional comments (3)
azure-pipelines-templates/check-mdp-for-build.yml (2)

43-45: Environment Variable Configuration
The environment block sets GITHUB_TOKEN appropriately from the pipeline variable. This is straightforward and appears correct.


46-63: DownloadPipelineArtifact Task Configuration
The DownloadPipelineArtifact task is well configured. It downloads the MDP artifact only when the DownloadMDP variable is true and MDP_BUILDID is set. All required inputs (e.g. project, definition, artifact name, and item pattern) are clearly specified.

azure-pipelines.yml (1)

1270-1281: Mapping USE_SPECIFIC_MDP to DownloadMDP in Run_UnitTests_mscorlib Job
A new variable assignment in the Run_UnitTests_mscorlib job maps the output from Check_Build_Options to the variable DownloadMDP:

DownloadMDP: $[ dependencies.Check_Build_Options.outputs['BuildOptions.USE_SPECIFIC_MDP'] ]

This enables subsequent steps to conditionally download the MDP artifact based on the PR commit message. Verify that downstream tasks correctly consume this variable.

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 (7)
azure-pipelines-templates/check-mdp-for-build.yml (3)

1-3: File Formatting & Newline Consistency
The file’s header lines indicate it’s a new YAML pipeline file. Please ensure that the file uses LF (\n) as the newline character (per YAMLlint’s expectations), so that the “wrong new line character” error is resolved.

🧰 Tools
🪛 YAMLlint (1.35.1)

[error] 1-1: wrong new line character: expected \n

(new-lines)


19-24: PR Retrieval Logic
The use of Invoke-WebRequest to fetch the pull request details and convert the response from JSON is clear and straightforward. Consider wrapping this call in error handling (e.g. try/catch) to gracefully handle possible API failures or network issues in the pipeline.


64-93: Copy MDP Files Step
The PowerShell task to copy the MDP files from the artifact location to the MSBuild directory is well-structured. One suggestion would be to add error handling (or at least a conditional check) to verify that vswhere.exe is available and that the Visual Studio installation paths are successfully retrieved before attempting the file copy.

azure-pipelines.yml (4)

75-147: Enhanced PR Build Options Logic
Within the Check_Build_Options job, the added segments (e.g., printing "This is a PR build" at line 93, conditionally skipping builds for version update commits, and the blocks that set RUN_MSCORLIB_TESTS and USE_SPECIFIC_MDP based on patterns in the PR commit message) are logically sound and improve clarity in triggering build behaviors. Ensure that these conditions cover all edge cases (such as multiple matching patterns) and consider adding error handling for REST API calls as needed.

🧰 Tools
🪛 YAMLlint (1.35.1)

[error] 85-85: trailing spaces

(trailing-spaces)


[error] 104-104: trailing spaces

(trailing-spaces)


[error] 108-108: trailing spaces

(trailing-spaces)


104-104: Trailing Whitespace Cleanup (Line 104)
YAMLlint has flagged trailing spaces on this line. Removing extraneous spaces will help avoid formatting issues.

-      # Some comment with trailing spaces···
+      # Some comment with trailing spaces
🧰 Tools
🪛 YAMLlint (1.35.1)

[error] 104-104: trailing spaces

(trailing-spaces)


108-108: Trailing Whitespace Cleanup (Line 108)
Similarly, trailing spaces on this line should be removed to conform with YAML formatting best practices.

-      # Another line with trailing spaces···
+      # Another line with trailing spaces
🧰 Tools
🪛 YAMLlint (1.35.1)

[error] 108-108: trailing spaces

(trailing-spaces)


1268-1281: MDP Integration for Unit Tests
In the Run_UnitTests_mscorlib job, the new variable assignment:

DownloadMDP: $[ dependencies.Check_Build_Options.outputs['BuildOptions.USE_SPECIFIC_MDP'] ]

ensures that the subsequent steps can conditionally use the MDP artifacts. Please verify that all downstream tasks correctly handle this flag and that its value is as expected when the PR commit message includes the appropriate trigger.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 828d8e3 and 29f16f6.

📒 Files selected for processing (2)
  • azure-pipelines-templates/check-mdp-for-build.yml (1 hunks)
  • azure-pipelines.yml (4 hunks)
🧰 Additional context used
🪛 YAMLlint (1.35.1)
azure-pipelines.yml

[error] 104-104: trailing spaces

(trailing-spaces)


[error] 108-108: trailing spaces

(trailing-spaces)

azure-pipelines-templates/check-mdp-for-build.yml

[error] 1-1: wrong new line character: expected \n

(new-lines)

⏰ Context from checks skipped due to timeout of 90000ms (29)
  • GitHub Check: nf-interpreter (Build_Azure_RTOS_targets SL_STK3701A)
  • GitHub Check: nf-interpreter (Build_WIN32_nanoCLR)
  • GitHub Check: nf-interpreter (Build_ESP32_targets ESP32_ETHERNET_KIT_1.2)
  • GitHub Check: nf-interpreter (Build_ESP32_targets ESP32_S3_ALL)
  • GitHub Check: nf-interpreter (Build_ESP32_targets ESP32_H2_THREAD)
  • GitHub Check: nf-interpreter (Build_ESP32_targets ESP32_C6_THREAD)
  • GitHub Check: nf-interpreter (Build_ESP32_targets ESP32_C3)
  • GitHub Check: nf-interpreter (Build_ESP32_targets ESP32_BLE_REV0)
  • GitHub Check: nf-interpreter (Build_STM32_targets ST_STM32F769I_DISCOVERY)
  • GitHub Check: nf-interpreter (Build_ESP32_targets ESP32_PSRAM_REV0)
  • GitHub Check: nf-interpreter (Build_NXP_targets NXP_MIMXRT1060_EVK)
  • GitHub Check: nf-interpreter (Build_TI_SimpleLink_targets TI_CC1352R1_LAUNCHXL_915)
  • GitHub Check: nf-interpreter (Build_STM32_targets ST_STM32F429I_DISCOVERY)
  • GitHub Check: nf-interpreter (Nightly build) (Build_STM32_targets ORGPAL_PALX)
  • GitHub Check: nf-interpreter (Nightly build) (Build_STM32_targets ORGPAL_PALTHREE)
  • GitHub Check: nf-interpreter (Check_Code_Style)
  • GitHub Check: nf-interpreter (Nightly build) (Check_Build_Options)
  • GitHub Check: nf-interpreter (Check_Build_Options)
  • GitHub Check: build-target (TI_CC1352R1_LAUNCHXL, Debug, All, 915)
  • GitHub Check: build-target (NXP_MIMXRT1060_EVK, Debug, All)
  • GitHub Check: build-target (ESP32_H2_THREAD, Debug, ESP32)
  • GitHub Check: build-target (ESP32_C6_THREAD, Debug, ESP32)
  • GitHub Check: build-target (ESP32_C3, Debug, ESP32)
  • GitHub Check: build-target (ESP32_S3, Debug, ESP32)
  • GitHub Check: build-target (ESP32_S2_USB, Debug, ESP32)
  • GitHub Check: build-target (ESP_WROVER_KIT, Debug, ESP32)
  • GitHub Check: build-target (M5Core2, Debug, ESP32)
  • GitHub Check: build-target (ST_STM32F769I_DISCOVERY, Debug, All)
  • GitHub Check: build-target (SL_STK3701A, Debug, All)
🔇 Additional comments (5)
azure-pipelines-templates/check-mdp-for-build.yml (3)

15-15: Authentication Header Calculation
The Base64 encoding of the GitHub token for constructing the authorization header (line 15) is implemented correctly.


27-38: Build ID Extraction from Commit Message
The logic that matches the commit message for the pattern \[build with MDP buildId (\d+)\] and sets the MDP_BUILDID variable is correct and clear.


46-63: Artifact Download Configuration
The task parameters for downloading the MDP artifact (using DownloadPipelineArtifact@2) are well set up, with clear conditions ensuring that the artifact is downloaded only when required.

azure-pipelines.yml (2)

1307-1307: MDP Check Template Inclusion
The inclusion of the new check-mdp-for-build.yml template (line 1307) in the unit testing job is a nice modularization of the MDP-related functionality. Confirm that this template executes correctly in every scenario expected by the pipeline.


1-31: General Pipeline Configuration & Trigger Settings
The trigger and resource definitions (lines 1–31) adhere to the established CI/CD standards. There are no concerns here; the configurations are consistent and clear.

🧰 Tools
🪛 YAMLlint (1.35.1)

[error] 1-1: wrong new line character: expected \n

(new-lines)

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)
azure-pipelines-templates/check-mdp-for-build.yml (1)

4-43: Verify PR Details Extraction and MDP Build ID Detection
The inline PowerShell script correctly obtains PR details from GitHub and uses a regular expression to extract the MDP build ID from the commit message. Consider adding error handling (e.g. try/catch) around the network call (Invoke-WebRequest) to gracefully handle scenarios when the API call fails.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 29f16f6 and 8655078.

📒 Files selected for processing (2)
  • azure-pipelines-templates/check-mdp-for-build.yml (1 hunks)
  • azure-pipelines.yml (4 hunks)
🧰 Additional context used
🪛 YAMLlint (1.35.1)
azure-pipelines-templates/check-mdp-for-build.yml

[error] 1-1: wrong new line character: expected \n

(new-lines)

🔇 Additional comments (5)
azure-pipelines-templates/check-mdp-for-build.yml (2)

1-3: Ensure Correct Newline Characters
Static analysis detected that the newline characters do not match the expected LF (\n) style. Please convert the file’s line endings to LF for consistency with YAMLlint rules.

🧰 Tools
🪛 YAMLlint (1.35.1)

[error] 1-1: wrong new line character: expected \n

(new-lines)


43-45: Environment Variable Usage
The env block properly sets the GITHUB_TOKEN variable from the pipeline variable. Ensure that the token is securely managed and that logging does not inadvertently expose its value.

azure-pipelines.yml (3)

133-138: Detect and Enable Specific MDP Builds
The new logic in the Check_Build_Options job uses a regular expression to detect the pattern "[build with MDP buildId (\d+)]" in the PR commit message and sets the USE_SPECIFIC_MDP variable accordingly. This implementation aligns with the PR objectives. Consider adding error/logging steps in the event that the PR body structure changes or the expected match isn’t found.


1279-1281: Propagate MDP Build Configuration
Within the Run_UnitTests_mscorlib job, the new variable DownloadMDP is derived from the output of the Check_Build_Options job (BuildOptions.USE_SPECIFIC_MDP). Please verify that this dependency output produces the intended boolean (or string) value so that downstream tasks correctly decide on downloading the specific MDP artifacts.


1-32: Overall Pipeline Configuration Quality
The YAML file is well structured with clearly defined triggers, resource definitions, and job dependencies. The integration of the new MDP-related steps (including artifact download and file copy steps) is consistent with the broader PR objectives. No major issues are noted in this section.

🧰 Tools
🪛 YAMLlint (1.35.1)

[error] 1-1: wrong new line character: expected \n

(new-lines)

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

🧹 Nitpick comments (5)
azure-pipelines-templates/check-mdp-for-build.yml (5)

1-3: Newline Format Consistency
The file appears to be using a newline character different from the expected LF (\n), as indicated by the static analysis hint. Please ensure the file uses LF for consistency with the project standards.

🧰 Tools
🪛 YAMLlint (1.35.1)

[error] 1-1: wrong new line character: expected \n

(new-lines)


15-15: Authorization Header Construction
The inline PowerShell computes the authorization header correctly using Base64 encoding. Consider adding a check or error handling in case the $(GitHubToken) value is missing or empty.


21-25: Type Comparison in PR Verification
The condition checking if $pr.number equals "$env:System_PullRequest_PullRequestNumber" may mix numeric and string types. Consider explicitly casting one side (or both) to avoid unintended behavior.


46-63: Hard-Coded Artifact Definition
The DownloadPipelineArtifact task is configured correctly. However, the artifact definition is hard-coded as '43'. For maintainability, consider parameterizing this value using a variable if it might change in the future.


64-94: MDP Copy Task Configuration
The final task correctly assembles the destination path and copies the MDP files. Verify that the environment variable Pipeline_Workspace is correctly set in the agent context. Also, consider adding error handling in case the Copy-Item command fails.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between a89b9f4 and 119886b.

📒 Files selected for processing (1)
  • azure-pipelines-templates/check-mdp-for-build.yml (1 hunks)
🧰 Additional context used
🪛 YAMLlint (1.35.1)
azure-pipelines-templates/check-mdp-for-build.yml

[error] 1-1: wrong new line character: expected \n

(new-lines)

⏰ Context from checks skipped due to timeout of 90000ms (29)
  • GitHub Check: nf-interpreter (Build_ESP32_targets ESP32_ETHERNET_KIT_1.2)
  • GitHub Check: nf-interpreter (Build_ESP32_targets ESP32_S3_ALL)
  • GitHub Check: nf-interpreter (Build_ESP32_targets ESP32_H2_THREAD)
  • GitHub Check: nf-interpreter (Build_ESP32_targets ESP32_C6_THREAD)
  • GitHub Check: nf-interpreter (Build_ESP32_targets ESP32_C3)
  • GitHub Check: nf-interpreter (Build_ESP32_targets ESP32_BLE_REV0)
  • GitHub Check: nf-interpreter (Build_NXP_targets NXP_MIMXRT1060_EVK)
  • GitHub Check: nf-interpreter (Build_WIN32_nanoCLR)
  • GitHub Check: nf-interpreter (Build_Azure_RTOS_targets SL_STK3701A)
  • GitHub Check: nf-interpreter (Build_ESP32_targets ESP32_PSRAM_REV0)
  • GitHub Check: nf-interpreter (Build_STM32_targets ST_STM32F769I_DISCOVERY)
  • GitHub Check: nf-interpreter (Build_TI_SimpleLink_targets TI_CC1352R1_LAUNCHXL_915)
  • GitHub Check: nf-interpreter (Build_STM32_targets ST_STM32F429I_DISCOVERY)
  • GitHub Check: nf-interpreter (Check_Code_Style)
  • GitHub Check: nf-interpreter (Nightly build) (Build_STM32_targets ORGPAL_PALX)
  • GitHub Check: nf-interpreter (Nightly build) (Build_STM32_targets ORGPAL_PALTHREE)
  • GitHub Check: nf-interpreter (Nightly build) (Check_Build_Options)
  • GitHub Check: nf-interpreter (Check_Build_Options)
  • GitHub Check: build-target (TI_CC1352R1_LAUNCHXL, Debug, All, 915)
  • GitHub Check: build-target (NXP_MIMXRT1060_EVK, Debug, All)
  • GitHub Check: build-target (ESP32_H2_THREAD, Debug, ESP32)
  • GitHub Check: build-target (ESP32_C6_THREAD, Debug, ESP32)
  • GitHub Check: build-target (ESP32_C3, Debug, ESP32)
  • GitHub Check: build-target (ESP32_S3, Debug, ESP32)
  • GitHub Check: build-target (ESP32_S2_USB, Debug, ESP32)
  • GitHub Check: build-target (ESP_WROVER_KIT, Debug, ESP32)
  • GitHub Check: build-target (M5Core2, Debug, ESP32)
  • GitHub Check: build-target (ST_STM32F769I_DISCOVERY, Debug, All)
  • GitHub Check: build-target (SL_STK3701A, Debug, All)
🔇 Additional comments (2)
azure-pipelines-templates/check-mdp-for-build.yml (2)

18-20: PR Retrieval Using Environment Variables
The script retrieves PR details via the GitHub API using environment variables (Build_Repository_Name and System_PullRequest_PullRequestNumber). Ensure these variables are always set in the build context to avoid runtime errors.


32-38: Extraction of Build ID
The regex pattern to extract the build ID from the PR commit message is clear and concise. Ensure that multiple occurrences are not expected, or if they are, document the behavior—this implementation picks only the first match.

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

🧹 Nitpick comments (2)
azure-pipelines-templates/check-mdp-for-build.yml (2)

11-43: Review the MDP Build Check Script.
The inline PowerShell script for checking the build is well organized and follows the intended flow. However, consider adding error handling around the Invoke-WebRequest call (line 19) to gracefully handle potential HTTP failures or API issues, ensuring that the script logs useful errors or takes corrective action when the GitHub API call fails.


64-93: Copy MDP to Build Tool – Variable Naming Consistency.
Within this inline script, the Visual Studio installer path is stored in the variable $VsWherePath at line 76, but at line 85 the code references $VSWherePath. Although PowerShell variable names are case-insensitive, using a consistent naming style (e.g., always $VsWherePath) will improve readability and reduce the risk of future mistakes. Additionally, consider verifying that the destination folder exists (or create it if necessary) before executing the Copy-Item command to avoid potential runtime errors.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 119886b and b18de9d.

📒 Files selected for processing (1)
  • azure-pipelines-templates/check-mdp-for-build.yml (1 hunks)
🧰 Additional context used
🪛 YAMLlint (1.35.1)
azure-pipelines-templates/check-mdp-for-build.yml

[error] 1-1: wrong new line character: expected \n

(new-lines)

⏰ Context from checks skipped due to timeout of 90000ms (31)
  • GitHub Check: nf-interpreter (Build_WIN32_nanoCLR)
  • GitHub Check: nf-interpreter (Build_Azure_RTOS_targets SL_STK3701A)
  • GitHub Check: nf-interpreter (Build_ESP32_targets ESP32_ETHERNET_KIT_1.2)
  • GitHub Check: nf-interpreter (Build_ESP32_targets ESP32_S3_ALL)
  • GitHub Check: nf-interpreter (Build_ESP32_targets ESP32_H2_THREAD)
  • GitHub Check: nf-interpreter (Build_ESP32_targets ESP32_C6_THREAD)
  • GitHub Check: nf-interpreter (Build_ESP32_targets ESP32_C3)
  • GitHub Check: nf-interpreter (Build_STM32_targets ST_STM32F769I_DISCOVERY)
  • GitHub Check: nf-interpreter (Build_ESP32_targets ESP32_BLE_REV0)
  • GitHub Check: nf-interpreter (Build_TI_SimpleLink_targets TI_CC1352R1_LAUNCHXL_915)
  • GitHub Check: nf-interpreter (Build_NXP_targets NXP_MIMXRT1060_EVK)
  • GitHub Check: nf-interpreter (Build_STM32_targets ST_STM32F429I_DISCOVERY)
  • GitHub Check: nf-interpreter (Build_ESP32_targets ESP32_PSRAM_REV0)
  • GitHub Check: nf-interpreter (Check_Code_Style)
  • GitHub Check: nf-interpreter (Nightly build) (Build_STM32_targets ORGPAL_PALX)
  • GitHub Check: nf-interpreter (Nightly build) (Build_STM32_targets ORGPAL_PALTHREE)
  • GitHub Check: nf-interpreter (Nightly build) (Check_Build_Options)
  • GitHub Check: nf-interpreter (Check_Build_Options)
  • GitHub Check: build-target (TI_CC1352R1_LAUNCHXL, Debug, All, 915)
  • GitHub Check: build-target (TI_CC1352R1_LAUNCHXL, Debug, TI, 915)
  • GitHub Check: build-target (NXP_MIMXRT1060_EVK, Debug, All)
  • GitHub Check: build-target (NXP_MIMXRT1060_EVK, Debug, FreeRTOS-NXP)
  • GitHub Check: build-target (ESP32_H2_THREAD, Debug, ESP32)
  • GitHub Check: build-target (ESP32_C6_THREAD, Debug, ESP32)
  • GitHub Check: build-target (ESP32_C3, Debug, ESP32)
  • GitHub Check: build-target (ESP32_S3, Debug, ESP32)
  • GitHub Check: build-target (ESP32_S2_USB, Debug, ESP32)
  • GitHub Check: build-target (ESP_WROVER_KIT, Debug, ESP32)
  • GitHub Check: build-target (M5Core2, Debug, ESP32)
  • GitHub Check: build-target (ST_STM32F769I_DISCOVERY, Debug, All)
  • GitHub Check: build-target (SL_STK3701A, Debug, All)
🔇 Additional comments (1)
azure-pipelines-templates/check-mdp-for-build.yml (1)

46-63: Artifact Download Step Verification.
The DownloadPipelineArtifact task is clearly defined with appropriate conditionals and parameters. Please verify that the artifact details (project, definition, artifact name, etc.) correctly correspond to the new MDP output and that any changes in the Metadata Definition Protocol are fully reflected here.

@josesimoes josesimoes changed the base branch from main to develop April 17, 2025 14:16
@josesimoes
Copy link
Member Author

Ignoring failures in Dev Containers smoke tests.

@josesimoes josesimoes merged commit dac0e07 into develop Apr 17, 2025
30 of 39 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Common libs Everything related with common libraries Area: Config-and-Build Area: Dev-Containers Breaking-change Platform: ESP32 Everything related specifically with ESP32 platform Platform: NXP Everything related specifically with FreeRTOS Platform: STM32 Everything related specifically with ChibiOS platform Platform: TI-SimpleLink Platform: Virtual Device & WIN32 Everything related specifically with WIN32 and .NET tool builds Status: in progress Type: dependencies Pull requests that update a dependency file(s) or version Type: enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for generics <T>
5 participants