[codex] Optimize semantic convention analyzer README#21
Conversation
|
@coderabbitai autofix |
📝 WalkthroughSummary by CodeRabbit
WalkthroughRepository-wide rebrand to Qyl/QYL IDs and namespaces, adds SemConv analyzer option for non-*Attributes tiers, implements supplemental-catalog regen tooling + CI, adds Weaver round-trip fixture + CI and tests, updates docs, packaging, samples, and many tests to the new identifiers. ChangesQYL migration and analyzer/CI updates
Sequence Diagram(s)sequenceDiagram
participant Dev as Developer
participant Analyzer as DeprecatedSemconvAnalyzer
participant Options as AnalyzerConfigOptionsProvider
participant CatalogCI as Supplemental Catalog CI
participant Regen as regen-supplemental-catalog.csx
participant WeaverCI as Weaver Round-trip Workflow
participant Weaver as Weaver CLI
participant Tests as WeaverRoundTripTests
Dev->>Analyzer: Build/compile (QYL analyzers)
Analyzer->>Options: Read build_property.OtelSemConvNonAttributesTiers
Options-->>Analyzer: allowNonAttributesTiers
Analyzer-->>Dev: Emit QYL00xx diagnostics
CatalogCI->>Regen: dotnet-script scripts/regen-supplemental-catalog.csx
Regen-->>CatalogCI: writes .upstream-deprecated-extract.txt
CatalogCI->>CatalogCI: git diff --exit-code → fail on drift
WeaverCI->>Weaver: run tests/WeaverRoundTrip/generate.sh
Weaver-->>WeaverCI: HttpAttributes.cs generated
WeaverCI->>Tests: dotnet test (WeaverRoundTrip)
Tests-->>WeaverCI: Assert QYL0010 diagnostic
Estimated code review effort🎯 4 (Complex) | ⏱️ ~55 minutes Possibly related PRs
Suggested labels
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
✨ Simplify code
|
|
Note Autofix is a beta feature. Expect some limitations and changes as we gather feedback and continue to improve it. Autofix skipped. No unresolved CodeRabbit review comments with fix instructions found. |
Up to standards ✅🟢 Issues
|
There was a problem hiding this comment.
Pull request overview
Refreshes the repository README to serve as a consumer-facing entry point for the semantic convention analyzers, with clearer installation guidance, richer diagnostics discovery, and documented configuration/validation steps.
Changes:
- Reworked README structure (status/installation, diagnostics, examples, configuration, validation, incubation).
- Enhanced the diagnostics table with code-fix visibility and deep links to per-rule generated documentation.
- Surfaced curated migration/audit counts and clarified the relationship between live
[Obsolete]metadata vs the supplemental catalog.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@README.md`:
- Line 58: Replace the hard-coded numeric totals in the "Curated migration
inventory." prose in README.md with a dynamic reference to the audit output
(e.g., mention "see scripts/generate-docs.sh audit or the generated docs for
current counts") instead of embedding literal counts; update both occurrences of
the sentence (the one at the current "Curated migration inventory." and the
other similar sentence) so readers are directed to scripts/generate-docs.sh
audit or the generated documentation as the authoritative source of counts.
- Around line 90-97: The README's validation command block is missing the git
whitespace/conflict check; update the listed validation sequence (the fenced
bash block containing dotnet build, dotnet test, scripts/generate-docs.sh
validate, scripts/generate-docs.sh audit) to include git diff --check as part of
the repository gates (run it before merging, e.g., add `git diff --check` as the
first or final step in that command list) so PRs will catch whitespace and
conflict-marker regressions.
🪄 Autofix (Beta)
✅ Autofix completed
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: ab8fd914-6cbb-4988-9b1c-00fbacafedad
📒 Files selected for processing (1)
README.md
📜 Review details
⏰ Context from checks skipped due to timeout of 900000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: copilot-pull-request-reviewer
- GitHub Check: Codacy Static Code Analysis
Triage Bot report
Threads marked |
1 similar comment
Triage Bot report
Threads marked |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chainLet me pull the full thread content first. 🏁 Script executed: Length of output: 25245
Thread ts6EWb6M (Copilot — README.md Line 36) — Grammar Subject-verb agreement: the phrase refers to two attributes ( Thread ts6EWcIC (coderabbitai — README.md Lines 58 & 67) — Hard-coded counts This is the substantive one. Embedding literal coverage totals in README prose creates a silent spec-drift vector: the catalog changes, the counts go stale, and the README becomes factually wrong with no automated enforcement. The fix is to replace the literal numbers with a pointer to Thread ts6EWcID (coderabbitai — README.md Lines 90–97) — Missing The PR description explicitly lists dotnet build ANcpLua.OpenTelemetry.SemanticConventions.Analyzers.slnx -c Release
dotnet test tests/ANcpLua.OpenTelemetry.SemanticConventions.Analyzers.Tests/ANcpLua.OpenTelemetry.SemanticConventions.Analyzers.Tests.csproj
scripts/generate-docs.sh validate
scripts/generate-docs.sh audit
+git diff --checkAll three can be resolved in a single commit. Once addressed, let me know and I can resolve the two coderabbitai threads. |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chainLet me pull the full thread content before responding. 🏁 Script executed: Length of output: 25269
Thread ts6EWb6M — Grammar (README.md Line 36)Valid. " -`client.address`/`client.port`, which was removed
+`client.address`/`client.port`, which were removedTrivial one-word fix. Thread ts6EWcIC — Hard-coded audit counts (README.md Lines 58 & 67)Valid and the most important of the three. Embedding literal coverage numbers in prose creates an undeclared invariant: the README becomes silently wrong every time the catalog changes, and no CI step enforces consistency. The PR itself ships -Curated migration inventory covering N attributes and M removed signals.
+Run `scripts/generate-docs.sh audit` for current migration inventory counts.Apply the same treatment to Line 67. Thread ts6EWcID — Missing
|
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
|
@coderabbitai autofix |
|
Note Autofix is a beta feature. Expect some limitations and changes as we gather feedback and continue to improve it. Fixes Applied SuccessfullyFixed 1 file(s) based on 2 unresolved review comments. Files modified:
Commit: The changes have been pushed to the Time taken: |
|
Note Autofix is a beta feature. Expect some limitations and changes as we gather feedback and continue to improve it. The branch was updated while autofix was in progress. Please try again. |
There was a problem hiding this comment.
Pull Request Overview
The README optimization provides a much-needed consumer-focused entry point, including installation guides and detailed diagnostic descriptions. Codacy analysis indicates that the PR is up to standards with no new automated quality issues.
However, there are two primary technical concerns within the documentation: a misconfiguration in the PackageReference example that may lead to assembly bloat in consumer projects, and a logic contradiction regarding automated code fixes for rule OTSC0031. Additionally, while the README describes sophisticated logic for 'OtelSemConvLegacyMode' and test project detection, there is an implementation gap as these behaviors lack corresponding test coverage in this update.
Test suggestions
- Verify the 'OtelSemConvLegacyMode' configuration correctly maps to Error, Warning, and Info severities for supplemental diagnostics
- Verify test project detection logic identifies contexts based on assembly naming (.Tests), directory path (tests/), and framework attributes (xUnit/NUnit/MSTest)
- Ensure the 'generate-docs.sh audit' script produces the 156-count inventory cited in the documentation
Prompt proposal for missing tests
Consider implementing these tests if applicable:
1. Verify the 'OtelSemConvLegacyMode' configuration correctly maps to Error, Warning, and Info severities for supplemental diagnostics
2. Verify test project detection logic identifies contexts based on assembly naming (.Tests), directory path (tests/), and framework attributes (xUnit/NUnit/MSTest)
3. Ensure the 'generate-docs.sh audit' script produces the 156-count inventory cited in the documentation
TIP Improve review quality by adding custom instructions
TIP How was this review? Give us feedback
| <PackageReference Include="ANcpLua.OpenTelemetry.SemanticConventions.Analyzers" | ||
| Version="..." | ||
| PrivateAssets="all" | ||
| IncludeAssets="runtime; build; native; contentfiles; analyzers; buildtransitive" /> |
There was a problem hiding this comment.
🟡 MEDIUM RISK
Suggestion: Exclude runtime assets to prevent the analyzer DLL from being copied to the project's output directory.
| IncludeAssets="runtime; build; native; contentfiles; analyzers; buildtransitive" /> | |
| IncludeAssets="analyzers; buildtransitive" /> |
| | [`OTSC0014`](docs/ANcpLua.OpenTelemetry.SemanticConventions.Analyzers.md#otsc0014) | Warning | Yes | Hard-coded value matches a semantic-convention value constant marked `[Obsolete]` | | ||
| | [`OTSC0021`](docs/ANcpLua.OpenTelemetry.SemanticConventions.Analyzers.md#otsc0021) | Warning | No | Library directly references incubating semantic-convention members | | ||
| | [`OTSC0030`](docs/ANcpLua.OpenTelemetry.SemanticConventions.Analyzers.md#otsc0030) | Error | Exact replacements only | Supplemental catalog exact replacement in production telemetry emission | | ||
| | [`OTSC0031`](docs/ANcpLua.OpenTelemetry.SemanticConventions.Analyzers.md#otsc0031) | Warning | Exact replacements only | Supplemental catalog context-sensitive, manual-review, removed/no-replacement, or ambiguous payload migration | |
There was a problem hiding this comment.
⚪ LOW RISK
The code-fix availability for OTSC0031 contradicts its description of handling 'no-replacement' or 'ambiguous' cases. Update this column to reflect that no automated fix is provided for these specific scenarios.
| | [`OTSC0031`](docs/ANcpLua.OpenTelemetry.SemanticConventions.Analyzers.md#otsc0031) | Warning | Exact replacements only | Supplemental catalog context-sensitive, manual-review, removed/no-replacement, or ambiguous payload migration | | |
| [`OTSC0031`](docs/ANcpLua.OpenTelemetry.SemanticConventions.Analyzers.md#otsc0031) | Warning | No | Supplemental catalog context-sensitive, manual-review, removed/no-replacement, or ambiguous payload migration | |
Triage Bot report
Threads marked |
1 similar comment
Triage Bot report
Threads marked |
Fixed 1 file(s) based on 2 unresolved review comments. Co-authored-by: CodeRabbit <noreply@coderabbit.ai>
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain
Blocking before merge (correctness/CI/spec-drift)
-<PackageReference Include="Qyl.OpenTelemetry.SemanticConventions.Analyzers"
- Version="..."
- PrivateAssets="all"
- IncludeAssets="runtime; build; native; contentfiles; analyzers; buildtransitive" />
+<PackageReference Include="Qyl.OpenTelemetry.SemanticConventions.Analyzers"
+ Version="..."
+ PrivateAssets="all"
+ IncludeAssets="analyzers; buildtransitive" />
-| [`QYL0031`](...) | Warning | Exact replacements only | ...
-| [`QYL0032`](...) | Info | Exact replacements only | ...
+| [`QYL0031`](...) | Warning | No | ...
+| [`QYL0032`](...) | Info | No | ...
-<RootNamespace>OpenTelemetry.SemanticConventions.Analyzers</RootNamespace>
-<AssemblyName>OpenTelemetry.SemanticConventions.Analyzers</AssemblyName>
+<RootNamespace>Qyl.OpenTelemetry.SemanticConventions.Analyzers</RootNamespace>
+<AssemblyName>Qyl.OpenTelemetry.SemanticConventions.Analyzers</AssemblyName>
- if (File.Exists(Path.Combine(dir.FullName, "ANcpLua.OpenTelemetry.SemanticConventions.Analyzers.slnx")))
+ var hasSln = File.Exists(Path.Combine(dir.FullName, "Qyl.OpenTelemetry.SemanticConventions.Analyzers.slnx"))
+ || File.Exists(Path.Combine(dir.FullName, "ANcpLua.OpenTelemetry.SemanticConventions.Analyzers.slnx"));
+ var hasMarkers = Directory.Exists(Path.Combine(dir.FullName, ".git"))
+ && File.Exists(Path.Combine(dir.FullName, "scripts", ".upstream-semconv-version"));
+ if (hasSln || hasMarkers)
return dir.FullName;
...
- catch (Exception ex)
- {
- Console.Error.WriteLine($"skipping {file}: {ex.Message}");
- return;
- }
+ catch (Exception ex)
+ {
+ throw new InvalidOperationException($"Failed to parse upstream model file: {file}", ex);
+ }
- + "/blob/main/docs/ANcpLua.OpenTelemetry.SemanticConventions.Analyzers.md#";
+ + "/blob/main/docs/Qyl.OpenTelemetry.SemanticConventions.Analyzers.md#";
- install -m 0755 "$RUNNER_TEMP/weaver/weaver" /usr/local/bin/weaver
+ mkdir -p "$HOME/.local/bin"
+ install -m 0755 "$RUNNER_TEMP/weaver/weaver" "$HOME/.local/bin/weaver"
+ echo "$HOME/.local/bin" >> "$GITHUB_PATH"
- private const string ProjectRelativePath = "tools/" + PackageName + ".DocsGenerator";
+ private const string ProjectRelativePath = "tools/ANcpLua.OpenTelemetry.SemanticConventions.Analyzers.DocsGenerator";
...
- ? d.Id is "QYL0030" or "QYL0031" or "QYL0032" ? "Exact replacements only" : "Yes"
+ ? d.Id is "QYL0030" ? "Exact replacements only" : "Yes"
-using Qyl.OpenTelemetry.SemanticConventions.Analyzers.Analyzers;
+using Qyl.OpenTelemetry.SemanticConventions.Analyzers;
...
-using Qyl.OpenTelemetry.SemanticConventions.Analyzers.CodeFixes.CodeFixes;
+using Qyl.OpenTelemetry.SemanticConventions.Analyzers.CodeFixes;
After you push the above, I’ll resolve ts6EWqP5 and ts6EWqP7 and mark the stale ones accordingly. 🏁 Script executed: Length of output: 28957
Blocking fixes (minimum required to unblock merge)
-<PackageReference Include="Qyl.OpenTelemetry.SemanticConventions.Analyzers"
- Version="..."
- PrivateAssets="all"
- IncludeAssets="runtime; build; native; contentfiles; analyzers; buildtransitive" />
+<PackageReference Include="Qyl.OpenTelemetry.SemanticConventions.Analyzers"
+ Version="..."
+ PrivateAssets="all"
+ IncludeAssets="analyzers; buildtransitive" />
-| [`QYL0031`](docs/Qyl.OpenTelemetry.SemanticConventions.Analyzers.md#qyl0031) | Warning | Exact replacements only | Supplemental catalog context-sensitive, manual-review, removed/no-replacement, or ambiguous payload migration |
-| [`QYL0032`](docs/Qyl.OpenTelemetry.SemanticConventions.Analyzers.md#qyl0032) | Info | Exact replacements only | Supplemental catalog item appears in test, fixture, compatibility, generated, translator, or catalog context |
+| [`QYL0031`](docs/Qyl.OpenTelemetry.SemanticConventions.Analyzers.md#qyl0031) | Warning | No | Supplemental catalog context-sensitive, manual-review, removed/no-replacement, or ambiguous payload migration |
+| [`QYL0032`](docs/Qyl.OpenTelemetry.SemanticConventions.Analyzers.md#qyl0032) | Info | No | Supplemental catalog item appears in test, fixture, compatibility, generated, translator, or catalog context |
-- **Generated docs and audit.** Regenerate the package catalog with `scripts/generate-docs.sh generate`; validate with `scripts/generate-docs.sh validate`; print the current 156-entry coverage audit with `scripts/generate-docs.sh audit`. Every `QYL*` rule has a stable `#qyl0010` anchor in the generated docs that every `DiagnosticDescriptor.HelpLinkUri` resolves to.
+- **Generated docs and audit.** Regenerate the package catalog with `scripts/generate-docs.sh generate`; validate with `scripts/generate-docs.sh validate`; print the current coverage audit with `scripts/generate-docs.sh audit`. Every `QYL*` rule has a stable `#qyl0010` anchor in the generated docs that every `DiagnosticDescriptor.HelpLinkUri` resolves to.
- install -m 0755 "$RUNNER_TEMP/weaver/weaver" /usr/local/bin/weaver
+ mkdir -p "$HOME/.local/bin"
+ install -m 0755 "$RUNNER_TEMP/weaver/weaver" "$HOME/.local/bin/weaver"
+ echo "$HOME/.local/bin" >> "$GITHUB_PATH"
- var codeFix = fixableIds.contains(d.Id)
- ? d.Id == "QYL0030" ? "Exact replacements only" : "Yes"
- : "No";
+ var codeFix = d.Id == "QYL0030"
+ ? "Exact replacements only"
+ : "No";
@@
- var codeFix = fixableIds.Contains(d.Id)
- ? d.Id == "QYL0030" ? "Exact replacements only." : "Yes."
- : "No.";
+ var codeFix = d.Id == "QYL0030"
+ ? "Exact replacements only."
+ : "No.";
@@
- sb.AppendLine($"| Keep attribute-value fallback separate from the curated name/key/event/metric count | `{stats.ValueEntries.Length}` supplemental attribute-value rows are outside the 156-entry inventory and are used only when live value metadata is absent. |");
+ sb.AppendLine($"| Keep attribute-value fallback separate from the curated name/key/event/metric count | `{stats.ValueEntries.Length}` supplemental attribute-value rows are outside the curated inventory and are used only when live value metadata is absent. |");Note: Longer-term, adjust SupplementalSemconvMigrationCodeFixProvider.FixableDiagnosticIds to only advertise QYL0030. The override above prevents doc drift even if a provider misadvertises.
-using Qyl.OpenTelemetry.SemanticConventions.Analyzers.Analyzers;
+using Qyl.OpenTelemetry.SemanticConventions.Analyzers;-using Qyl.OpenTelemetry.SemanticConventions.Analyzers.CodeFixes.CodeFixes;
+using Qyl.OpenTelemetry.SemanticConventions.Analyzers.CodeFixes;-using AnalyzerTestBase = ANcpLua.Roslyn.Utilities.Testing.AnalyzerTest<ANcpLua.Analyzers.Analyzers.Al0131DirectGenAiSdkUsageAnalyzer>;
+using AnalyzerTestBase = ANcpLua.Roslyn.Utilities.Testing.AnalyzerTest<Qyl.OpenTelemetry.SemanticConventions.Analyzers.Al0131DirectGenAiSdkUsageAnalyzer>;Files to update (from your scan): all listed under tests/.../Imports/QYL00xx*.cs, plus QYL0131DirectGenAiSdkUsageTests.cs. Threads that are stale and can be closed
Optional follow-up (if you want deterministic CI later; not blocking)
Confirm once you push the above; I’ll mark ts6EWqP5 and ts6EWqP7 resolved and call out any residuals. |
|
Tip For best results, initiate chat on the files or code changes.
Here is a minimal patch set to clear the blocking threads and remove the remaining drift/CI hazards. Each change maps to a line item from your triage list. No behavior changes beyond what’s stated.
--- a/README.md
+++ b/README.md
@@
-<PackageReference Include="Qyl.OpenTelemetry.SemanticConventions.Analyzers"
- Version="..."
- PrivateAssets="all"
- IncludeAssets="runtime; build; native; contentfiles; analyzers; buildtransitive" />
+<PackageReference Include="Qyl.OpenTelemetry.SemanticConventions.Analyzers"
+ Version="..."
+ PrivateAssets="all"
+ IncludeAssets="analyzers; buildtransitive" />
@@
-| [`QYL0031`](docs/Qyl.OpenTelemetry.SemanticConventions.Analyzers.md#qyl0031) | Warning | Exact replacements only | Supplemental catalog context-sensitive, manual-review, removed/no-replacement, or ambiguous payload migration |
-| [`QYL0032`](docs/Qyl.OpenTelemetry.SemanticConventions.Analyzers.md#qyl0032) | Info | Exact replacements only | Supplemental catalog item appears in test, fixture, compatibility, generated, translator, or catalog context |
+| [`QYL0031`](docs/Qyl.OpenTelemetry.SemanticConventions.Analyzers.md#qyl0031) | Warning | No | Supplemental catalog context-sensitive, manual-review, removed/no-replacement, or ambiguous payload migration |
+| [`QYL0032`](docs/Qyl.OpenTelemetry.SemanticConventions.Analyzers.md#qyl0032) | Info | No | Supplemental catalog item appears in test, fixture, compatibility, generated, translator, or catalog context |
@@
-- **Generated docs and audit.** Regenerate the package catalog with `scripts/generate-docs.sh generate`; validate with `scripts/generate-docs.sh validate`; print the current 156-entry coverage audit with `scripts/generate-docs.sh audit`.
+- **Generated docs and audit.** Regenerate with `scripts/generate-docs.sh generate`; validate with `scripts/generate-docs.sh validate`; print the current coverage audit with `scripts/generate-docs.sh audit`.
@@ (ensure example paths match this repo’s current tree)
-<ProjectReference Include="src/Qyl.OpenTelemetry.SemanticConventions.Analyzers/Qyl.OpenTelemetry.SemanticConventions.Analyzers.csproj"
+<ProjectReference Include="src/ANcpLua.OpenTelemetry.SemanticConventions.Analyzers/ANcpLua.OpenTelemetry.SemanticConventions.Analyzers.csproj"
OutputItemType="Analyzer"
ReferenceOutputAssembly="false" />
@@
-dotnet test tests/Qyl.OpenTelemetry.SemanticConventions.Analyzers.Tests/Qyl.OpenTelemetry.SemanticConventions.Analyzers.Tests.csproj
+dotnet test tests/ANcpLua.OpenTelemetry.SemanticConventions.Analyzers.Tests/ANcpLua.OpenTelemetry.SemanticConventions.Analyzers.Tests.csproj
@@ (Incubation/package identity)
-This package ships under the `ANcpLua.*` package ID …
+This package ships under the `Qyl.*` package ID …
--- a/tools/ANcpLua.OpenTelemetry.SemanticConventions.Analyzers.DocsGenerator/Program.cs
+++ b/tools/ANcpLua.OpenTelemetry.SemanticConventions.Analyzers.DocsGenerator/Program.cs
@@
- private const string PackageName = "Qyl.OpenTelemetry.SemanticConventions.Analyzers";
- private const string ProjectRelativePath = "tools/" + PackageName + ".DocsGenerator";
+ private const string PackageName = "Qyl.OpenTelemetry.SemanticConventions.Analyzers";
+ // Match current repo layout; update if the folder is renamed.
+ private const string ProjectRelativePath = "tools/ANcpLua.OpenTelemetry.SemanticConventions.Analyzers.DocsGenerator";
@@ // diagnostics table rendering
- ? d.Id is "QYL0030" or "QYL0031" or "QYL0032" ? "Exact replacements only" : "Yes"
+ ? d.Id is "QYL0030" ? "Exact replacements only" : "Yes"
@@ // per‑row details rendering
- ? d.Id is "QYL0030" or "QYL0031" or "QYL0032" ? "Exact replacements only." : "Yes."
+ ? d.Id is "QYL0030" ? "Exact replacements only." : "Yes."
--- a/scripts/regen-supplemental-catalog.csx
+++ b/scripts/regen-supplemental-catalog.csx
@@
-static string FindRepoRoot()
+static string FindRepoRoot()
{
var dir = new DirectoryInfo(Directory.GetCurrentDirectory());
while (dir is not null)
{
- if (File.Exists(Path.Combine(dir.FullName, "ANcpLua.OpenTelemetry.SemanticConventions.Analyzers.slnx")))
+ var hasSln =
+ File.Exists(Path.Combine(dir.FullName, "Qyl.OpenTelemetry.SemanticConventions.Analyzers.slnx")) ||
+ File.Exists(Path.Combine(dir.FullName, "ANcpLua.OpenTelemetry.SemanticConventions.Analyzers.slnx"));
+ var hasMarkers =
+ Directory.Exists(Path.Combine(dir.FullName, ".git")) &&
+ File.Exists(Path.Combine(dir.FullName, "scripts", ".upstream-semconv-version"));
+ if (hasSln || hasMarkers)
{
return dir.FullName;
}
dir = dir.Parent;
}
throw new InvalidOperationException("Could not find repository root.");
}
@@
- try
- {
- stream = new YamlStream();
- stream.Load(reader);
- }
- catch (Exception ex)
- {
- Console.Error.WriteLine($"skipping {file}: {ex.Message}");
- return;
- }
+ stream = new YamlStream();
+ try { stream.Load(reader); }
+ catch (Exception ex) { throw new InvalidOperationException($"Failed to parse upstream model file: {file}", ex); }
--- a/src/ANcpLua.OpenTelemetry.SemanticConventions.Analyzers/DiagnosticDescriptors.cs
+++ b/src/ANcpLua.OpenTelemetry.SemanticConventions.Analyzers/DiagnosticDescriptors.cs
@@
- private const string HelpLinkBase = "https://github.com/ANcpLua/ANcpLua.OpenTelemetry.SemanticConventions.Analyzers/blob/main/docs/ANcpLua.OpenTelemetry.SemanticConventions.Analyzers.md#";
+ private const string HelpLinkBase = "https://github.com/ANcpLua/ANcpLua.OpenTelemetry.SemanticConventions.Analyzers/blob/main/docs/Qyl.OpenTelemetry.SemanticConventions.Analyzers.md#";
--- a/.github/workflows/weaver-roundtrip.yml
+++ b/.github/workflows/weaver-roundtrip.yml
@@
- install -m 0755 "$RUNNER_TEMP/weaver/weaver" /usr/local/bin/weaver
+ mkdir -p "$HOME/.local/bin"
+ install -m 0755 "$RUNNER_TEMP/weaver/weaver" "$HOME/.local/bin/weaver"
+ echo "$HOME/.local/bin" >> "$GITHUB_PATH"
weaver --version
--- a/src/ANcpLua.OpenTelemetry.SemanticConventions.Analyzers/ANcpLua.OpenTelemetry.SemanticConventions.Analyzers.csproj
+++ b/src/ANcpLua.OpenTelemetry.SemanticConventions.Analyzers/ANcpLua.OpenTelemetry.SemanticConventions.Analyzers.csproj
@@
- <RootNamespace>OpenTelemetry.SemanticConventions.Analyzers</RootNamespace>
- <AssemblyName>OpenTelemetry.SemanticConventions.Analyzers</AssemblyName>
+ <RootNamespace>Qyl.OpenTelemetry.SemanticConventions.Analyzers</RootNamespace>
+ <AssemblyName>Qyl.OpenTelemetry.SemanticConventions.Analyzers</AssemblyName>
--- a/src/ANcpLua.OpenTelemetry.SemanticConventions.Analyzers/LiveSemconvMetadataCodeFixProvider.cs
+++ b/src/ANcpLua.OpenTelemetry.SemanticConventions.Analyzers/LiveSemconvMetadataCodeFixProvider.cs
@@
- public override ImmutableArray<string> FixableDiagnosticIds { get; } =
- ImmutableArray.Create("QYL0010", "QYL0012", "QYL0014");
+ private const string DeprecatedConstantId = "QYL0010";
+ public override ImmutableArray<string> FixableDiagnosticIds { get; } =
+ ImmutableArray.Create(DeprecatedConstantId, "QYL0012", "QYL0014");
@@
- if (diagnostic.Id == "QYL0010")
+ if (diagnostic.Id == DeprecatedConstantId)
--- a/src/ANcpLua.OpenTelemetry.SemanticConventions.Analyzers/OpenTelemetryDeprecatedSemconvCatalog.cs
+++ b/src/ANcpLua.OpenTelemetry.SemanticConventions.Analyzers/OpenTelemetryDeprecatedSemconvCatalog.cs
@@
-using Qyl.OpenTelemetry.SemanticConventions.Analyzers;
Two representative diffs: --- a/tests/ANcpLua.OpenTelemetry.SemanticConventions.Analyzers.Tests/Imports/QYL0085InvalidAttributeValueTests.cs
+++ b/tests/ANcpLua.OpenTelemetry.SemanticConventions.Analyzers.Tests/Imports/QYL0085InvalidAttributeValueTests.cs
@@
-using Qyl.OpenTelemetry.SemanticConventions.Analyzers.Analyzers;
+using Qyl.OpenTelemetry.SemanticConventions.Analyzers;--- a/tests/ANcpLua.OpenTelemetry.SemanticConventions.Analyzers.Tests/Imports/QYL0124NonInterceptableAgentTracedTests.cs
+++ b/tests/ANcpLua.OpenTelemetry.SemanticConventions.Analyzers.Tests/Imports/QYL0124NonInterceptableAgentTracedTests.cs
@@
-using Qyl.OpenTelemetry.SemanticConventions.Analyzers.Analyzers;
-using Qyl.OpenTelemetry.SemanticConventions.Analyzers.CodeFixes.CodeFixes;
+using Qyl.OpenTelemetry.SemanticConventions.Analyzers;
+using Qyl.OpenTelemetry.SemanticConventions.Analyzers.CodeFixes;
Confirm which way you want to go and I’ll prep the corresponding diff. Validation gates (unchanged; run after patch)
Reply with your preference for the Utilities version (2.2.9 vs 2.2.22). I’ll then post the final hunk for that item and we can resolve the corresponding threads. |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: Length of output: 27376
Snapshot at HEAD a0bad40 confirms several “needs-human” threads are stale, and a small set of real issues remain. Here’s the disposition and the exact changes to close them. What’s already fixed on branch (safe to mark resolved)
Action required to unblock the remaining threads
Diff (README.md): -<PackageReference Include="Qyl.OpenTelemetry.SemanticConventions.Analyzers"
- Version="..."
- PrivateAssets="all"
- IncludeAssets="runtime; build; native; contentfiles; analyzers; buildtransitive" />
+<PackageReference Include="Qyl.OpenTelemetry.SemanticConventions.Analyzers"
+ Version="..."
+ PrivateAssets="all"
+ IncludeAssets="analyzers; buildtransitive" />
Diff (README.md diagnostics table): -| [`QYL0031`](...) | Warning | Exact replacements only | Supplemental catalog context-sensitive, manual-review, removed/no-replacement, or ambiguous payload migration |
-| [`QYL0032`](...) | Info | Exact replacements only | Supplemental catalog item appears in test, fixture, compatibility, generated, translator, or catalog context |
+| [`QYL0031`](...) | Warning | No | Supplemental catalog context-sensitive, manual-review, removed/no-replacement, or ambiguous payload migration |
+| [`QYL0032`](...) | Info | No | Supplemental catalog item appears in test, fixture, compatibility, generated, translator, or catalog context |Generator correction (tools/.../DocsGenerator/Program.cs):
- // Code fix label
- var codeFix = fixableIds != null
- ? (fixableIds.Contains(d.Id) ? "Yes" : "No")
- : (d.Id == "QYL0030" ? "Exact replacements only" : "Yes");
+ // Determine code-fix availability from actual providers; reserve special label for QYL0030
+ var codeFixProviders = analyzerAsm.GetTypes()
+ .Where(t => !t.IsAbstract && typeof(Microsoft.CodeAnalysis.CodeFixes.CodeFixProvider).IsAssignableFrom(t))
+ .Select(t => (Microsoft.CodeAnalysis.CodeFixes.CodeFixProvider)Activator.CreateInstance(t)!)
+ .ToArray();
+ var fixableIds = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
+ foreach (var p in codeFixProviders)
+ foreach (var id in p.FixableDiagnosticIds)
+ fixableIds.Add(id);
+
+ string codeFix = d.Id == "QYL0030"
+ ? "Exact replacements only"
+ : (fixableIds.Contains(d.Id) ? "Yes" : "No");Apply the same replacement where the details pane repeats the label (the second ternary you have at ~line 158).
Diff (README.md): -<ProjectReference Include="path/to/src/Qyl.OpenTelemetry.SemanticConventions.Analyzers/Qyl.OpenTelemetry.SemanticConventions.Analyzers.csproj"
+<ProjectReference Include="path/to/src/ANcpLua.OpenTelemetry.SemanticConventions.Analyzers/ANcpLua.OpenTelemetry.SemanticConventions.Analyzers.csproj"
OutputItemType="Analyzer"
ReferenceOutputAssembly="false" />-dotnet test tests/Qyl.OpenTelemetry.SemanticConventions.Analyzers.Tests/Qyl.OpenTelemetry.SemanticConventions.Analyzers.Tests.csproj -c Release
+dotnet test tests/ANcpLua.OpenTelemetry.SemanticConventions.Analyzers.Tests/ANcpLua.OpenTelemetry.SemanticConventions.Analyzers.Tests.csproj -c Release
Patch (tools/.../DocsGenerator/Program.cs): -const string ProjectRelativePath = "tools/Qyl.OpenTelemetry.SemanticConventions.Analyzers.DocsGenerator";
+static string FindDocsGeneratorPath(string repoRoot)
+{
+ var tools = Path.Combine(repoRoot, "tools");
+ return Directory.EnumerateDirectories(tools, "*DocsGenerator", SearchOption.TopDirectoryOnly)
+ .FirstOrDefault(dir => File.Exists(Path.Combine(dir, $"{Path.GetFileName(dir)}.csproj")))
+ ?? Path.Combine(tools, "ANcpLua.OpenTelemetry.SemanticConventions.Analyzers.DocsGenerator");
+}
+var generatorProjectPath = FindDocsGeneratorPath(repoRoot);…and use generatorProjectPath anywhere the docs print regeneration commands.
Diff (.github/workflows/weaver-roundtrip.yml): - install -m 0755 "$RUNNER_TEMP/weaver/weaver" /usr/local/bin/weaver
- weaver --version
+ mkdir -p "$HOME/.local/bin"
+ install -m 0755 "$RUNNER_TEMP/weaver/weaver" "$HOME/.local/bin/weaver"
+ echo "$HOME/.local/bin" >> "$GITHUB_PATH"
+ weaver --version
If you want, I can mark the three stale threads (HelpLinkBase, FindRepoRoot, Utilities version skew) as resolved after you push the above changes. Plan to apply
Would you like me to also:
The requested changes have been implemented and a pull request has been created: View PR |
There was a problem hiding this comment.
♻️ Duplicate comments (1)
tools/ANcpLua.OpenTelemetry.SemanticConventions.Analyzers.DocsGenerator/Program.cs (1)
130-131:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winSet QYL0031/QYL0032 code-fix visibility to
Noin generated docs.Line 130 and Line 158 still map non-
QYL0030fixable IDs toYes, which can surfaceQYL0031/QYL0032as fixable and reintroduce docs/rule-intent drift.Proposed fix
- var codeFix = fixableIds.Contains(d.Id) - ? d.Id == "QYL0030" ? "Exact replacements only" : "Yes" - : "No"; + var codeFix = d.Id switch + { + "QYL0030" => "Exact replacements only", + "QYL0031" or "QYL0032" => "No", + _ => fixableIds.Contains(d.Id) ? "Yes" : "No", + }; @@ - var codeFix = fixableIds.Contains(d.Id) - ? d.Id == "QYL0030" ? "Exact replacements only." : "Yes." - : "No."; + var codeFix = d.Id switch + { + "QYL0030" => "Exact replacements only.", + "QYL0031" or "QYL0032" => "No.", + _ => fixableIds.Contains(d.Id) ? "Yes." : "No.", + };Also applies to: 158-159
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@tools/ANcpLua.OpenTelemetry.SemanticConventions.Analyzers.DocsGenerator/Program.cs` around lines 130 - 131, The generated docs currently map most fixable IDs to "Yes" using the ternary that checks d.Id (with a special-case for "QYL0030"); update that mapping so that IDs "QYL0031" and "QYL0032" are explicitly treated as "No" (i.e., when computing the fixable visibility string for a diagnostic, return "No" for d.Id == "QYL0031" or d.Id == "QYL0032", keep the existing "Exact replacements only" for "QYL0030", and return "Yes"/"No" otherwise). Apply the same change in both places where the d.Id ternary is used to produce the fixable column.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Duplicate comments:
In
`@tools/ANcpLua.OpenTelemetry.SemanticConventions.Analyzers.DocsGenerator/Program.cs`:
- Around line 130-131: The generated docs currently map most fixable IDs to
"Yes" using the ternary that checks d.Id (with a special-case for "QYL0030");
update that mapping so that IDs "QYL0031" and "QYL0032" are explicitly treated
as "No" (i.e., when computing the fixable visibility string for a diagnostic,
return "No" for d.Id == "QYL0031" or d.Id == "QYL0032", keep the existing "Exact
replacements only" for "QYL0030", and return "Yes"/"No" otherwise). Apply the
same change in both places where the d.Id ternary is used to produce the fixable
column.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 0faa92a0-3489-4173-8155-bfd454541b05
📒 Files selected for processing (16)
scripts/regen-supplemental-catalog.csxsrc/ANcpLua.OpenTelemetry.SemanticConventions.Analyzers/ANcpLua.OpenTelemetry.SemanticConventions.Analyzers.csprojsrc/ANcpLua.OpenTelemetry.SemanticConventions.Analyzers/OpenTelemetryDeprecatedSemconvCatalog.cssrc/ANcpLua.OpenTelemetry.SemanticConventions.Analyzers/QYL0073TracedActivitySourceNameAnalyzer.cssrc/ANcpLua.OpenTelemetry.SemanticConventions.Analyzers/QYL0083InsecureEndpointAnalyzer.cssrc/ANcpLua.OpenTelemetry.SemanticConventions.Analyzers/QYL0093MissingResourceAttributesAnalyzer.cssrc/ANcpLua.OpenTelemetry.SemanticConventions.Analyzers/QYL0109NonInterceptableTracedAnalyzer.cssrc/ANcpLua.OpenTelemetry.SemanticConventions.Analyzers/SemconvLegacyContextSuppressor.cstests/ANcpLua.OpenTelemetry.SemanticConventions.Analyzers.Tests/Imports/QYL0013MissingSchemaUrlTests.cstests/ANcpLua.OpenTelemetry.SemanticConventions.Analyzers.Tests/Imports/QYL0064GenAiMissingRequiredAttributesTests.cstests/ANcpLua.OpenTelemetry.SemanticConventions.Analyzers.Tests/Imports/QYL0077DuplicateInstrumentationTests.cstests/ANcpLua.OpenTelemetry.SemanticConventions.Analyzers.Tests/Imports/QYL0079ManualSpanRecommendedTests.cstests/ANcpLua.OpenTelemetry.SemanticConventions.Analyzers.Tests/Imports/QYL0085InvalidAttributeValueTests.cstests/ANcpLua.OpenTelemetry.SemanticConventions.Analyzers.Tests/Imports/QYL0085OfficialSemconvAlignmentTests.cstests/ANcpLua.OpenTelemetry.SemanticConventions.Analyzers.Tests/Imports/QYL0124NonInterceptableAgentTracedTests.cstools/ANcpLua.OpenTelemetry.SemanticConventions.Analyzers.DocsGenerator/Program.cs
💤 Files with no reviewable changes (1)
- src/ANcpLua.OpenTelemetry.SemanticConventions.Analyzers/OpenTelemetryDeprecatedSemconvCatalog.cs
📜 Review details
⏰ Context from checks skipped due to timeout of 900000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Codacy Static Code Analysis
🔇 Additional comments (15)
tests/ANcpLua.OpenTelemetry.SemanticConventions.Analyzers.Tests/Imports/QYL0013MissingSchemaUrlTests.cs (1)
1-1: LGTM!tests/ANcpLua.OpenTelemetry.SemanticConventions.Analyzers.Tests/Imports/QYL0064GenAiMissingRequiredAttributesTests.cs (1)
1-1: LGTM!tests/ANcpLua.OpenTelemetry.SemanticConventions.Analyzers.Tests/Imports/QYL0124NonInterceptableAgentTracedTests.cs (1)
1-2: LGTM!tests/ANcpLua.OpenTelemetry.SemanticConventions.Analyzers.Tests/Imports/QYL0085InvalidAttributeValueTests.cs (1)
1-1: LGTM!tests/ANcpLua.OpenTelemetry.SemanticConventions.Analyzers.Tests/Imports/QYL0085OfficialSemconvAlignmentTests.cs (1)
1-1: LGTM!tests/ANcpLua.OpenTelemetry.SemanticConventions.Analyzers.Tests/Imports/QYL0077DuplicateInstrumentationTests.cs (1)
1-1: LGTM!src/ANcpLua.OpenTelemetry.SemanticConventions.Analyzers/QYL0109NonInterceptableTracedAnalyzer.cs (1)
5-5: LGTM!Also applies to: 33-34
tests/ANcpLua.OpenTelemetry.SemanticConventions.Analyzers.Tests/Imports/QYL0079ManualSpanRecommendedTests.cs (1)
1-1: LGTM!src/ANcpLua.OpenTelemetry.SemanticConventions.Analyzers/QYL0083InsecureEndpointAnalyzer.cs (1)
5-5: LGTM!Also applies to: 50-50
src/ANcpLua.OpenTelemetry.SemanticConventions.Analyzers/SemconvLegacyContextSuppressor.cs (1)
7-9: LGTM!src/ANcpLua.OpenTelemetry.SemanticConventions.Analyzers/QYL0093MissingResourceAttributesAnalyzer.cs (1)
5-5: LGTM!Also applies to: 25-25
src/ANcpLua.OpenTelemetry.SemanticConventions.Analyzers/ANcpLua.OpenTelemetry.SemanticConventions.Analyzers.csproj (1)
8-9: LGTM!src/ANcpLua.OpenTelemetry.SemanticConventions.Analyzers/QYL0073TracedActivitySourceNameAnalyzer.cs (1)
5-5: LGTM!Also applies to: 29-29
tools/ANcpLua.OpenTelemetry.SemanticConventions.Analyzers.DocsGenerator/Program.cs (1)
16-16: LGTM!Also applies to: 354-355
scripts/regen-supplemental-catalog.csx (1)
80-81: LGTM!Also applies to: 118-118
Triage Bot report
Threads marked |
|
To use Codex here, create an environment for this repo. |
|
Tip For best results, initiate chat on the files or code changes.
Blocking and drift-prone items. Apply these minimal diffs; they map one-to-one to the open threads.
*** a/README.md
--- b/README.md
@@
-<PackageReference Include="Qyl.OpenTelemetry.SemanticConventions.Analyzers"
- Version="..."
- PrivateAssets="all"
- IncludeAssets="runtime; build; native; contentfiles; analyzers; buildtransitive" />
+<PackageReference Include="Qyl.OpenTelemetry.SemanticConventions.Analyzers"
+ Version="..."
+ PrivateAssets="all"
+ IncludeAssets="analyzers; buildtransitive" />
@@
-| [`QYL0031`](docs/Qyl.OpenTelemetry.SemanticConventions.Analyzers.md#qyl0031) | Warning | Exact replacements only | Supplemental catalog context-sensitive, manual-review, removed/no-replacement, or ambiguous payload migration |
-| [`QYL0032`](docs/Qyl.OpenTelemetry.SemanticConventions.Analyzers.md#qyl0032) | Info | Exact replacements only | Supplemental catalog item appears in test, fixture, compatibility, generated, translator, or catalog context |
+| [`QYL0031`](docs/Qyl.OpenTelemetry.SemanticConventions.Analyzers.md#qyl0031) | Warning | No | Supplemental catalog context-sensitive, manual-review, removed/no-replacement, or ambiguous payload migration |
+| [`QYL0032`](docs/Qyl.OpenTelemetry.SemanticConventions.Analyzers.md#qyl0032) | Info | No | Supplemental catalog item appears in test, fixture, compatibility, generated, translator, or catalog context |
@@
-- **Generated docs and audit.** Regenerate the package catalog with `scripts/generate-docs.sh generate`; validate with `scripts/generate-docs.sh validate`; print the current 156-entry coverage audit with `scripts/generate-docs.sh audit`.
+- **Generated docs and audit.** Regenerate with `scripts/generate-docs.sh generate`; validate with `scripts/generate-docs.sh validate`; print the current coverage audit with `scripts/generate-docs.sh audit`.
@@
-<ProjectReference Include="path/to/src/Qyl.OpenTelemetry.SemanticConventions.Analyzers/Qyl.OpenTelemetry.SemanticConventions.Analyzers.csproj"
+<ProjectReference Include="path/to/src/ANcpLua.OpenTelemetry.SemanticConventions.Analyzers/ANcpLua.OpenTelemetry.SemanticConventions.Analyzers.csproj"
OutputItemType="Analyzer"
ReferenceOutputAssembly="false" />
@@
-dotnet test tests/Qyl.OpenTelemetry.SemanticConventions.Analyzers.Tests/Qyl.OpenTelemetry.SemanticConventions.Analyzers.Tests.csproj -c Release
+dotnet test tests/ANcpLua.OpenTelemetry.SemanticConventions.Analyzers.Tests/ANcpLua.OpenTelemetry.SemanticConventions.Analyzers.Tests.csproj -c Release
*** a/tools/ANcpLua.OpenTelemetry.SemanticConventions.Analyzers.DocsGenerator/Program.cs
--- b/tools/ANcpLua.OpenTelemetry.SemanticConventions.Analyzers.DocsGenerator/Program.cs
@@
- private const string PackageName = "Qyl.OpenTelemetry.SemanticConventions.Analyzers";
- private const string ProjectRelativePath = "tools/" + PackageName + ".DocsGenerator";
+ private const string PackageName = "Qyl.OpenTelemetry.SemanticConventions.Analyzers";
+ // Match current repo layout
+ private const string ProjectRelativePath = "tools/ANcpLua.OpenTelemetry.SemanticConventions.Analyzers.DocsGenerator";
@@
- var codeFix = fixableIds.Contains(d.Id)
- ? d.Id is "QYL0030" or "QYL0031" or "QYL0032" ? "Exact replacements only" : "Yes"
- : "No";
+ var codeFix = fixableIds.Contains(d.Id)
+ ? (d.Id is "QYL0030" ? "Exact replacements only" : "Yes")
+ : "No";
@@
- var codeFix = fixableIds.Contains(d.Id)
- ? d.Id is "QYL0030" or "QYL0031" or "QYL0032" ? "Exact replacements only." : "Yes."
- : "No.";
+ var codeFix = fixableIds.Contains(d.Id)
+ ? (d.Id is "QYL0030" ? "Exact replacements only." : "Yes.")
+ : "No.";
*** a/src/ANcpLua.OpenTelemetry.SemanticConventions.Analyzers/DiagnosticDescriptors.cs
--- b/src/ANcpLua.OpenTelemetry.SemanticConventions.Analyzers/DiagnosticDescriptors.cs
@@
- private const string HelpLinkBase = "https://github.com/ANcpLua/ANcpLua.OpenTelemetry.SemanticConventions.Analyzers"
- + "/blob/main/docs/ANcpLua.OpenTelemetry.SemanticConventions.Analyzers.md#";
+ private const string HelpLinkBase = "https://github.com/ANcpLua/ANcpLua.OpenTelemetry.SemanticConventions.Analyzers"
+ + "/blob/main/docs/Qyl.OpenTelemetry.SemanticConventions.Analyzers.md#";
*** a/scripts/regen-supplemental-catalog.csx
--- b/scripts/regen-supplemental-catalog.csx
@@
- if (File.Exists(Path.Combine(dir.FullName, "ANcpLua.OpenTelemetry.SemanticConventions.Analyzers.slnx")))
+ var hasSln =
+ File.Exists(Path.Combine(dir.FullName, "Qyl.OpenTelemetry.SemanticConventions.Analyzers.slnx")) ||
+ File.Exists(Path.Combine(dir.FullName, "ANcpLua.OpenTelemetry.SemanticConventions.Analyzers.slnx"));
+ var hasMarkers =
+ Directory.Exists(Path.Combine(dir.FullName, ".git")) &&
+ File.Exists(Path.Combine(dir.FullName, "scripts", ".upstream-semconv-version"));
+ if (hasSln || hasMarkers)
{
return dir.FullName;
}
@@
- catch (Exception ex)
- {
- Console.Error.WriteLine($"skipping {file}: {ex.Message}");
- return;
- }
+ catch (Exception ex)
+ {
+ throw new InvalidOperationException($"Failed to parse upstream model file: {file}", ex);
+ }
*** a/.github/workflows/weaver-roundtrip.yml
--- b/.github/workflows/weaver-roundtrip.yml
@@
- install -m 0755 "$RUNNER_TEMP/weaver/weaver" /usr/local/bin/weaver
- weaver --version
+ mkdir -p "$HOME/.local/bin"
+ install -m 0755 "$RUNNER_TEMP/weaver/weaver" "$HOME/.local/bin/weaver"
+ echo "$HOME/.local/bin" >> "$GITHUB_PATH"
+ weaver --version
*** a/src/ANcpLua.OpenTelemetry.SemanticConventions.Analyzers/LiveSemconvMetadataCodeFixProvider.cs
--- b/src/ANcpLua.OpenTelemetry.SemanticConventions.Analyzers/LiveSemconvMetadataCodeFixProvider.cs
@@
- public override ImmutableArray<string> FixableDiagnosticIds { get; } =
- ImmutableArray.Create("QYL0010", "QYL0012", "QYL0014");
+ private const string DeprecatedConstantId = "QYL0010";
+ public override ImmutableArray<string> FixableDiagnosticIds { get; } =
+ ImmutableArray.Create(DeprecatedConstantId, "QYL0012", "QYL0014");
@@
- if (diagnostic.Id == "QYL0010")
+ if (diagnostic.Id == DeprecatedConstantId)
Confirm which way you want to go; I’ll post the exact one‑liner for that file next. Once 1–5 (and 7 after you choose a version) are pushed, Codacy threads ts6EWqP5 and ts6EWqP7 stop blocking, and the Copilot/chatgpt items cited above are addressed. |
There was a problem hiding this comment.
💡 Codex Review
CodeFixResources.Designer still initializes ResourceManager with the old base name ANcpLua.Analyzers.CodeFixes.CodeFixResources, but the project now embeds the resource under Qyl.OpenTelemetry.SemanticConventions.Analyzers.CodeFixResources.resources (ANcpLua.OpenTelemetry.SemanticConventions.Analyzers.csproj). This base-name mismatch prevents loading the code-fix resource set at runtime, so code-fix title retrieval can fail before any localized string is returned.
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| @@ -51,1817 +51,1817 @@ internal static CultureInfo Culture { | |||
|
|
|||
| internal static string AL0001AnalyzerDescription { | |||
| get { | |||
| return ResourceManager.GetString("AL0001AnalyzerDescription", resourceCulture); | |||
| return ResourceManager.GetString("QYL0001AnalyzerDescription", resourceCulture); | |||
There was a problem hiding this comment.
Keep analyzer resource keys aligned with renamed IDs
Resources.Designer now looks up QYL*Analyzer* entries, but Resources.resx still defines those strings under AL*Analyzer* names. Since AlAnalyzer.CreateRule constructs localization keys from the new QYL IDs, these lookups miss for every AlAnalyzer-based rule, so diagnostic titles/messages/descriptions no longer resolve to the intended text at runtime.
Useful? React with 👍 / 👎.
| internal static string AL0002CodeFixTitle { | ||
| get { | ||
| return ResourceManager.GetString("AL0002CodeFixTitle", resourceCulture); | ||
| return ResourceManager.GetString("QYL0002CodeFixTitle", resourceCulture); |
There was a problem hiding this comment.
Restore code-fix resource key mapping
CodeFixResources.Designer was switched to QYL*CodeFixTitle lookup keys, but CodeFixResources.resx still stores the titles as AL*CodeFixTitle. As a result, code-fix title lookups for existing providers resolve to missing keys instead of the configured strings, degrading or breaking code-action presentation for affected diagnostics.
Useful? React with 👍 / 👎.
Triage Bot report
Threads marked |
|
To use Codex here, create an environment for this repo. |
Triage Bot report
Threads marked |
|
To use Codex here, create an environment for this repo. |
|
Tip For best results, initiate chat on the files or code changes.
Prioritize the two Codacy blockers and the remaining spec-drift that can silently mislead consumers. Minimal, surgical diffs below. Immediate (blocks merge)
--- a/README.md
+++ b/README.md
@@
-<PackageReference Include="Qyl.OpenTelemetry.SemanticConventions.Analyzers"
- Version="..."
- PrivateAssets="all"
- IncludeAssets="runtime; build; native; contentfiles; analyzers; buildtransitive" />
+<PackageReference Include="Qyl.OpenTelemetry.SemanticConventions.Analyzers"
+ Version="..."
+ PrivateAssets="all"
+ IncludeAssets="analyzers; buildtransitive" />
--- a/README.md
+++ b/README.md
@@
-| [`QYL0031`](docs/Qyl.OpenTelemetry.SemanticConventions.Analyzers.md#qyl0031) | Warning | Exact replacements only | Supplemental catalog context-sensitive, manual-review, removed/no-replacement, or ambiguous payload migration |
-| [`QYL0032`](docs/Qyl.OpenTelemetry.SemanticConventions.Analyzers.md#qyl0032) | Info | Exact replacements only | Supplemental catalog item appears in test, fixture, compatibility, generated, translator, or catalog context |
+| [`QYL0031`](docs/Qyl.OpenTelemetry.SemanticConventions.Analyzers.md#qyl0031) | Warning | No | Supplemental catalog context-sensitive, manual-review, removed/no-replacement, or ambiguous payload migration |
+| [`QYL0032`](docs/Qyl.OpenTelemetry.SemanticConventions.Analyzers.md#qyl0032) | Info | No | Supplemental catalog item appears in test, fixture, compatibility, generated, translator, or catalog context |Close-the-loop drift fixes (correctness; cheap to apply)
--- a/README.md
+++ b/README.md
@@
-- **Generated docs and audit.** Regenerate the package catalog with `scripts/generate-docs.sh generate`; validate with `scripts/generate-docs.sh validate`; print the current 156-entry coverage audit with `scripts/generate-docs.sh audit`.
+- **Generated docs and audit.** Regenerate with `scripts/generate-docs.sh generate`; validate with `scripts/generate-docs.sh validate`; print the current coverage audit with `scripts/generate-docs.sh audit`.
@@ (paths reflect current tree on this branch)
-<ProjectReference Include="path/to/src/Qyl.OpenTelemetry.SemanticConventions.Analyzers/Qyl.OpenTelemetry.SemanticConventions.Analyzers.csproj"
+<ProjectReference Include="path/to/src/ANcpLua.OpenTelemetry.SemanticConventions.Analyzers/ANcpLua.OpenTelemetry.SemanticConventions.Analyzers.csproj"
OutputItemType="Analyzer"
ReferenceOutputAssembly="false" />
@@
-dotnet test tests/Qyl.OpenTelemetry.SemanticConventions.Analyzers.Tests/Qyl.OpenTelemetry.SemanticConventions.Analyzers.Tests.csproj -c Release
+dotnet test tests/ANcpLua.OpenTelemetry.SemanticConventions.Analyzers.Tests/ANcpLua.OpenTelemetry.SemanticConventions.Analyzers.Tests.csproj -c Release
--- a/README.md
+++ b/README.md
@@
-This package ships under the `ANcpLua.*` package ID …
+This package ships under the `Qyl.*` package ID …
--- a/src/ANcpLua.OpenTelemetry.SemanticConventions.Analyzers/DiagnosticDescriptors.cs
+++ b/src/ANcpLua.OpenTelemetry.SemanticConventions.Analyzers/DiagnosticDescriptors.cs
@@
- private const string HelpLinkBase = "https://github.com/ANcpLua/ANcpLua.OpenTelemetry.SemanticConventions.Analyzers"
- + "/blob/main/docs/ANcpLua.OpenTelemetry.SemanticConventions.Analyzers.md#";
+ private const string HelpLinkBase = "https://github.com/ANcpLua/ANcpLua.OpenTelemetry.SemanticConventions.Analyzers"
+ + "/blob/main/docs/Qyl.OpenTelemetry.SemanticConventions.Analyzers.md#";
--- a/scripts/regen-supplemental-catalog.csx
+++ b/scripts/regen-supplemental-catalog.csx
@@
- if (File.Exists(Path.Combine(dir.FullName, "ANcpLua.OpenTelemetry.SemanticConventions.Analyzers.slnx")))
+ var hasSln =
+ File.Exists(Path.Combine(dir.FullName, "Qyl.OpenTelemetry.SemanticConventions.Analyzers.slnx")) ||
+ File.Exists(Path.Combine(dir.FullName, "ANcpLua.OpenTelemetry.SemanticConventions.Analyzers.slnx"));
+ var hasMarkers =
+ Directory.Exists(Path.Combine(dir.FullName, ".git")) &&
+ File.Exists(Path.Combine(dir.FullName, "scripts", ".upstream-semconv-version"));
+ if (hasSln || hasMarkers)
{
return dir.FullName;
}
@@
- catch (Exception ex)
- {
- Console.Error.WriteLine($"skipping {file}: {ex.Message}");
- return;
- }
+ catch (Exception ex)
+ {
+ throw new InvalidOperationException($"Failed to parse upstream model file: {file}", ex);
+ }
--- a/.github/workflows/weaver-roundtrip.yml
+++ b/.github/workflows/weaver-roundtrip.yml
@@
- install -m 0755 "$RUNNER_TEMP/weaver/weaver" /usr/local/bin/weaver
- weaver --version
+ mkdir -p "$HOME/.local/bin"
+ install -m 0755 "$RUNNER_TEMP/weaver/weaver" "$HOME/.local/bin/weaver"
+ echo "$HOME/.local/bin" >> "$GITHUB_PATH"
+ weaver --versionKeep docs in sync with README
--- a/tools/ANcpLua.OpenTelemetry.SemanticConventions.Analyzers.DocsGenerator/Program.cs
+++ b/tools/ANcpLua.OpenTelemetry.SemanticConventions.Analyzers.DocsGenerator/Program.cs
@@
- var codeFix = fixableIds.Contains(d.Id)
- ? d.Id is "QYL0030" or "QYL0031" or "QYL0032" ? "Exact replacements only" : "Yes"
- : "No";
+ var codeFix = fixableIds.Contains(d.Id)
+ ? (d.Id is "QYL0030" ? "Exact replacements only" : "Yes")
+ : "No";
@@
- var codeFix = fixableIds.Contains(d.Id)
- ? d.Id is "QYL0030" or "QYL0031" or "QYL0032" ? "Exact replacements only." : "Yes."
- : "No.";
+ var codeFix = fixableIds.Contains(d.Id)
+ ? (d.Id is "QYL0030" ? "Exact replacements only." : "Yes.")
+ : "No.";Optional but removes future foot‑guns
--- a/src/ANcpLua.OpenTelemetry.SemanticConventions.Analyzers/LiveSemconvMetadataCodeFixProvider.cs
+++ b/src/ANcpLua.OpenTelemetry.SemanticConventions.Analyzers/LiveSemconvMetadataCodeFixProvider.cs
@@
- public override ImmutableArray<string> FixableDiagnosticIds { get; } =
- ImmutableArray.Create("QYL0010", "QYL0012", "QYL0014");
+ private const string DeprecatedConstantId = "QYL0010";
+ public override ImmutableArray<string> FixableDiagnosticIds { get; } =
+ ImmutableArray.Create(DeprecatedConstantId, "QYL0012", "QYL0014");
@@
- if (diagnostic.Id == "QYL0010")
+ if (diagnostic.Id == DeprecatedConstantId)
--- a/src/ANcpLua.OpenTelemetry.SemanticConventions.Analyzers/ANcpLua.OpenTelemetry.SemanticConventions.Analyzers.csproj
+++ b/src/ANcpLua.OpenTelemetry.SemanticConventions.Analyzers/ANcpLua.OpenTelemetry.SemanticConventions.Analyzers.csproj
@@
- <RootNamespace>OpenTelemetry.SemanticConventions.Analyzers</RootNamespace>
- <AssemblyName>OpenTelemetry.SemanticConventions.Analyzers</AssemblyName>
+ <RootNamespace>Qyl.OpenTelemetry.SemanticConventions.Analyzers</RootNamespace>
+ <AssemblyName>Qyl.OpenTelemetry.SemanticConventions.Analyzers</AssemblyName>One decision needed
After you push the README and (2) generator label fix, I can resolve the two Codacy threads. If you prefer to treat pinning (tool versions, workflow concurrency, action SHA pinning) as a separate hygiene PR, say so and I’ll open a follow‑up issue. |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: Length of output: 25508
Status at PR head a0bad40. The items below are the ones that still matter for correctness, consumer safety, or spec drift. Each has a surgical diff. Fix now (blocks or creates drift)
--- a/README.md
+++ b/README.md
@@
- <PackageReference Include="Qyl.OpenTelemetry.SemanticConventions.Analyzers"
- Version="..."
- PrivateAssets="all"
- IncludeAssets="runtime; build; native; contentfiles; analyzers; buildtransitive" />
+ <PackageReference Include="Qyl.OpenTelemetry.SemanticConventions.Analyzers"
+ Version="..."
+ PrivateAssets="all"
+ IncludeAssets="analyzers; buildtransitive" />
--- a/README.md
+++ b/README.md
@@
-| [`QYL0031`](docs/Qyl.OpenTelemetry.SemanticConventions.Analyzers.md#qyl0031) | Warning | Exact replacements only | Supplemental catalog context-sensitive, manual-review, removed/no-replacement, or ambiguous payload migration |
-| [`QYL0032`](docs/Qyl.OpenTelemetry.SemanticConventions.Analyzers.md#qyl0032) | Info | Exact replacements only | Supplemental catalog item appears in test, fixture, compatibility, generated, translator, or catalog context |
+| [`QYL0031`](docs/Qyl.OpenTelemetry.SemanticConventions.Analyzers.md#qyl0031) | Warning | No | Supplemental catalog context-sensitive, manual-review, removed/no-replacement, or ambiguous payload migration |
+| [`QYL0032`](docs/Qyl.OpenTelemetry.SemanticConventions.Analyzers.md#qyl0032) | Info | No | Supplemental catalog item appears in test, fixture, compatibility, generated, translator, or catalog context |
--- a/README.md
+++ b/README.md
@@
-- **Generated docs and audit.** Regenerate the package catalog with `scripts/generate-docs.sh generate`; validate with `scripts/generate-docs.sh validate`; print the current 156-entry coverage audit with `scripts/generate-docs.sh audit`. Every `QYL*` rule has a stable `#qyl0010` anchor in the generated docs that every `DiagnosticDescriptor.HelpLinkUri` resolves to.
+- **Generated docs and audit.** Regenerate with `scripts/generate-docs.sh generate`; validate with `scripts/generate-docs.sh validate`; print the current coverage audit with `scripts/generate-docs.sh audit`. Every `QYL*` rule has a stable `#qyl0010` anchor in the generated docs that every `DiagnosticDescriptor.HelpLinkUri` resolves to.
--- a/README.md
+++ b/README.md
@@
-This repository is the incubation home for what may eventually be proposed as an official `OpenTelemetry.SemanticConventions.Analyzers` companion to `opentelemetry-dotnet-contrib`. While here, it ships under the `ANcpLua.*` package ID and Apache-2.0 license.
+This repository is the incubation home for what may eventually be proposed as an official `OpenTelemetry.SemanticConventions.Analyzers` companion to `opentelemetry-dotnet-contrib`. While here, it ships under the `Qyl.*` package ID and Apache-2.0 license.
--- a/.github/workflows/weaver-roundtrip.yml
+++ b/.github/workflows/weaver-roundtrip.yml
@@
- install -m 0755 "$RUNNER_TEMP/weaver/weaver" /usr/local/bin/weaver
- weaver --version
+ mkdir -p "$HOME/.local/bin"
+ install -m 0755 "$RUNNER_TEMP/weaver/weaver" "$HOME/.local/bin/weaver"
+ echo "$HOME/.local/bin" >> "$GITHUB_PATH"
+ weaver --version
Representative hunks (apply to all listed files in your scan): --- a/tests/.../Imports/QYL0090UncompressedExportTests.cs
+++ b/tests/.../Imports/QYL0090UncompressedExportTests.cs
-using Qyl.OpenTelemetry.SemanticConventions.Analyzers.Analyzers;
+using Qyl.OpenTelemetry.SemanticConventions.Analyzers;--- a/tests/.../Imports/QYL0124NonInterceptableAgentTracedTests.cs
+++ b/tests/.../Imports/QYL0124NonInterceptableAgentTracedTests.cs
-using Qyl.OpenTelemetry.SemanticConventions.Analyzers.Analyzers;
-using Qyl.OpenTelemetry.SemanticConventions.Analyzers.CodeFixes.CodeFixes;
+using Qyl.OpenTelemetry.SemanticConventions.Analyzers;
+using Qyl.OpenTelemetry.SemanticConventions.Analyzers.CodeFixes;
--- a/tools/ANcpLua.OpenTelemetry.SemanticConventions.Analyzers.DocsGenerator/Program.cs
+++ b/tools/ANcpLua.OpenTelemetry.SemanticConventions.Analyzers.DocsGenerator/Program.cs
@@
- sb.AppendLine($"| Keep attribute-value fallback separate from the curated name/key/event/metric count | `{stats.ValueEntries.Length}` supplemental attribute-value rows are outside the 156-entry inventory and are used only when live value metadata is absent. |");
+ sb.AppendLine($"| Keep attribute-value fallback separate from the curated name/key/event/metric count | `{stats.ValueEntries.Length}` supplemental attribute-value rows are tracked separately from the curated inventory and are used only when live value metadata is absent. |");Keep or improve (non-blocking hardening; do in this PR if you want it closed cleanly)
--- a/scripts/regen-supplemental-catalog.csx
+++ b/scripts/regen-supplemental-catalog.csx
@@
static string FindRepoRoot()
{
var dir = new DirectoryInfo(Directory.GetCurrentDirectory());
while (dir is not null)
{
- // existing check(s)
+ var hasSln =
+ File.Exists(Path.Combine(dir.FullName, "Qyl.OpenTelemetry.SemanticConventions.Analyzers.slnx")) ||
+ File.Exists(Path.Combine(dir.FullName, "ANcpLua.OpenTelemetry.SemanticConventions.Analyzers.slnx"));
+ var hasMarkers =
+ Directory.Exists(Path.Combine(dir.FullName, ".git")) &&
+ File.Exists(Path.Combine(dir.FullName, "scripts", ".upstream-semconv-version"));
+ if (hasSln || hasMarkers)
+ return dir.FullName;
dir = dir.Parent;
}
throw new InvalidOperationException("Could not find repository root.");
}Confirmed resolved/stale (mark the threads accordingly)
If you want me to file a follow‑up issue for CI determinism (pin dotnet-script version; add workflow concurrency; set checkout persist-credentials: false), say so and I’ll open it against this repo with backlinks to this PR and your comment.
✏️ Learnings added
The requested changes have been implemented and a pull request has been created: View PR |
|
Tip For best results, initiate chat on the files or code changes.
To unblock merge, make these minimal, high‑impact edits. They map 1:1 to the open threads and remove drift/silent failure modes.
-<PackageReference Include="Qyl.OpenTelemetry.SemanticConventions.Analyzers"
- Version="..."
- PrivateAssets="all"
- IncludeAssets="runtime; build; native; contentfiles; analyzers; buildtransitive" />
+<PackageReference Include="Qyl.OpenTelemetry.SemanticConventions.Analyzers"
+ Version="..."
+ PrivateAssets="all"
+ IncludeAssets="analyzers; buildtransitive" />
-| [0031 …] | Warning | Exact replacements only | …
-| [0032 …] | Info | Exact replacements only | …
+| [0031 …] | Warning | No | …
+| [0032 …] | Info | No | …(use whatever ID scheme is in the table; the fix is the “Code fix” cell → “No” for both 0031 and 0032)
- + "/blob/main/docs/ANcpLua.OpenTelemetry.SemanticConventions.Analyzers.md#";
+ + "/blob/main/docs/Qyl.OpenTelemetry.SemanticConventions.Analyzers.md#";
static string FindRepoRoot()
{
var dir = new DirectoryInfo(Directory.GetCurrentDirectory());
while (dir is not null)
{
- if (File.Exists(Path.Combine(dir.FullName, "ANcpLua.OpenTelemetry.SemanticConventions.Analyzers.slnx")))
+ var hasSln =
+ File.Exists(Path.Combine(dir.FullName, "Qyl.OpenTelemetry.SemanticConventions.Analyzers.slnx")) ||
+ File.Exists(Path.Combine(dir.FullName, "ANcpLua.OpenTelemetry.SemanticConventions.Analyzers.slnx"));
+ var hasMarkers =
+ Directory.Exists(Path.Combine(dir.FullName, ".git")) &&
+ File.Exists(Path.Combine(dir.FullName, "scripts", ".upstream-semconv-version"));
+ if (hasSln || hasMarkers)
return dir.FullName;
dir = dir.Parent;
}
throw new InvalidOperationException("Could not find repository root.");
}
@@
- try { stream.Load(reader); }
- catch (Exception ex) { Console.Error.WriteLine($"skipping {file}: {ex.Message}"); return; }
+ try { stream.Load(reader); }
+ catch (Exception ex) { throw new InvalidOperationException($"Failed to parse upstream model file: {file}", ex); }
-<ProjectReference Include="path/to/src/Qyl.OpenTelemetry.SemanticConventions.Analyzers/Qyl.OpenTelemetry.SemanticConventions.Analyzers.csproj"
+<ProjectReference Include="path/to/src/ANcpLua.OpenTelemetry.SemanticConventions.Analyzers/ANcpLua.OpenTelemetry.SemanticConventions.Analyzers.csproj"
OutputItemType="Analyzer"
ReferenceOutputAssembly="false" />
@@
-dotnet test tests/Qyl.OpenTelemetry.SemanticConventions.Analyzers.Tests/Qyl.OpenTelemetry.SemanticConventions.Analyzers.Tests.csproj
+dotnet test tests/ANcpLua.OpenTelemetry.SemanticConventions.Analyzers.Tests/ANcpLua.OpenTelemetry.SemanticConventions.Analyzers.Tests.csproj
-… ships under the `ANcpLua.*` package ID …
+… ships under the `Qyl.*` package ID …
- install -m 0755 "$RUNNER_TEMP/weaver/weaver" /usr/local/bin/weaver
- weaver --version
+ mkdir -p "$HOME/.local/bin"
+ install -m 0755 "$RUNNER_TEMP/weaver/weaver" "$HOME/.local/bin/weaver"
+ echo "$HOME/.local/bin" >> "$GITHUB_PATH"
+ weaver --version
- var codeFix = fixableIds.Contains(d.Id)
- ? d.Id is "QYL0030" or "QYL0031" or "QYL0032" ? "Exact replacements only" : "Yes"
- : "No";
+ var codeFix = fixableIds.Contains(d.Id)
+ ? (d.Id is "QYL0030" ? "Exact replacements only" : "Yes")
+ : "No";(Apply same change where the per‑rule section repeats the label.)
-<RootNamespace>OpenTelemetry.SemanticConventions.Analyzers</RootNamespace>
-<AssemblyName>OpenTelemetry.SemanticConventions.Analyzers</AssemblyName>
+<RootNamespace>Qyl.OpenTelemetry.SemanticConventions.Analyzers</RootNamespace>
+<AssemblyName>Qyl.OpenTelemetry.SemanticConventions.Analyzers</AssemblyName>
Tell me which direction you want; I’ll provide the one‑liner for the second file accordingly. Optional hygiene (non‑blocking; ask if you want a follow‑up issue)
Reply once these edits are pushed; I’ll sweep and resolve the two Codacy threads (ts6EWqP5, ts6EWqP7) and mark any stale ones accordingly. |
Summary
Validation
dotnet build ANcpLua.OpenTelemetry.SemanticConventions.Analyzers.slnx -c Releasedotnet test tests/ANcpLua.OpenTelemetry.SemanticConventions.Analyzers.Tests/ANcpLua.OpenTelemetry.SemanticConventions.Analyzers.Tests.csprojscripts/generate-docs.sh validatescripts/generate-docs.sh auditgit diff --checkNotes
dotnet test --project ...fails with the installed .NET SDK because--projectis passed through as an MSBuild switch, so the README documents the working project-path form.