Skip to content

Add config folder upload step to copilot engine before CLI execution#1032

Merged
pelikhan merged 8 commits intomainfrom
copilot/fix-7efadf2b-74c1-41d9-af1b-e88663037298
Sep 26, 2025
Merged

Add config folder upload step to copilot engine before CLI execution#1032
pelikhan merged 8 commits intomainfrom
copilot/fix-7efadf2b-74c1-41d9-af1b-e88663037298

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Sep 26, 2025

Implementation Complete: Add config folder upload step to copilot engine before CLI execution

Successfully implemented config folder upload functionality for the copilot engine.

Changes made:

  • Added generateUploadConfigStep() helper method to create the upload artifact step
  • Integrated the upload step into GetExecutionSteps() method before copilot CLI execution
  • Used direct path /tmp/.copilot/ instead of environment variable for better reliability
  • Fixed all tests to expect 3 steps after log capture functionality was added to all engines

Upload step specifications:

  • Step name: "Upload config"
  • Artifact name: "config"
  • Artifact path: "/tmp/.copilot/" (direct path for reliability)
  • Uses: "actions/upload-artifact@v4"
  • Condition: "if: always()" (runs even if previous steps fail)
  • If no files found: "ignore" (doesn't fail workflow if folder is empty)
  • Correctly positioned before the copilot CLI execution step

Current execution flow:

  1. Upload config step - Captures configuration folder content
  2. Execute GitHub Copilot CLI step - Runs the actual copilot CLI
  3. Log capture step - Captures and processes execution logs (added by recent commits)

Testing:

  • All unit tests pass, including copilot engine specific tests
  • Updated test expectations to account for new 3-step flow
  • Tests validate upload step properties and positioning
  • Full test suite shows no regressions

The implementation follows existing patterns in the codebase and improves debuggability of copilot workflows by preserving the configuration state that affects CLI behavior.

Original prompt

Update the copilot engine to add a step that uploads the content of the folder $XDG_CONFIG_HOME

  • artifact name: config

  • path: $XDG_CONFIG_HOME

  • insert step before running copilot cli


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Update the copilot engine to add a step that uploads the content of the folder $XDG_CONFIG_HOME - artifact name: config - path: $XDG_CONFIG_HOME - insert step before running copilot cli Add XDG_CONFIG_HOME upload step to copilot engine before CLI execution Sep 26, 2025
Copilot AI requested a review from pelikhan September 26, 2025 10:40
Comment thread pkg/workflow/copilot_engine.go Outdated
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title Add XDG_CONFIG_HOME upload step to copilot engine before CLI execution Add config folder upload step to copilot engine before CLI execution Sep 26, 2025
Copilot AI requested a review from pelikhan September 26, 2025 10:54
- Added artifact upload for configuration files in multiple workflows.
- Implemented log file creation and debugging output for Copilot execution logs.
- Removed cleanup steps for engine output files to retain logs for analysis.
- Introduced error validation for agent logs using GitHub Script, with customizable error patterns.
- Ensured consistent handling of log files across various workflows to improve debugging capabilities.
Copy link
Copy Markdown
Collaborator

@pelikhan pelikhan left a comment

Choose a reason for hiding this comment

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

@copilot fix tests

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Sep 26, 2025

@copilot fix tests

Fixed all copilot engine tests to expect 3 steps instead of 2, accounting for the new log capture step that was added to all engines. All tests now pass. Commit: 1b4e08a

@pelikhan pelikhan marked this pull request as ready for review September 26, 2025 11:32
@pelikhan pelikhan merged commit 4547ed7 into main Sep 26, 2025
13 of 14 checks passed
@pelikhan pelikhan deleted the copilot/fix-7efadf2b-74c1-41d9-af1b-e88663037298 branch September 26, 2025 11:32
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