Skip to content

fix: alter build to pull the next dev version - BED-7858#208

Merged
mykeelium merged 1 commit into2.Xfrom
mcuomo/BED-7858
Apr 3, 2026
Merged

fix: alter build to pull the next dev version - BED-7858#208
mykeelium merged 1 commit into2.Xfrom
mcuomo/BED-7858

Conversation

@mykeelium
Copy link
Copy Markdown
Contributor

@mykeelium mykeelium commented Apr 3, 2026

Description

This change finds the latest dev build based on a patch to the last stable.

Motivation and Context

This PR addresses: BED-7858

How Has This Been Tested?

Screenshots (if appropriate):

Types of changes

  • Chore (a change that does not modify the application functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

Summary by CodeRabbit

  • Chores
    • Updated build system to automatically calculate development package versions based on stable version information.

@mykeelium mykeelium self-assigned this Apr 3, 2026
@mykeelium mykeelium added the bug Something isn't working label Apr 3, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 3, 2026

Walkthrough

The Sharphound.csproj build configuration was updated to compute dev package versions by parsing the stable version into major/minor and patch components, incrementing the patch, and appending a -dev* suffix. The fallback logic for unset _CommonLibsVersion now references a computed CommonLibsDevVersion property instead of a raw concatenation.

Changes

Cohort / File(s) Summary
Build Version Logic
Sharphound.csproj
Updated MSBuild property definitions to compute CommonLibsDevVersion by parsing CommonLibsStableVersion into major/minor/patch components and incrementing patch. Replaced fallback concatenation with derived version property.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 A version was born from a stable release,
We parsed and we incremented, seeking to increase,
The patch number bumped with MSBuild's care,
-dev* appended to mark it as rare! 🚀

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main change: altering the build to pull the next dev version, which aligns with the core modification to compute a dev wildcard version for packages.
Description check ✅ Passed The description includes key sections (Description, Motivation/Context, Types of Changes, Checklist) and properly identifies the change as a bug fix with ticket reference BED-7858, though testing details are absent.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch mcuomo/BED-7858

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
Copy Markdown

@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

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@Sharphound.csproj`:
- Around line 22-27: The MSBuild logic computes CommonLibsDevVersion from
CommonLibsStableVersion using _StablePatch and _MajorMinor to form an
incremented patch string (CommonLibsDevVersion =
$(_MajorMinor).$([MSBuild]::Add($(_StablePatch), 1))-dev*); verify with the
SharpHoundCommon maintainers that dev packages are actually published on the
feed as an incremented-patch pattern (e.g., 4.6.1-dev*) and not as a same-patch
dev tag (e.g., 4.6.0-dev.xxx) or only on a private feed; if the scheme differs,
update the generation logic (CommonLibsDevVersion) to match the real naming
convention or point the restore to the correct feed so restores succeed.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 568206bd-658a-4d96-a8dc-482d88832a70

📥 Commits

Reviewing files that changed from the base of the PR and between b6538ba and d03d2ca.

📒 Files selected for processing (1)
  • Sharphound.csproj

Comment on lines +22 to +27
<!-- Derive the dev version by incrementing the patch of the stable version, mirroring
the auto-increment logic in SharpHoundCommon's publish-dev-package pipeline.
e.g. stable=4.6.0 → dev wildcard=4.6.1-dev* -->
<_StablePatch>$([System.Text.RegularExpressions.Regex]::Match($(CommonLibsStableVersion), '[0-9]+$').Value)</_StablePatch>
<_MajorMinor>$([System.Text.RegularExpressions.Regex]::Match($(CommonLibsStableVersion), '^[0-9]+\.[0-9]+').Value)</_MajorMinor>
<CommonLibsDevVersion>$(_MajorMinor).$([MSBuild]::Add($(_StablePatch), 1))-dev*</CommonLibsDevVersion>
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Description: Search for SharpHoundCommon dev package versions to confirm naming pattern

# Check if nuget.org has packages matching the expected pattern
# Note: This requires the NuGet API to be accessible
curl -s "https://api.nuget.org/v3-flatcontainer/sharphoundcommon/index.json" 2>/dev/null | jq -r '.versions[]' | grep -E '^4\.6\.[0-9]+-dev' | head -10 || echo "Could not fetch package versions - please verify manually on nuget.org or your internal feed"

Repository: SpecterOps/SharpHound

Length of output: 47


Verify that SharpHoundCommon dev packages follow the incremented patch naming pattern.

The regex extraction and MSBuild arithmetic are mathematically sound—they correctly transform 4.6.04.6.1-dev*. However, the verification could not find public SharpHoundCommon dev packages matching the expected 4.6.x-dev* pattern on NuGet.org.

This code assumes SharpHoundCommon publishes dev packages with an incremented patch number (e.g., 4.6.1-dev* after stable 4.6.0). If the actual versioning scheme differs—such as publishing as 4.6.0-dev.xxx or using a private feed with a different pattern—the build will fail when attempting to restore a non-existent package version.

Confirm with the SharpHoundCommon maintainers that dev packages are published using the incremented patch pattern, or adjust the logic to match the actual versioning convention.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@Sharphound.csproj` around lines 22 - 27, The MSBuild logic computes
CommonLibsDevVersion from CommonLibsStableVersion using _StablePatch and
_MajorMinor to form an incremented patch string (CommonLibsDevVersion =
$(_MajorMinor).$([MSBuild]::Add($(_StablePatch), 1))-dev*); verify with the
SharpHoundCommon maintainers that dev packages are actually published on the
feed as an incremented-patch pattern (e.g., 4.6.1-dev*) and not as a same-patch
dev tag (e.g., 4.6.0-dev.xxx) or only on a private feed; if the scheme differs,
update the generation logic (CommonLibsDevVersion) to match the real naming
convention or point the restore to the correct feed so restores succeed.

@mykeelium mykeelium merged commit 2bdeee1 into 2.X Apr 3, 2026
3 checks passed
@mykeelium mykeelium deleted the mcuomo/BED-7858 branch April 3, 2026 17:25
@github-actions github-actions bot locked and limited conversation to collaborators Apr 3, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants