Skip to content

Conversation

josesimoes
Copy link
Member

@josesimoes josesimoes commented Sep 9, 2025

Description

  • Add Span<T> and ReadOnlySpan<T> classes.
  • Add Empty<T> to Array class.
  • Add StackTraceHiddenAttribute.
  • Add InAttribute.
  • Add ArrayTypeMismatchException.
  • Add nullable and compararers.
  • Update order of Array methods.
  • Migrate Span tests to generic version.
  • Implementation of IsGenericTypeDefinition is not virtual anymore.
  • Add generic array to Type tests.
  • Add Nullable unit tests.

Motivation and Context

How Has This Been Tested?

  • Running Unit tests in updated nanoCLR.

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 release version to 2.0.0-preview.{height}.
    • Restricted releases to builds from the main and develop branches.
    • Added “generics” branch to allowed public release branches.
    • Removed tag-triggered pipelines.
    • Enabled preview build features in the build process.
    • Suppressed .NET CLI logo output during builds for cleaner logs.

Copy link

coderabbitai bot commented Sep 9, 2025

Walkthrough

The pipeline configuration removes tag triggers, adds DOTNET_NOLOGO variables, enables preview build in a build template, passes baseBranchName: develop to a publish template, and updates GitHub release conditions to only allow releases on main or develop when StartReleaseCandidate is false. version.json updates version to 2.0.0-preview.{height} and adds a new release branch.

Changes

Cohort / File(s) Summary of Changes
Pipeline config
azure-pipelines.yml
Removed tag-trigger block; added global and job-level DOTNET_NOLOGO=true; enabled usePreviewBuild: true for class-lib-build-only template; passed baseBranchName: 'develop' to class-lib-publish template; updated GithubRelease@1 condition to branchName in {main, develop} and StartReleaseCandidate == false.
Versioning config
version.json
Updated version to "2.0.0-preview.{height}"; added "^refs/heads/generics$" to publicReleaseRefSpec.

Sequence Diagram(s)

sequenceDiagram
    participant Dev as Developer
    participant Az as Azure Pipelines
    participant B as Build_mscorlib Job
    participant T1 as Template: class-lib-build-only
    participant T2 as Template: class-lib-publish
    participant GH as GitHub Release

    Dev->>Az: Push/PR on branches (no tag triggers)
    Az->>B: Queue pipeline (DOTNET_NOLOGO=true)
    B->>T1: Invoke build (usePreviewBuild: true)
    T1-->>B: Build artifacts
    B->>T2: Invoke publish (baseBranchName: 'develop')
    alt StartReleaseCandidate == false AND branchName in {main, develop}
        Az->>GH: GithubRelease@1 create/update release
    else other branches or StartReleaseCandidate == true
        Az--xGH: Skip release
    end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Tip

👮 Agentic pre-merge checks are now available in preview!

Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.

  • Built-in checks – Quickly apply ready-made checks to enforce title conventions, require pull request descriptions that follow templates, validate linked issues for compliance, and more.
  • Custom agentic checks – Define your own rules using CodeRabbit’s advanced agentic capabilities to enforce organization-specific policies and workflows. For example, you can instruct CodeRabbit’s agent to verify that API documentation is updated whenever API schema files are modified in a PR. Note: Upto 5 custom checks are currently allowed during the preview period. Pricing for this feature will be announced in a few weeks.

Example:

reviews:
  pre_merge_checks:
    custom_checks:
      - name: "Undocumented Breaking Changes"
        mode: "warning"
        instructions: |
          Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).

Please share your feedback with us on this Discord post.

Pre-merge checks (3 passed)

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed The description lists several additions and modifications that align with the changeset, including Span, ReadOnlySpan, and accompanying tests and attributes, making it clearly related to the PR content.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
Title Check ✅ Passed The title "Add Span<T> and ReadOnlySpan<T>" directly and concisely names the primary change described in the PR objectives (adding generic span types), making it clear to reviewers what the main intent is. It is a single short sentence, specific to the changeset, and avoids extraneous information. Therefore it accurately summarizes the main change for team members scanning the history.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch add-span-2

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

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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)
version.json (2)

3-3: Avoid hard-coding "-preview" in the version; let NBGV manage prerelease.

Hard-coding "2.0.0-preview.{height}" can conflict with the release pipeline (e.g., GitHubRelease isPreRelease=false), producing a "stable" release whose tag still includes "-preview". Prefer a clean "2.0.0" and rely on firstUnstableTag: "preview" + publicReleaseRefSpec to add/remove the suffix automatically.

Suggested change:

-  "version": "2.0.0-preview.{height}",
+  "version": "2.0.0",

If keeping previews-only is intentional, flip the GitHubRelease isPreRelease flag accordingly (see pipeline comment).


14-15: Reconsider adding 'generics' as a public release branch.

Including "^refs/heads/generics$" in publicReleaseRefSpec will mark builds on that branch as PublicRelease. This can yield stable SemVer (no prerelease tag) once version is not hard-coded to preview, and may contradict the pipeline’s release gating (main/develop only).

Options:

  • Remove 'generics' from publicReleaseRefSpec if it’s a feature branch.
  • Or, extend the pipeline’s release condition to also allow 'generics' to keep behavior aligned.
azure-pipelines.yml (2)

59-60: Trailing whitespace and duplicate variable.

Line 60 has trailing spaces (yamllint error); also DOTNET_NOLOGO is already set globally at Line 36–37. Drop the duplicate here or keep only one definition.

Minimal fix:

-    - name: DOTNET_NOLOGO
-      value: true  
+    # DOTNET_NOLOGO is defined globally; remove local duplicate

If you prefer to keep it local, at least remove the trailing spaces:

-      value: true  
+      value: true

126-136: Align release comment and prerelease flag with actual behavior.

  • The comment says “ON tags” but the condition now gates by branch (main/develop). Update the comment for accuracy.
  • isPreRelease is hard-coded to false while version.json currently emits "-preview". This creates a stable GH release with a preview version tag. Drive isPreRelease from NBGV or branch.

Suggested tweaks:

-  # create or update GitHub release ON tags
+  # create or update GitHub release on main/develop branches

-      isPreRelease: false
+      # mark prerelease when not a public release (from NBGV)
+      isPreRelease: $[ne(variables['NBGV_IsPublicRelease'], 'true')]

If you keep 'generics' as PublicRelease in version.json, consider extending the branch gate:

-          eq(variables['Build.SourceBranchName'], 'develop')
+          eq(variables['Build.SourceBranchName'], 'develop'),
+          eq(variables['Build.SourceBranchName'], 'generics')
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d47412e and f85443f.

⛔ Files ignored due to path filters (27)
  • .runsettings is excluded by none and included by none
  • Tests/NFUnitTestGC/TestGC.cs is excluded by none and included by none
  • Tests/NFUnitTestSystemLib/NFUnitTestSystemLib.nfproj is excluded by none and included by none
  • Tests/NFUnitTestSystemLib/UnitTestGCTest.cs is excluded by none and included by none
  • Tests/NFUnitTestSystemLib/UnitTestInitLocalTests.cs is excluded by none and included by none
  • Tests/NFUnitTestSystemLib/UnitTestNullable.cs is excluded by none and included by none
  • Tests/NFUnitTestSystemLib/UnitTestReflectionTypeTest.cs is excluded by none and included by none
  • Tests/NFUnitTestTypes/UnitTestsSpanByte.cs is excluded by none and included by none
  • Tests/UnitTestLauncher/UnitTestLauncher.nfproj is excluded by none and included by none
  • nanoFramework.CoreLibrary.nuspec is excluded by none and included by none
  • nanoFramework.CoreLibrary/CoreLibrary.nfproj is excluded by none and included by none
  • nanoFramework.CoreLibrary/System/Array.cs is excluded by none and included by none
  • nanoFramework.CoreLibrary/System/ArrayTypeMismatchException.cs is excluded by none and included by none
  • nanoFramework.CoreLibrary/System/AssemblyInfo.cs is excluded by none and included by none
  • nanoFramework.CoreLibrary/System/Collections/Generic/Comparer.cs is excluded by none and included by none
  • nanoFramework.CoreLibrary/System/Collections/Generic/ComparerHelpers.cs is excluded by none and included by none
  • nanoFramework.CoreLibrary/System/Collections/Generic/IComparer.cs is excluded by none and included by none
  • nanoFramework.CoreLibrary/System/Diagnostics/StackTraceHiddenAttribute.cs is excluded by none and included by none
  • nanoFramework.CoreLibrary/System/GC.cs is excluded by none and included by none
  • nanoFramework.CoreLibrary/System/Guid.cs is excluded by none and included by none
  • nanoFramework.CoreLibrary/System/Nullable.cs is excluded by none and included by none
  • nanoFramework.CoreLibrary/System/ReadOnlySpan.cs is excluded by none and included by none
  • nanoFramework.CoreLibrary/System/Runtime/InteropServices/InAttribute .cs is excluded by none and included by none
  • nanoFramework.CoreLibrary/System/Span.cs is excluded by none and included by none
  • nanoFramework.CoreLibrary/System/SpanDebugView.cs is excluded by none and included by none
  • nanoFramework.CoreLibrary/System/String.cs is excluded by none and included by none
  • nanoFramework.CoreLibrary/System/Type.cs is excluded by none and included by none
📒 Files selected for processing (2)
  • azure-pipelines.yml (3 hunks)
  • version.json (2 hunks)
🧰 Additional context used
🪛 YAMLlint (1.37.1)
azure-pipelines.yml

[error] 60-60: trailing spaces

(trailing-spaces)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: nanoframework.CoreLibrary (Build_mscorlib)
🔇 Additional comments (2)
azure-pipelines.yml (2)

79-79: Confirm usePreviewBuild is declared in your pipeline template
No occurrences found in any .yml templates (including azure-pipelines-templates/class-lib-build-only.yml, which wasn’t located); ensure the template path is correct and that it declares and uses the usePreviewBuild boolean input before relying on it.


122-125: Verify new baseBranchName parameter wiring in external publish template
This template is pulled via azure-pipelines-templates/class-lib-publish.yml@templates. Confirm that the remote class-lib-publish.yml in the templates repo declares a parameters.baseBranchName (string) and uses it for branch targeting, tagging, or release notes.

@josesimoes josesimoes changed the title Add Span<T> and ReadOnlySpan<T>` Add Span<T> and ReadOnlySpan<T> Sep 11, 2025
Copy link

@josesimoes josesimoes merged commit ed90c8e into develop Sep 11, 2025
9 checks passed
@josesimoes josesimoes deleted the add-span-2 branch September 11, 2025 12:01
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