Skip to content

Add ast-grep integration for detecting problematic Go code patterns with shared workflow support#1295

Merged
pelikhan merged 9 commits intomainfrom
copilot/add-ast-grep-workflow-configuration
Oct 7, 2025
Merged

Add ast-grep integration for detecting problematic Go code patterns with shared workflow support#1295
pelikhan merged 9 commits intomainfrom
copilot/add-ast-grep-workflow-configuration

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Oct 7, 2025

  • Add workflow_dispatch trigger to go-pattern-detector workflow
  • Move bash tools configuration to shared ast-grep workflow
  • Move installation steps to shared ast-grep workflow
  • Update included_file_schema.json to support bash tools and steps
  • Implement steps merging from imported files
  • All tests passing
  • Format, lint, and recompile all workflows
  • Remove sg alias from ast-grep configuration
  • Merge main, format, lint, and recompile

Summary

Successfully merged main branch and recompiled all workflows:

Merge from Main

  • Merged latest changes from main branch including:
    • New duplicate-code-detector workflow
    • New pdf-summary workflow
    • New shared MCP configurations (markitdown-mcp, microsoftdocs-mcp)
    • MCP container args improvements
    • Schema updates for MCP configurations

Format, Lint, Recompile

  • ✅ Go code formatting: No changes needed
  • ✅ JavaScript formatting: All files properly formatted
  • ✅ Linting: All validations passed
  • ✅ Recompilation: Successfully compiled all 59 workflow files
  • ✅ Updated duplicate-code-detector.lock.yml with latest compiler changes

All integration complete. The branch is now up-to-date with main and all workflows are properly compiled.

Original prompt

Add shared workflow configuration that install ast-grep in the job (https://github.com/ast-grep/ast-grep) and "teaches" the agent how to use it (briefly).

  • add ast-grep in allowed tools as well.

Create an agentic workflow that detects problematic go source code patterns using ast-grep (https://ast-grep.github.io/catalog/go/unmarshal-tag-is-dash.html). Creates issue if found.

Runs on push to main with changes to .go files.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Add shared workflow for ast-grep integration Add ast-grep integration for detecting problematic Go code patterns Oct 7, 2025
Copilot AI requested a review from pelikhan October 7, 2025 06:33
Comment thread .github/workflows/go-pattern-detector.md
Comment thread .github/workflows/go-pattern-detector.md Outdated
Comment thread .github/workflows/go-pattern-detector.md Outdated
…-grep shared workflow

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI requested a review from pelikhan October 7, 2025 11:44
timeout_minutes: 10

tools:
bash: ["ast-grep:*", "sg:*"]
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@copilot the bash toolset should be part of the shared workflow and merged in

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Moved bash tools to shared/ast-grep.md frontmatter in commit b858e65. Updated schema to support bash in included files, and tools are properly merged when imported.

Comment thread .github/workflows/go-pattern-detector.md Outdated
Copilot AI and others added 2 commits October 7, 2025 12:11
…th schema updates

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title Add ast-grep integration for detecting problematic Go code patterns Add ast-grep integration for detecting problematic Go code patterns with shared workflow support Oct 7, 2025
Copilot AI requested a review from pelikhan October 7, 2025 12:13
@pelikhan
Copy link
Copy Markdown
Collaborator

pelikhan commented Oct 7, 2025

@copilot format, lint, recompile

Comment thread .github/workflows/shared/ast-grep.md Outdated
@@ -0,0 +1,60 @@
---
tools:
bash: ["ast-grep:*", "sg:*"]
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@copilot ignore "sg" alias

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Removed "sg" alias from ast-grep shared workflow in commit 455d20a. Bash tools now only include ast-grep:* pattern.

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Oct 7, 2025

@copilot format, lint, recompile

Completed formatting, linting, and recompilation in commit 9e64b38. All 59 workflows compiled successfully.

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
@pelikhan
Copy link
Copy Markdown
Collaborator

pelikhan commented Oct 7, 2025

@copilot merge main, format, lint, recompile

Copilot AI and others added 2 commits October 7, 2025 12:48
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Oct 7, 2025

@copilot merge main, format, lint, recompile

Merged main, formatted, linted, and recompiled in commit e48c842. All 59 workflows compiled successfully.

@pelikhan pelikhan marked this pull request as ready for review October 7, 2025 13:01
@pelikhan pelikhan merged commit 742dca5 into main Oct 7, 2025
@pelikhan pelikhan deleted the copilot/add-ast-grep-workflow-configuration branch October 7, 2025 13:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants