Skip to content

fix(abom): config-only .github has nothing to analyze; shortened-commit example links - #68

Open
data-douser wants to merge 3 commits into
mainfrom
abom/fixes-analysis-links/1
Open

data-douser wants to merge 3 commits into
mainfrom
abom/fixes-analysis-links/1

Conversation

@data-douser

@data-douser data-douser commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Purpose

Small fixes that stand on their own:

  • stop reporting a build failure for repositories with nothing to analyze;
  • accept example links the way GitHub writes them;
  • get the C# self-audit passing again.

Important changes

  • A .github holding only configuration is "nothing to analyze". Secret scanning, code scanning or Dependabot configuration alone no longer triggers a codeql database create that exits 32. "Actions content" now means what the actions extractor indexes by default.
  • Unborn default branch: the reason no longer includes git's raw fatal: text.
  • Shortened-commit example links resolve. A query-request example may name a commit by its first 7–40 hex digits, as GitHub's blob links do. uses: references are unaffected, since Actions refuses a shortened SHA there.
  • Run results keep the space between two sentences.
  • The C# self-audit passes again. It has been failing on main since .NET 11 shipped.
    • The unused Microsoft.AspNetCore.Components.WebAssembly.DevServer reference is dropped. Build-mode none fetched it again at its newest version, whose ASP.NET Core 11 assemblies left MudBlazor templates untyped.
    • _Imports.razor states @namespace Abom.WebAssembly, so CodeQL generates components in their real namespaces. The real build's output is unchanged.
    • The C# job installs .NET into a directory of its own, holding only the 10.0 SDK. CodeQL generates Razor with the newest SDK it finds, and the extractor compiles .NET 11's extra declaration files alongside the generated code, declaring every field twice.

Notes

…it example links

- A repository whose .github holds only secret scanning, code scanning
  or Dependabot configuration is "nothing to analyze" rather than a
  `codeql database create` that exits 32. Actions content is now what
  the actions extractor indexes by default (indexedByDefault), the same
  list code scanning reuse compares against.
- The "no commit on its default branch" reason no longer carries git's
  raw `fatal: You are on a branch yet to be born` text.
- A linked query-request example may name a commit by its first 7 to 40
  hex characters, as GitHub's blob view links one. The ref question
  asks `object(expression:)` after branch and tag; uses-ref polling does
  not, since Actions refuses a shortened SHA in `uses:`.
- Run results keep the space between two sentences Razor rendered
  joined ("octo/docs.Not covered").

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
data-douser and others added 2 commits November 22, 2026 18:02
The C# self-audit started failing on unchanged code in mid-November with
three findings in Razor components: identical values compared at
ActionVersions.razor:115 and two fields "missing" readonly in
DiscoveryControls.razor that are reassigned elsewhere.

Both are artifacts of the database, not of the code. Build-mode none
fetches every referenced package that has no compile assets again, at
its newest version, and takes the assemblies inside as references.
DevServer is such a package; its newest release now carries ASP.NET
Core 11 assemblies, which outranked the 10.0 ones the app and MudBlazor
build against. Template contexts went untyped, so `onLines.Analyzed`
and `onLines.Commits` both became accesses to an unknown member.

- Drop the DevServer reference. Nothing runs `dotnet run` or
  `dotnet watch`; `abom serve` hosts the published interface.
- State `@namespace Abom.WebAssembly` in _Imports.razor. CodeQL runs
  the Razor generator without the project file, so components landed in
  ASP.Shared and every `@using Abom.WebAssembly.*` failed; the real
  build's generated code is unchanged.

Reproduced with CodeQL 2.27.3 on Linux: 1,882 compiler errors and the
false positive before, 30 errors and no findings after.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
With the interface's own references fixed, the C# self-audit still
reported two missed readonly modifiers in DiscoveryControls.razor that
the code does not have. The 2026-11-16 runner image carries .NET SDK
11.0.100 beside 10.0.404, and build-mode none generates Razor components
with the newest SDK it finds. .NET 11's generator writes a
<Component>_razor.decl.g.cs beside each component holding the whole
@code block; the extractor compiles every file the generator wrote, so
each field is declared twice and the copy nothing binds to reads as
assigned only by its initializer.

setup-dotnet now installs into a directory of its own, holding only the
SDK the interface builds with. Reproduced on Linux with CodeQL 2.27.3:
10.0.404 and 11.0.100 together give the two findings; 10.0.404 alone
gives none. CodeQL 2.27.4 and 2.27.5 note no change here.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@data-douser data-douser self-assigned this Nov 23, 2026
@data-douser data-douser added enhancement New feature or request ql Related to CodeQL / QL plans, queries, tests, etc. labels Nov 23, 2026
@data-douser
data-douser marked this pull request as ready for review November 23, 2026 03:17
Copilot AI balanced review requested due to automatic review settings November 23, 2026 03:17

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Note

Copilot was unable to run its full agentic suite in this review.

Copilot review overview

4 open issues
What changed in this PR

This PR improves correctness and robustness around linked GitHub blob examples and CodeQL/Actions analysis edge cases, while also addressing UI text rendering and CodeQL build tooling quirks.

Changes:

  • Allow resolving GitHub blob links that use abbreviated commit SHAs (≥7 hex chars) by querying refs “as commit” when appropriate.
  • Tighten what counts as “Actions content” to match what the CodeQL Actions extractor indexes by default, preventing false failures for repos with only non-Actions YAML in .github/.
  • Fix Razor-rendered run summary spacing and adjust UI/CodeQL build configuration to avoid type-generation issues.
File Description
ui/​tests/​Abom.WebAssembly.Tests/​HeldResultsTests.cs Adds an assertion covering Razor whitespace concatenation behavior.
ui/​_Imports.razor Sets an explicit Razor namespace to keep CodeQL-generated components resolving @usings correctly.
ui/​Shared/​RunResults.razor Forces spacing between adjacent <span> elements in rendered run summaries.
ui/​Abom.WebAssembly.csproj Removes the DevServer package reference to avoid CodeQL/SDK assembly precedence issues.
internal/​serve/​requestexamples_test.go Adds test coverage for blob links that contain abbreviated commit SHAs.
internal/​serve/​requestexamples.go Ensures blob-link ref resolution is allowed to treat candidates as commits.
internal/​expand/​checkout_test.go Adds coverage for “Actions content” detection and improves the “no commit” error wording expectations.
internal/​expand/​checkout.go Aligns “Actions content” detection with extractor-indexed content and adjusts error wording for unborn branches.
internal/​catalog/​refs_test.go Extends the fake GraphQL server and adds tests for abbreviated commit resolution behavior.
internal/​catalog/​refs.go Implements OrCommit support, abbreviated-SHA detection, and commit fallback resolution in ref queries.
docs/​architecture.md Documents abbreviated-commit link behavior and the refined “Actions content” definition.
.github/​workflows/​self-audit.yml Pins the .NET install directory to avoid SDK/version mismatch issues during self-audit.

Review effort: Lite

Comment thread internal/catalog/refs.go
}

// abbreviated is a commit as a link may name it: seven hex digits or more.
var abbreviated = regexp.MustCompile(`^[0-9a-f]{7,40}$`)
Comment on lines +69 to +73
for _, c := range repo.commits {
if len(prefix) >= 7 && strings.HasPrefix(c, prefix) {
found = commitObject(c)
}
}
return nil
})
return found
files, _ := indexedByDefault(dir)
Comment on lines +15 to 20
<!-- No DevServer: `abom serve` hosts the interface. It has no compile assets, so CodeQL's
build-mode none fetched it again at its newest version, and that version's ASP.NET Core
assemblies outranked these and left every MudBlazor template untyped. -->
<ItemGroup>
<PackageReference Include="Markdig" Version="1.4.0" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="10.0.1" />

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request ql Related to CodeQL / QL plans, queries, tests, etc.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants