Skip to content

ci(publish): grep -qFx + parenthesize publish if - #87

Merged
ANcpLua merged 2 commits into
mainfrom
ci-grep-paren-fix
May 4, 2026
Merged

ci(publish): grep -qFx + parenthesize publish if#87
ANcpLua merged 2 commits into
mainfrom
ci-grep-paren-fix

Conversation

@ANcpLua

@ANcpLua ANcpLua commented May 4, 2026

Copy link
Copy Markdown
Owner

Summary

Two zero-risk readability/robustness tweaks on the auto-bump workflow merged in #86:

  1. `grep -qFx` instead of `grep -qx` — `-F` makes the pattern a literal string. `-x` only anchors the line, but the pattern is still a regex; if a tag ever contains a literal `.` or `*` it could match wrong things. Tags follow `vX.Y.Z` today so it's defensive only.
  2. `(push && main) || dispatch` — parentheses make the precedence explicit. YAML expression already evaluated in this order; no behavior change.

Test plan

  • Workflow YAML still parses (no structural change)
  • No effect on a docs-only PR like this one (gate skips publish)

🤖 Generated with Claude Code

ANcpLua and others added 2 commits May 4, 2026 14:59
Add .github/copilot-instructions.md scoping Copilot Code Review to the
five-package shape: netstandard2.0 surface constraints (no System.Text.Json
or modern BCL in main lib / Sources), Sources visibility-rewrite invariant
(#if ANCPLUA_ROSLYN_PUBLIC), generator hot-path patterns (ref structs,
EquatableArray<T>, closure-free dict ops), Guard.cs as the sole RS1035
allow-list site.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…tion if

Two zero-risk readability/robustness tweaks on the auto-bump workflow:
- grep -qFx (literal-string match) instead of grep -qx — avoids regex
  metachar surprises if a tag ever contains a literal . or *
- (push && main) || dispatch — parens make the precedence explicit
  (no behavior change; YAML expression already evaluated in this order)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings May 4, 2026 13:00
@ANcpLua
ANcpLua enabled auto-merge (squash) May 4, 2026 13:00
@coderabbitai

coderabbitai Bot commented May 4, 2026

Copy link
Copy Markdown

Caution

Review failed

Pull request was closed or merged during review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: f7c1ca9b-6273-4d08-8cb3-8e354ebfacb0

📥 Commits

Reviewing files that changed from the base of the PR and between 6491011 and eaa8194.

📒 Files selected for processing (2)
  • .github/copilot-instructions.md
  • .github/workflows/nuget-publish.yml
📜 Recent review details
⏰ Context from checks skipped due to timeout of 120000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Upload results
  • GitHub Check: build (windows-latest)
🧰 Additional context used
📓 Path-based instructions (1)
.github/**

⚙️ CodeRabbit configuration file

GitHub Actions workflows. Review for: action version pinning (use SHA not tags for third-party actions), proper secret handling (no secrets in logs, use GITHUB_TOKEN where possible), unnecessary workflow triggers, and job dependency correctness. Flag missing concurrency groups on push-triggered workflows. Ensure matrix strategies cover the supported .NET TFMs.

Files:

  • .github/copilot-instructions.md
  • .github/workflows/nuget-publish.yml
🧠 Learnings (1)
📓 Common learnings
Learnt from: CR
Repo: ANcpLua/ANcpLua.Roslyn.Utilities

Timestamp: 2026-05-04T13:00:33.863Z
Learning: The `Sources` package is for source generators that cannot take a binary reference — code intended for that consumer set should live in `src/ANcpLua.Roslyn.Utilities/` and be exposed via Sources on pack
Learnt from: CR
Repo: ANcpLua/ANcpLua.Roslyn.Utilities

Timestamp: 2026-05-04T13:00:33.863Z
Learning: Breaking changes are allowed in the same session — bump major version, fix consumers, and ship. Do not suggest backwards-compat shims or feature flags within a single PR
🔇 Additional comments (3)
.github/workflows/nuget-publish.yml (2)

52-52: Good change: use fixed-string exact matching here.

grep -qFx is the right choice for tag reuse checks when the tag content should be treated literally.


119-119: Good change: make the publish gate precedence explicit.

The parenthesized condition reads clearly and preserves the intended behavior.

.github/copilot-instructions.md (1)

1-69: No blocking concerns in this documentation change.

The instruction set is coherent and aligns with the repo’s Sources/netstandard2.0 constraints.

Based on learnings: "The Sources package is for source generators that cannot take a binary reference — code intended for that consumer set should live in src/ANcpLua.Roslyn.Utilities/ and be exposed via Sources on pack".


Summary by CodeRabbit

  • Chores
    • Updated internal CI/CD workflow configuration for improved build process reliability.
    • Added development guidelines for code review automation.

Note: This release contains no user-facing changes.

Walkthrough

Two independent infrastructure changes: a new Copilot review guidance document for PR reviews, and minor NuGet publish workflow refinements to version detection and job gating.

Changes

Copilot PR Review Instructions

Layer / File(s) Summary
Documentation
.github/copilot-instructions.md
New guidance document prescribing allowed API patterns, conditional visibility guards, Roslyn keying semantics, allocation/closure avoidance in hot paths, and equality behavior across main, Sources, Polyfills, Testing, and EquatableArray<T> surfaces.

NuGet Publish Workflow

Layer / File(s) Summary
Version Detection
.github/workflows/nuget-publish.yml
grep -qx changes to grep -qFx in the version step, switching from regex-based to fixed-string exact matching when checking if LATEST_TAG points at HEAD.
Job Gating
.github/workflows/nuget-publish.yml
publish job if: condition rewritten with explicit parentheses: (github.event_name == 'push' && github.ref == 'refs/heads/main') || github.event_name == 'workflow_dispatch'.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested labels

area:infra

🚥 Pre-merge checks | ✅ 8
✅ Passed checks (8 passed)
Check name Status Explanation
Title check ✅ Passed Title follows conventional commits format with ci area prefix and clear scope (publish), is 48 characters under the 72-character limit, and accurately describes both core changes.
Description check ✅ Passed Description directly relates to the changeset, explaining the two workflow modifications with test validation and risk assessment.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Otel Instrumentation Required ✅ Passed PR adds abstract test harnesses implementing xUnit interfaces, not injectable services; these fall outside OTel instrumentation scope.
No Unbounded Mcp Responses ✅ Passed PR modifies only .github/copilot-instructions.md and .github/workflows/nuget-publish.yml with no MCP tool changes detected.
Duckdb Backpressure On Write Paths ✅ Passed PR modifies only Copilot review guidance and GitHub Actions CI workflow with no DuckDB integration; backpressure check not applicable.
Cancellationtoken Threading ✅ Passed PR modifies only configuration and documentation files (.github/copilot-instructions.md and .github/workflows/nuget-publish.yml) with no changes to C# source files, so CancellationToken threading requirement does not apply.

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


Review rate limit: 4/5 reviews remaining, refill in 12 minutes.

Comment @coderabbitai help to get the list of available commands and usage tips.

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.

Pull request overview

This PR makes two small, defensive updates to the NuGet publish workflow and adds repository-specific Copilot PR review guidance. In the broader codebase, the workflow change improves clarity and matching robustness in the auto-publish path introduced in #86.

Changes:

  • Switched grep -qx to grep -qFx when checking whether HEAD already has the latest tag, avoiding unintended regex interpretation.
  • Parenthesized the publish job condition to make the intended (push && main) || dispatch precedence explicit.
  • Added .github/copilot-instructions.md with repository-specific PR review guidance and project context.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
.github/workflows/nuget-publish.yml Tightens tag matching and clarifies the publish-job condition without changing intended workflow behavior.
.github/copilot-instructions.md Adds repo-specific Copilot review instructions, package/context notes, and review heuristics.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

This pull request adds a .github/copilot-instructions.md file containing project-specific guidelines for AI code reviews. The feedback identifies a mismatch between the PR metadata and the actual changes, a versioning error regarding .NET 10, and technical inaccuracies in the descriptions of Span<T> and EquatableArray<T>.

@@ -0,0 +1,68 @@
# Copilot PR-review instructions for ANcpLua.Roslyn.Utilities

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

The Pull Request title and description do not match the changes provided in this patch. The title and summary describe CI workflow updates (specifically grep flags and YAML expression parentheses), but the actual change is the addition of a Copilot instructions markdown file. This discrepancy should be resolved to ensure the PR metadata accurately reflects its contents.

package (rewritten to `internal` at pack via `Transform-Sources.ps1`), `Polyfills`,
`Testing` (analyzer/generator/codefix harness), and `Testing.Aot`. Main library +
`Sources` target `netstandard2.0` so Roslyn-hosted consumers can absorb them;
`Testing` targets `net10.0`. `TreatWarningsAsErrors=true` repo-wide; all analyzer

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The text refers to net10.0 as a target framework. As of the current release cycle, .NET 9 is the latest version, and .NET 10 is not yet available. This is likely a typo for net8.0 or net9.0. This also appears on line 60.

- Storing `ISymbol`, `SyntaxNode`, `SyntaxTree`, or any Roslyn reference type as
a `HashSet<T>` / `Dictionary<TKey, …>` key — reference equality, cache misses
on rebuild, breaks generator incrementality.
- New allocations in generator hot paths: `.ToArray()` / `.ToList()` on a `Span`

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The Span<T> type does not have a .ToList() extension method in the standard .NET BCL. If the intent is to flag heap allocations from converting a span to a collection, .ToArray() is the correct method. If you intended to cover general collection allocations, consider clarifying the types involved.

Suggested change
- New allocations in generator hot paths: `.ToArray()` / `.ToList()` on a `Span`
- New allocations in generator hot paths: .ToArray() on a Span

the main library.
- `Testing` ships a fluent generator/analyzer/codefix harness. New test helpers
belong there, not in individual consumer test projects.
- `EquatableArray<T>` is `ref`-struct-like (value-equality wrapper); use it for

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

EquatableArray<T> is a regular readonly struct, not a ref struct. Describing it as "ref-struct-like" is technically inaccurate and potentially misleading for an AI reviewer, especially since ref struct types cannot be used as fields in records (which the following line explicitly recommends). It is better described as a "value-type wrapper" or as having "value semantics".

Suggested change
- `EquatableArray<T>` is `ref`-struct-like (value-equality wrapper); use it for
- EquatableArray<T> is a value-type wrapper (providing value equality); use it for

@ANcpLua
ANcpLua merged commit 103ecef into main May 4, 2026
17 of 18 checks passed
@ANcpLua
ANcpLua deleted the ci-grep-paren-fix branch May 4, 2026 13:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants