Skip to content

Add fix codemods for toolset typo and allowed-repos: current legacy alias - #50841

Merged
pelikhan merged 7 commits into
mainfrom
copilot/aw-compat-daily-audit
Aug 6, 2026
Merged

Add fix codemods for toolset typo and allowed-repos: current legacy alias#50841
pelikhan merged 7 commits into
mainfrom
copilot/aw-compat-daily-audit

Conversation

Copilot AI commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

The daily AW cross-repo compatibility audit found two low-risk, unambiguous migrations with no gh aw fix codemod: the toolset: (singular) typo under tools.github — for which the compiler already suggests "Did you mean 'toolsets'?" — and the legacy allowed-repos: current alias, which strict-mode rejects since only all, public, or ${{ github.repository }} are accepted.

Changes

  • toolset-singular-to-toolsets codemod (pkg/cli/codemod_toolset_singular.go): renames tools.github.toolset: to tools.github.toolsets:, scoped to the tools.github block, skipped if toolsets already present.
  • allowed-repos-current-to-github-repository codemod (pkg/cli/codemod_allowed_repos_current.go): rewrites tools.github.allowed-repos: current (quoted or unquoted) to allowed-repos: "${{ github.repository }}", preserving indentation and trailing comments.
  • Both registered in GetAllCodemods(); fix_codemods_test.go expected ID/order lists updated.
  • Unit tests added for each codemod covering rename/rewrite, no-op/idempotence, comment preservation, and edge cases (arrays, already-migrated values, embedded # in comments).

Example migration:

# before
tools:
  github:
    toolset: [repos, issues]
    allowed-repos: current

# after `gh aw fix --write`
tools:
  github:
    toolsets: [repos, issues]
    allowed-repos: "${{ github.repository }}"

Run: https://github.com/github/gh-aw/actions/runs/31113572782> Generated by 👨‍🍳 PR Sous Chef · gpt54 · 17.2 AIC · ⊞ 8.3K ·

Comment /souschef to run again

Copilot AI and others added 2 commits August 6, 2026 12:27
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix threat detection engine failure in daily compatibility audit Add fix codemods for toolset typo and allowed-repos: current legacy alias Aug 6, 2026
Copilot AI requested a review from pelikhan August 6, 2026 12:38
@pelikhan
pelikhan marked this pull request as ready for review August 6, 2026 12:40
Copilot AI balanced review requested due to automatic review settings August 6, 2026 12:40
@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Design Decision Gate 🏗️ completed the design decision gate check.

Warning

Threat Detection Engine Failure — The analysis engine could not complete. This is a tooling failure, not a security finding.

What happened

The threat detection engine failed to produce results.

Review the workflow run logs for details.

@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Test Quality Sentinel completed test quality analysis.

Warning

Threat Detection Engine Failure — The analysis engine could not complete. This is a tooling failure, not a security finding.

What happened

The threat detection engine failed to produce results.

Review the workflow run logs for details.

@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

PR Code Quality Reviewer completed the code quality review.

Warning

Threat Detection Engine Failure — The analysis engine could not complete. This is a tooling failure, not a security finding.

What happened

The threat detection engine failed to produce results.

Review the workflow run logs for details.

@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅

Warning

Threat Detection Engine Failure — The analysis engine could not complete. This is a tooling failure, not a security finding.

What happened

The threat detection engine failed to produce results.

Review the workflow run logs for details.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds two gh aw fix codemods for unambiguous GitHub tool configuration migrations.

Changes:

  • Renames singular toolset keys to toolsets.
  • Replaces allowed-repos: current with ${{ github.repository }}.
  • Registers and tests both codemods.
Show a summary per file
File Description
pkg/cli/fix_codemods.go Registers both codemods.
pkg/cli/fix_codemods_test.go Updates registry expectations.
pkg/cli/codemod_toolset_singular.go Implements the toolset rename.
pkg/cli/codemod_toolset_singular_test.go Tests singular-key migration.
pkg/cli/codemod_allowed_repos_current.go Implements legacy alias migration.
pkg/cli/codemod_allowed_repos_current_test.go Tests value rewriting and preservation.

Review details

Tip

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

Suppressed comments (2)

pkg/cli/codemod_toolset_singular.go:99

  • This block detector accepts any nested github: key below tools, not only the direct tools.github entry. For example, with a custom tool containing custom.github.toolset plus the real tools.github.toolset, this codemod renames both fields even though the precondition only inspected the real GitHub tool. Track the direct-child indentation (or use a YAML-node-aware transform) before entering the GitHub block so unrelated custom-tool configuration is never rewritten.
		if inTools && strings.HasPrefix(trimmed, "github:") {

pkg/cli/codemod_allowed_repos_current.go:104

  • This also enters any nested github: mapping under a custom tool. If both tools.custom.github.allowed-repos: current and the intended tools.github.allowed-repos: current exist, the transform rewrites both, despite the frontmatter precondition being scoped to the direct GitHub tool. Restrict detection to the direct child of tools so the codemod remains conservative.
		if inTools && strings.HasPrefix(trimmed, "github:") {
  • Files reviewed: 6/6 changed files
  • Comments generated: 3
  • Review effort level: Balanced

Comment thread pkg/cli/codemod_toolset_singular.go Outdated
ID: "toolset-singular-to-toolsets",
Name: "Rename 'tools.github.toolset' to 'tools.github.toolsets'",
Description: "Renames the mistyped singular 'toolset:' field to the correct plural 'toolsets:' inside the tools.github configuration block.",
IntroducedIn: "1.0.0",
ID: "allowed-repos-current-to-github-repository",
Name: "Migrate 'tools.github.allowed-repos: current' to '${{ github.repository }}'",
Description: "Rewrites the legacy 'current' alias for tools.github.allowed-repos to the accepted '${{ github.repository }}' expression.",
IntroducedIn: "1.0.0",
Comment thread pkg/cli/fix_codemods.go
Comment on lines +97 to +98
getToolsetSingularToToolsetsCodemod(), // Rename mistyped tools.github.toolset to tools.github.toolsets
getAllowedReposCurrentToGitHubRepositoryCodemod(), // Migrate legacy tools.github.allowed-repos: current to ${{ github.repository }}
@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Warning

Threat Detection Engine Failure — The analysis engine could not complete. This is a tooling failure, not a security finding.

What happened

The threat detection engine failed to produce results.

Review the workflow run logs for details.

Test Quality Sentinel 🧪

Score: 94/100 — ✅ Excellent

Summary

This PR adds two new codemods (toolset-singular-to-toolsets and allowed-repos-current-to-github-repository) with comprehensive test coverage. Tests demonstrate strong behavioral contracts with excellent edge-case handling and zero violations.

Metrics:

  • New test functions: 2 (with 12 subtests total)
  • Modified test functions: 1 (registry updates)
  • Design tests: 91.7% (behavioral contracts) | Implementation: 8.3% (metadata only)
  • Design-test ratio: ✅ Well under 30% threshold
  • Test-to-production ratio: 1.15:1 and 0.98:1 (both well under 2:1 threshold)
  • Edge cases covered: 91.7% of tests
  • Assertion quality: ✅ All assertions have descriptive failure messages
  • Build tags: ✅ All test files have required //go:build !integration
  • Mock libraries: ✅ None detected (clean testify/assert/require only)

Detailed Analysis

TestAllowedReposCurrentToGitHubRepositoryCodemod (8 subtests)

Subtest Type Coverage Status
"metadata is populated" implementation_test Validates ID, Name, Description, IntroducedIn, Apply func
"rewrites unquoted current value" behavioral_contract Core transformation with full content verification ✅ high_value
"rewrites quoted current value" behavioral_contract Variant handling (quoted strings) ✅ high_value
"no-op when allowed-repos is already an expression" behavioral_contract Edge case: idempotency ✅ high_value
"no-op when allowed-repos is an array" behavioral_contract Edge case: type mismatch handling ✅ high_value
"no-op when allowed-repos is set to all" behavioral_contract Edge case: semantic value matching ✅ high_value
"preserves trailing comments" behavioral_contract Preservation of user syntax (YAML comments) ✅ high_value
"only treats whitespace-preceded hash as a comment marker" behavioral_contract YAML parsing subtlety (embedded # in quoted strings) ✅ high_value

TestToolsetSingularToToolsetsCodemod (5 subtests)

Subtest Type Coverage Status
"metadata is populated" implementation_test Validates ID, Name, Description, IntroducedIn, Apply func
"renames toolset to toolsets under tools.github" behavioral_contract Core transformation with field name verification ✅ high_value
"no-op when toolsets already present" behavioral_contract Edge case: idempotency ✅ high_value
"no-op when tools.github is absent" behavioral_contract Edge case: missing parent block ✅ high_value
"does not rename toolset in comments" behavioral_contract Preservation: YAML comment safety ✅ high_value

fix_codemods_test.go modifications

  • Added "toolset-singular-to-toolsets" to registry validation
  • Added "allowed-repos-current-to-github-repository" to registry validation

Strengths

  1. Excellent edge-case coverage: Tests verify both happy-path (transformation applies) and multiple no-op conditions (already migrated, missing fields, type mismatches, semantic variations).
  2. YAML parsing robustness: Sophisticated test cases verify correct handling of YAML parsing edge cases:
    • Quoted vs. unquoted string values
    • Trailing YAML comments with proper whitespace detection
    • Embedded # characters in quoted strings (should NOT be treated as comment delimiters)
    • Array vs. string type mismatches
  3. Output verification: Tests use assert.Contains() and assert.NotContains() to verify transformed content, ensuring round-trip correctness.
  4. Comment and formatting preservation: Tests explicitly verify that indentation, trailing comments, and user syntax are preserved.
  5. Idempotency: Tests confirm that applying codemods to already-migrated workflows is a no-op.
  6. Healthy test inflation ratio: Both test files are 1.15:1 and 0.98:1 (well under the 2:1 threshold), indicating balanced test-to-code ratios.

No Violations Detected

✅ All required Go test build tags present (//go:build !integration on line 1)
✅ No mock library violations (testify/assert and testify/require only)
✅ Descriptive assertion messages throughout
✅ No test duplication detected
✅ No orphaned TestMain infrastructure


Verdict

✅ APPROVE — This PR demonstrates exceptional test quality. The test suite is comprehensive, behaviors are well-defined with strong design invariants, and no guideline violations exist. The codemods address real compatibility issues (typo migration and legacy alias support) with thorough verification.

🧪 Test quality analysis by Test Quality Sentinel · haiku45 · 20.7 AIC · ⊞ 7.7K ·
Comment /review to run again

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

✅ Test Quality Sentinel: 94/100 — Excellent. 91.7% design tests (threshold: ≤30% implementation), 0 violations. Comprehensive edge-case coverage with strong behavioral contracts.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Warning

Threat Detection Engine Failure — The analysis engine could not complete. This is a tooling failure, not a security finding.

What happened

The threat detection engine failed to produce results.

Review the workflow run logs for details.

Clean implementation following established codemod patterns. Both codemods are correct and idempotent:

  • Ordering: github-repos-to-allowed-repos runs before allowed-repos-current-to-github-repository — chaining works correctly for inputs that have both issues.
  • No false positives: findAndReplaceInLine(line, "toolset", "toolsets") checks for prefix toolset: which does not match toolsets:, so already-migrated files are safely skipped.
  • Comment safety: Lines trimmed to start with # do not match HasPrefix(trimmed, "toolset:") — comments are never modified.
  • Trailing comment preservation: findTrailingCommentIndex correctly identifies comment-start # only when preceded by whitespace or at position 0.
  • One non-blocking inline note on the IntroducedIn version placeholder.> 🧵 Reviewed using Impeccable skills by Impeccable Skills Reviewer · sonnet46 · 44.2 AIC · ⊞ 5.4K

Comment thread pkg/cli/codemod_toolset_singular.go Outdated
ID: "toolset-singular-to-toolsets",
Name: "Rename 'tools.github.toolset' to 'tools.github.toolsets'",
Description: "Renames the mistyped singular 'toolset:' field to the correct plural 'toolsets:' inside the tools.github configuration block.",
IntroducedIn: "1.0.0",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The IntroducedIn value "1.0.0" is a placeholder and does not reflect the actual release shipping this codemod. Other recent codemods also use "1.0.0", so this appears to be an established pattern — but if the version matters for gh aw fix --since filtering, consider setting it to the real release version. Non-blocking. @copilot please address this.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Warning

Threat Detection Engine Failure — The analysis engine could not complete. This is a tooling failure, not a security finding.

What happened

The threat detection engine failed to produce results.

Review the workflow run logs for details.

Verdict: non-blocking, follows existing precedent but with real gaps

The two new codemods correctly mirror the established pattern used by codemod_github_repos.go (parsed-frontmatter guard + line-based rewrite), and test coverage is solid for the documented block-style cases (quoting, comments, embedded #, no-ops). No correctness bugs found in the mainline block-style path.

Themes
  • Both new codemods share a structural limitation with prior codemods: the parsed-frontmatter check and the line-based text rewrite are independently implemented and can disagree on flow-style/list-based YAML, producing a silent applied:false no-op with no error surfaced. This is pre-existing risk, not a new regression, but it is unverified by any test in this PR.
  • codemod_toolset_singular.go duplicates ~60 lines of scanning logic from codemod_allowed_repos_current.go nearly verbatim - worth extracting to a shared helper before a third similar codemod is added.
  • Test coverage is good for the scenarios that matter most for this PR's stated purpose (typo migration + legacy alias rewrite), and edge cases around comment/quote handling are well tested.
> 🔎 *Code quality review by [PR Code Quality Reviewer](https://github.com/github/gh-aw/actions/runs/31102377519)* · auto · 56.1 AIC · ⊞ 7.8K > Comment /review to run again

Comment on lines +73 to +133

for i, line := range lines {
trimmed := strings.TrimSpace(line)

// Skip empty lines without resetting state
if trimmed == "" {
result = append(result, line)
continue
}

// Exit blocks when indentation signals we've left them
if !strings.HasPrefix(trimmed, "#") {
if inToolsGithub && hasExitedBlock(line, toolsGithubIndent) {
inToolsGithub = false
}
if inTools && hasExitedBlock(line, toolsIndent) {
inTools = false
inToolsGithub = false
}
}

// Detect 'tools:' block
if strings.HasPrefix(trimmed, "tools:") {
inTools = true
inToolsGithub = false
toolsIndent = getIndentation(line)
result = append(result, line)
continue
}

// Detect 'github:' block inside 'tools:'
if inTools && strings.HasPrefix(trimmed, "github:") {
inToolsGithub = true
toolsGithubIndent = getIndentation(line)
result = append(result, line)
continue
}

// Rewrite the value of 'allowed-repos: current' when inside tools.github
if inToolsGithub && strings.HasPrefix(trimmed, "allowed-repos:") {
lineIndent := getIndentation(line)
if isDescendant(lineIndent, toolsGithubIndent) {
if newLine, replaced := replaceAllowedReposCurrentLineValue(line); replaced {
result = append(result, newLine)
modified = true
allowedReposCurrentCodemodLog.Printf("Migrated 'allowed-repos: current' on line %d", i+1)
continue
}
}
}

result = append(result, line)
}

return result, modified
}

// replaceAllowedReposCurrentLineValue replaces the value of an 'allowed-repos:' line with
// '${{ github.repository }}' if the current value (unquoted, single-quoted, or double-quoted)
// is 'current'. Preserves indentation and trailing comments.
func replaceAllowedReposCurrentLineValue(line string) (string, bool) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The parsed-frontmatter check (hasAllowedReposCurrentValue) and the line-based rewriter (rewriteAllowedReposCurrentValue) use independent detection logic, so a case the map-based check flags as needing migration can still be silently skipped by the line scanner.

💡 Detail

hasAllowedReposCurrentValue understands any YAML shape the parser can produce (flow-style tools: {github: {allowed-repos: current}}, block sequences, etc.), but rewriteAllowedReposCurrentValue only recognizes classic block-style mappings where tools: and github: each start their own line at the expected indentation. If a workflow uses flow-style mapping or a list-based tools block, hasAllowedReposCurrentValue returns true, Apply proceeds to the line transform, but the transform never matches any line and returns modified == false. The Codemod.Apply then returns applied: false, err: nil — a silent no-op for a config the codemod itself already detected as needing migration, with no error, log entry, or indication to the caller/user that the fix was skipped.

This mirrors a pre-existing limitation in codemod_github_repos.go, but since this is new code with no test coverage for flow-style/list-based tools.github blocks, the gap goes unverified here. Consider either detecting when the parsed check and line-scan check disagree (and returning an error) or adding tests documenting the known limitation.

Comment on lines +52 to +114
_, hasToolset := githubMap["toolset"]
_, hasToolsets := githubMap["toolsets"] // only check existence, not value
if hasToolset && !hasToolsets {
toolsetSingularCodemodLog.Print("Mistyped singular 'toolset' field found in tools.github")
}
return hasToolset && !hasToolsets
}

// renameToolsetSingularToToolsets renames 'toolset:' to 'toolsets:' within the
// tools.github configuration block.
func renameToolsetSingularToToolsets(lines []string) ([]string, bool) {
var result []string
modified := false

var inTools, inToolsGithub bool
var toolsIndent, toolsGithubIndent string

for i, line := range lines {
trimmed := strings.TrimSpace(line)

// Skip empty lines without resetting state
if trimmed == "" {
result = append(result, line)
continue
}

// Exit blocks when indentation signals we've left them
if !strings.HasPrefix(trimmed, "#") {
if inToolsGithub && hasExitedBlock(line, toolsGithubIndent) {
inToolsGithub = false
}
if inTools && hasExitedBlock(line, toolsIndent) {
inTools = false
inToolsGithub = false
}
}

// Detect 'tools:' block
if strings.HasPrefix(trimmed, "tools:") {
inTools = true
inToolsGithub = false
toolsIndent = getIndentation(line)
result = append(result, line)
continue
}

// Detect 'github:' block inside 'tools:'
if inTools && strings.HasPrefix(trimmed, "github:") {
inToolsGithub = true
toolsGithubIndent = getIndentation(line)
result = append(result, line)
continue
}

// Rename 'toolset:' to 'toolsets:' when inside tools.github
if inToolsGithub && strings.HasPrefix(trimmed, "toolset:") {
lineIndent := getIndentation(line)
if isDescendant(lineIndent, toolsGithubIndent) {
newLine, replaced := findAndReplaceInLine(line, "toolset", "toolsets")
if replaced {
result = append(result, newLine)
modified = true
toolsetSingularCodemodLog.Printf("Renamed 'toolset' to 'toolsets' on line %d", i+1)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Same silent-no-op risk as the allowed-repos codemod: hasSingularToolsetField (parsed map check) and renameToolsetSingularToToolsets (line-based scanner) can disagree on flow-style or list-based tools.github blocks, causing Apply to report applied: false with no error even though the field was detected as needing migration.

💡 Detail

This file duplicates ~60 lines of block-scanning logic (inTools/inToolsGithub tracking, tools:/github: prefix detection, hasExitedBlock/isDescendant usage) nearly verbatim from codemod_allowed_repos_current.go. Beyond the maintainability cost of two copies that can drift, both share the same blind spot: they assume block-style YAML with tools:/github: each starting their own line at the expected indent. No test in this PR covers flow-style mappings, so a regression here would go unnoticed.

Suggest extracting the shared inTools/inToolsGithub scanning loop into a common helper (e.g. taking a per-line callback for the matched field) to avoid duplicating this logic a third time as more codemods are added.

@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Warning

Threat Detection Engine Failure — The analysis engine could not complete. This is a tooling failure, not a security finding.

What happened

The threat detection engine failed to produce results.

Review the workflow run logs for details.

Design Decision Gate — ADR Required

This PR makes significant changes to core business logic (627 new lines in pkg/) but does not have a linked Architecture Decision Record (ADR).

Draft ADR committed: docs/adr/50841-add-codemods-for-toolset-typo-and-allowed-repos-current.md — review and complete it before merging.

This PR cannot merge until an ADR is linked in the PR body.

What to do next
  1. Review the draft ADR committed to your branch — it was generated from the PR diff
  2. Complete the missing sections — add context the AI could not infer, refine the decision rationale, and list real alternatives you considered
  3. Commit the finalized ADR to docs/adr/ on your branch
  4. Reference the ADR in this PR body by adding a line such as:

    ADR: ADR-50841: Add Codemods for Toolset Typo and allowed-repos: current

Once an ADR is linked in the PR body, this gate will re-run and verify the implementation matches the decision.

Why ADRs Matter

ADRs create a searchable, permanent record of why the codebase looks the way it does. Future contributors (and your future self) will thank you.

Michael Nygard ADR Format Reference

An ADR must contain these four sections to be considered complete:

  • Context — What is the problem? What forces are at play?
  • Decision — What did you decide? Why?
  • Alternatives Considered — What else could have been done?
  • Consequences — What are the trade-offs (positive and negative)?

All ADRs are stored in docs/adr/ as Markdown files numbered by PR number.

🏗️ ADR gate enforced by Design Decision Gate 🏗️ · sonnet46 · 68.7 AIC · ⊞ 9.6K ·
Comment /review to run again

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Warning

Threat Detection Engine Failure — The analysis engine could not complete. This is a tooling failure, not a security finding.

What happened

The threat detection engine failed to produce results.

Review the workflow run logs for details.

Skills-Based Review 🧠

Applied /tdd — requesting changes on two minor but concrete issues.

📋 Key Themes & Highlights

Issues

  • Incorrect IntroducedIn version (both codemods): both use "1.0.0" despite being added after v1.0.47 and v1.5.0. Should be the actual upcoming release version.
  • Missing edge-case tests: no test covers toolset: or allowed-repos: current appearing outside the tools.github block, and no test for single-quoted 'current'.

Positive Highlights

  • ✅ Robust YAML line-transform pattern: two-phase design (frontmatter check → line rewrite) is clean and consistent with existing codemods
  • findTrailingCommentIndex correctly implements YAML comment semantics (whitespace-preceded # only)
  • ✅ Good idempotency: both codemods check for already-migrated state before applying
  • ✅ Comprehensive test coverage of the happy path and comment preservation
  • findAndReplaceInLine reuse prevents accidental substring collisions (e.g., toolsets: won't be touched)
> 🧠 *Reviewed using Matt Pocock's skills by [Matt Pocock Skills Reviewer](https://github.com/github/gh-aw/actions/runs/31102377476)* · sonnet46 · 69.4 AIC · ⊞ 7.1K > Comment /matt to run again

Comment thread pkg/cli/codemod_toolset_singular.go Outdated
ID: "toolset-singular-to-toolsets",
Name: "Rename 'tools.github.toolset' to 'tools.github.toolsets'",
Description: "Renames the mistyped singular 'toolset:' field to the correct plural 'toolsets:' inside the tools.github configuration block.",
IntroducedIn: "1.0.0",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[/tdd] IntroducedIn is set to "1.0.0" but this codemod is being added now, well after 1.0.47 and 1.5.0 already exist in the registry. This misleads maintainers about when the migration was introduced and may affect tooling that filters codemods by version.

💡 Fix

Set IntroducedIn to the actual release version this codemod ships in. Check the most recently added codemods (codemod_effective_tokens_to_ai_credits.go at "1.0.47", codemod_workflow_dispatch_required.go at "1.5.0") for the current version baseline, then use the next planned release tag.

@copilot please address this.

assert.Contains(t, result, "toolsets: default", "Should rename toolset key")
assert.Contains(t, result, "# toolset: legacy comment", "Should not rename toolset in comments")
})
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[/tdd] Missing test: toolset: key appearing outside the tools.github block (e.g. under a different parent). The indentation state machine should ignore it, but without a test this silent correctness invariant is unverified.

💡 Suggested test
t.Run("no-op when toolset: appears outside tools.github", func(t *testing.T) {
    content := `---
engine: copilot
other:
  toolset: some-value
---

# Test Workflow
`
    frontmatter := map[string]any{
        "engine": "copilot",
        "other": map[string]any{"toolset": "some-value"},
    }
    result, applied, err := codemod.Apply(content, frontmatter)
    require.NoError(t, err)
    assert.False(t, applied, "Should not rename toolset outside tools.github")
    assert.Equal(t, content, result)
})

@copilot please address this.

ID: "allowed-repos-current-to-github-repository",
Name: "Migrate 'tools.github.allowed-repos: current' to '${{ github.repository }}'",
Description: "Rewrites the legacy 'current' alias for tools.github.allowed-repos to the accepted '${{ github.repository }}' expression.",
IntroducedIn: "1.0.0",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[/tdd] Same IntroducedIn: "1.0.0" issue as the toolset codemod — this codemod is new, not from v1.0.0. Should use the upcoming release version.

@copilot please address this.

assert.True(t, applied, "Should have applied the codemod")
assert.Contains(t, result, `allowed-repos: "${{ github.repository }}" # see docs on "#current" alias`, "Should preserve the full comment including embedded hash")
})
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[/tdd] Missing test: allowed-repos: current appearing inside a tools.github block that is itself nested under a non-top-level tools: key (i.e., verify the indentation state machine correctly scopes to the top-level tools: block only). Also missing: single-quoted 'current' value — the strings.Trim(value, "') handles it, but it's untested.

@copilot please address this.

@pelikhan

pelikhan commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator

@copilot run pr-finisher skill

Copilot AI and others added 2 commits August 6, 2026 14:56
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot Maintainer triage for this PR:

  • Please address the active review feedback, especially the direct-tooling-scope concerns around nested tools.*.github rewrites and the follow-up notes about IntroducedIn / missing edge-case coverage.
  • Refresh the branch after the branch-update request completes.
  • Then run the pr-finisher skill and post a concise summary of what changed and which review items were resolved.

Run: https://github.com/github/gh-aw/actions/runs/31113572782

Generated by 👨‍🍳 PR Sous Chef · gpt54 · 17.2 AIC · ⊞ 8.3K ·
Comment /souschef to run again

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI requested a review from gh-aw-bot August 6, 2026 15:23
@pelikhan
pelikhan merged commit 4b561ef into main Aug 6, 2026
1 check failed
@pelikhan
pelikhan deleted the copilot/aw-compat-daily-audit branch August 6, 2026 15:42
@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

🎉 This pull request is included in a new release.

Release: v0.86.0

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.

[aw-compat] Daily AW compatibility audit (2026-08-06): 13/20 repos compile, 5 failure clusters

4 participants