Add agentic workflow code-simplifier#34058
Conversation
|
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughAdds a new Code Simplifier GitHub Actions workflow and accompanying documentation, shared workflow docs, and a small .gitattributes tweak marking workflow lock files as linguist-generated. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor Scheduler as GitHub Scheduler
participant Runner as Actions Runner
participant Repo as Repository
participant Agent as Copilot CLI Agent
participant Safe as Safe-Outputs MCP
participant Detector as Threat Detector
participant Artifacts as Artifact Store
Scheduler->>Runner: trigger workflow
Runner->>Repo: checkout code & fetch metadata
Runner->>Runner: run pre-activation checks
alt activation allowed
Runner->>Agent: interpolate prompts & run Copilot CLI
Agent->>Repo: read changed files
Agent->>Artifacts: upload logs & interim outputs
Runner->>Safe: configure/start MCP server
Safe->>Artifacts: store safe outputs & PR payload
opt threat detection enabled
Runner->>Detector: run threat analysis on outputs
Detector->>Artifacts: upload detection results
end
Runner->>Repo: create/update PR via safe-outputs or record no-op
else skipped
Runner->>Repo: record skipped run
end
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (4)
.github/workflows/code-simplifier.md (4)
84-88: Add language specifier to fenced code block.Static analysis flagged this code block as missing a language specifier. Since this represents plain text output, consider adding
textorplaintextas the language.📝 Suggested fix
-``` +```text ✅ No code changes detected in the last 24 hours. Code simplifier has nothing to process today. -``` +```🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.github/workflows/code-simplifier.md around lines 84 - 88, The fenced code block is missing a language specifier; update the block so the opening fence includes a plaintext language (e.g., change ``` to ```text or ```plaintext) around the output lines ("✅ No code changes detected..." and "Code simplifier has nothing to process today.") so static analysis recognizes it as plain text.
386-395: Add language specifiers to output requirement code blocks.These code blocks representing agent output messages should have language specifiers for consistency.
📝 Suggested fix
1. **If no changes in last 24 hours**: - ``` + ```text ✅ No code changes detected in the last 24 hours. Code simplifier has nothing to process today. ``` 2. **If no simplifications beneficial**: - ``` + ```text ✅ Code analyzed from last 24 hours. No simplifications needed - code already meets quality standards. ```🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.github/workflows/code-simplifier.md around lines 386 - 395, Update the two agent-output code blocks so they include an explicit language specifier "text"; locate the plain triple-backtick blocks containing the messages "✅ No code changes detected in the last 24 hours..." and "✅ Code analyzed from last 24 hours..." and change the opening fences to ```text so both blocks are tagged consistently.
259-262: Hardcoded filename in Python build check example.The Python build verification uses a hardcoded filename
changed_files.py, which doesn't align with the dynamic file discovery approach used elsewhere in the workflow. Consider using a placeholder or explaining this is an example pattern.📝 Suggested fix
# For Python projects # (typically no build step, but check imports) -python -m py_compile changed_files.py +python -m py_compile <changed_file.py>Or use a loop pattern:
# For Python projects for f in $(git diff --name-only HEAD~1 -- '*.py'); do python -m py_compile "$f" done🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.github/workflows/code-simplifier.md around lines 259 - 262, The example in .github/workflows/code-simplifier.md uses a hardcoded filename "changed_files.py" for the Python build check; change the example to avoid a fixed filename by either using a placeholder (e.g., "<python_file>") or demonstrating the dynamic pattern used elsewhere (iterate over changed .py files and run python -m py_compile on each). Update the Python section so the snippet references the dynamic discovery approach rather than the literal "changed_files.py", and ensure the text explains it is an example pattern to be adapted for real repos.
280-284: Add language specifier to fenced code block.Similar to the earlier block, this plain text output block should have a language specifier.
📝 Suggested fix
-``` +```text ✅ Code analyzed from last 24 hours. No simplifications needed - code already meets quality standards. -``` +```🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.github/workflows/code-simplifier.md around lines 280 - 284, The fenced code block containing "✅ Code analyzed from last 24 hours. No simplifications needed - code already meets quality standards." should include a language specifier; update the opening triple-backtick from ``` to ```text so the block becomes ```text ... ``` to explicitly mark it as plain text (leave the content unchanged and keep the closing ```).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.gitattributes:
- Line 2: The global rule "* -text" in .gitattributes disables Git's EOL
normalization for every file; either add a clear comment above that line
explaining why global disabling is required (e.g., repository contains mixed
binary/generated files that must preserve native line endings) or replace the
broad rule with targeted patterns (e.g., list specific binary or generated file
globs such as *.png, *.jar, build/**, generated/** with "-text") so only those
file types are excluded from normalization; update the single "* -text" entry
accordingly and include a short rationale comment if you decide to keep a global
rule.
---
Nitpick comments:
In @.github/workflows/code-simplifier.md:
- Around line 84-88: The fenced code block is missing a language specifier;
update the block so the opening fence includes a plaintext language (e.g.,
change ``` to ```text or ```plaintext) around the output lines ("✅ No code
changes detected..." and "Code simplifier has nothing to process today.") so
static analysis recognizes it as plain text.
- Around line 386-395: Update the two agent-output code blocks so they include
an explicit language specifier "text"; locate the plain triple-backtick blocks
containing the messages "✅ No code changes detected in the last 24 hours..." and
"✅ Code analyzed from last 24 hours..." and change the opening fences to ```text
so both blocks are tagged consistently.
- Around line 259-262: The example in .github/workflows/code-simplifier.md uses
a hardcoded filename "changed_files.py" for the Python build check; change the
example to avoid a fixed filename by either using a placeholder (e.g.,
"<python_file>") or demonstrating the dynamic pattern used elsewhere (iterate
over changed .py files and run python -m py_compile on each). Update the Python
section so the snippet references the dynamic discovery approach rather than the
literal "changed_files.py", and ensure the text explains it is an example
pattern to be adapted for real repos.
- Around line 280-284: The fenced code block containing "✅ Code analyzed from
last 24 hours. No simplifications needed - code already meets quality
standards." should include a language specifier; update the opening
triple-backtick from ``` to ```text so the block becomes ```text ... ``` to
explicitly mark it as plain text (leave the content unchanged and keep the
closing ```).
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 0f398426-2cd7-4e51-a1ea-ebcfcf5f064c
📒 Files selected for processing (5)
.gitattributes.github/workflows/code-simplifier.lock.yml.github/workflows/code-simplifier.md.github/workflows/shared/mood.md.github/workflows/shared/reporting.md
| @@ -1,2 +1,4 @@ | |||
| /**/.yarn/** linguist-generated | |||
| * -text No newline at end of file | |||
| * -text | |||
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Check if there was a previous .gitattributes rule and what it covered
git log -p --follow -1 -- .gitattributes 2>/dev/null | head -50 || echo "No git history available"
# Check for other text-related gitattributes in the repo
cat .gitattributes 2>/dev/nullRepository: storybookjs/storybook
Length of output: 169
Justify the global * -text setting or use more targeted patterns.
The * -text rule disables Git's automatic line ending normalization for all files in the repository. This is a broad setting that could cause inconsistent line endings across different operating systems (Windows vs. Linux/macOS) for contributors.
If this is intentional, add a comment explaining the rationale. If it's meant to apply only to specific file types (e.g., binary files or generated workflows), replace it with more targeted patterns instead.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In @.gitattributes at line 2, The global rule "* -text" in .gitattributes
disables Git's EOL normalization for every file; either add a clear comment
above that line explaining why global disabling is required (e.g., repository
contains mixed binary/generated files that must preserve native line endings) or
replace the broad rule with targeted patterns (e.g., list specific binary or
generated file globs such as *.png, *.jar, build/**, generated/** with "-text")
so only those file types are excluded from normalization; update the single "*
-text" entry accordingly and include a short rationale comment if you decide to
keep a global rule.
|
View your CI Pipeline Execution ↗ for commit bd8ec13
☁️ Nx Cloud last updated this comment at |
Add agentic workflow code-simplifier
Summary by CodeRabbit
New Features
Documentation
Chores