fix: alter build to pull the next dev version - BED-7858#208
Conversation
WalkthroughThe Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
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
| <!-- 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> |
There was a problem hiding this comment.
🧩 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.0 → 4.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.
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
Checklist:
Summary by CodeRabbit