Added code simplification workflows for GH#26419
Added code simplification workflows for GH#26419dhr-verma wants to merge 12 commits intomicrosoft:mainfrom
Conversation
…aily-repo-status.md-4130 Add agentic workflow daily-repo-status
…ode-simplifier.md-1519 Add agentic workflow code-simplifier
…uplicate-code-detector.md-4767 Add agentic workflow duplicate-code-detector
There was a problem hiding this comment.
Pull request overview
This pull request adds GitHub Agentic Workflows (gh-aw) - an AI-powered automation framework that uses GitHub Copilot to perform automated code quality tasks on a scheduled basis.
Changes:
- Adds two automated workflows: "Duplicate Code Detector" (runs daily to find code duplication) and "Code Simplifier" (runs daily to simplify recently modified code)
- Adds maintenance workflow to auto-close expired issues/PRs created by the automation
- Includes workflow configuration files (.md), generated lock files (.lock.yml), and supporting infrastructure (imports, git attributes, action locks)
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
.github/workflows/duplicate-code-detector.md |
Configuration for AI-powered duplicate code detection workflow |
.github/workflows/duplicate-code-detector.lock.yml |
Generated YAML workflow file for duplicate code detection (auto-generated, not manually edited) |
.github/workflows/code-simplifier.md |
Configuration for AI-powered code simplification workflow |
.github/workflows/code-simplifier.lock.yml |
Generated YAML workflow file for code simplification (auto-generated, not manually edited) |
.github/workflows/agentics-maintenance.yml |
Maintenance workflow to close expired automation-created issues/PRs every 2 hours |
.github/aw/imports/github/gh-aw/94662b1dee8ce96c876ba9f33b3ab8be32de82a4/.github_workflows_shared_reporting.md |
Cached import of shared reporting guidelines for workflow outputs |
.github/aw/imports/.gitattributes |
Git attributes marking imported files as generated with 'ours' merge strategy |
.github/aw/actions-lock.json |
Version lock file for GitHub Actions dependencies |
.gitattributes |
Updated to mark generated workflow lock files with linguist-generated and merge=ours |
| create-issue: | ||
| expires: 2d | ||
| title-prefix: "[duplicate-code] " | ||
| labels: [code-quality, automated-analysis, cookie] |
There was a problem hiding this comment.
The label "cookie" in the labels array appears unusual for a code quality workflow. Typically, workflow labels should be descriptive of the issue category (e.g., "duplicate-code", "refactoring", "code-quality").
The "cookie" label seems out of place unless it has a specific meaning in your repository's labeling system. Consider:
- Verifying this label exists in the repository
- Using a more descriptive label name if "cookie" was unintentional
- Documenting the purpose of this label if it's intentional
| labels: [code-quality, automated-analysis, cookie] | |
| labels: [code-quality, automated-analysis, duplicate-code] |
|
|
||
| Identify and analyze modified files: | ||
| - Determine files changed in the recent commits | ||
| - **ONLY analyze .ts and .cjs files** - exclude all other file types |
There was a problem hiding this comment.
The file type restrictions appear inconsistent with the tool configuration. Line 15 specifies serena: ["go"] for analyzing Go code, but lines 59-60 state "ONLY analyze .ts and .cjs files" and explicitly exclude all other file types.
This creates a contradiction:
- The tool is configured for Go analysis (
serena: ["go"]) - The instructions restrict analysis to TypeScript (.ts) and CommonJS (.cjs) files only
- Go files (.go) would be excluded by the "ONLY analyze .ts and .cjs files" restriction
Either:
- Update the serena tool configuration to include TypeScript if that's the intended scope
- Update the file type restrictions to include .go files if Go analysis is intended
- Remove the serena tool configuration if Go analysis is not needed
The test file exclusion patterns also include Go test files (*_test.go) which suggests Go was initially intended to be analyzed.
| - **ONLY analyze .ts and .cjs files** - exclude all other file types | |
| - **Analyze .ts, .cjs, and .go files** and exclude all other file types |
.github/workflows/code-simplifier.md
Outdated
| ```bash | ||
| pnpm run lint | ||
|
|
||
| pnpm run format --fix |
There was a problem hiding this comment.
The command pnpm run format --fix (line 209) is incorrect for this repository. The repository's package.json defines the format script as fluid-build --task format, which doesn't accept a --fix flag.
Based on the package.json, the correct commands should be:
pnpm run format- runs formatting via fluid-buildpnpm run format:repo- uses biome to format with --write flag (which actually fixes)
Consider changing line 209 to either:
pnpm run format:repoor simply:
pnpm run formatThe current command will likely pass the --fix flag to fluid-build, which may not handle it correctly.
| pnpm run format --fix | |
| pnpm run format:repo |
…to vermadhr/ghawWorkflowsForSimplification
|
🔗 No broken links found! ✅ Your attention to detail is admirable. linkcheck output |
Description
GitHub Agentic Workflows (GH AW) are AI powered workflows that leverage tools available in GitHub to create automated workflows. This PR is a POC of sorts where I wish to test the GH AW workflows for code simplication.
These two workflows do the following:
safe_outputfor this flow is PR generation (if the model decides simplification is needed).These flows are currently for testing and DO NOT have any intrusive elevated permissions. They only have the least privilege to perform the needed tasks.
Breaking Changes
There are no breaking changes.
Reviewer Guidance
Happy to get reviews on any changes to prompts, validation flows etc.