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

Bump Sarif.Sdk from 2.4.16 to 4.3.7 #1667

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions docs/CHANGELOG-v3.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ See [upgrade notes][1] for helpful information when upgrading from previous vers

## Unreleased

What's changed since pre-release v3.0.0-B0084:

- Engineering:
- Bump Sarif.Sdk to v4.3.7.
[#1667](https://github.com/microsoft/PSRule/pull/1667)

## v3.0.0-B0084 (pre-release)

What's changed since release v2.9.0:
Expand Down
3 changes: 2 additions & 1 deletion src/PSRule/PSRule.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="PowerShellStandard.Library" Version="5.1.1" PrivateAssets="All" />
<PackageReference Include="Sarif.Sdk" Version="2.4.16" />
<PackageReference Include="Sarif.Sdk" Version="4.3.7" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
</ItemGroup>

<!-- Add code generators -->
Expand Down
9 changes: 5 additions & 4 deletions src/PSRule/Pipeline/Output/SarifOutputWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,12 @@ internal sealed class SarifBuilder
{
private const string TOOL_NAME = "PSRule";
private const string TOOL_ORG = "Microsoft Corporation";
private const string TOOL_GUID = "0130215d-58eb-4887-b6fa-31ed02500569";
private const string RECOMMENDATION_MESSAGE_ID = "recommendation";
private const string LOCATION_KIND_OBJECT = "object";
private const string LOCATION_ID_REPOROOT = "REPOROOT";

private static readonly Guid _ToolGuid = new("0130215d-58eb-4887-b6fa-31ed02500569");

private readonly Run _Run;
private readonly Dictionary<string, ReportingDescriptorReference> _Rules;
private readonly Dictionary<string, ToolComponent> _Extensions;
Expand Down Expand Up @@ -104,7 +105,7 @@ public void Add(RuleRecord record)
};

// SARIF2004: Use the RuleId property instead of Rule for standalone rules.
if (rule.ToolComponent.Guid == TOOL_GUID)
if (rule.ToolComponent.Guid == _ToolGuid)
{
result.RuleId = rule.Id;
result.Rule = null;
Expand Down Expand Up @@ -291,7 +292,7 @@ private Tool GetTool(Source[] source)
Name = TOOL_NAME,
SemanticVersion = version,
Organization = TOOL_ORG,
Guid = TOOL_GUID,
Guid = _ToolGuid,
Rules = new List<ReportingDescriptor>(),
InformationUri = new Uri("https://aka.ms/ps-rule", UriKind.Absolute),
},
Expand All @@ -313,7 +314,7 @@ private IList<ToolComponent> GetExtensions(Source[] source)
{
Name = source[i].Module.Name,
Version = source[i].Module.Version,
Guid = source[i].Module.Guid,
Guid = new Guid(source[i].Module.Guid),
AssociatedComponent = new ToolComponentReference
{
Name = TOOL_NAME,
Expand Down
Loading