Skip to content

Include .agents folder in sparse checkout for agent jobs#13901

Merged
pelikhan merged 5 commits intomainfrom
copilot/checkout-agents-folder-by-default
Feb 5, 2026
Merged

Include .agents folder in sparse checkout for agent jobs#13901
pelikhan merged 5 commits intomainfrom
copilot/checkout-agents-folder-by-default

Conversation

Copy link
Contributor

Copilot AI commented Feb 5, 2026

Implementation: Checkout .agents folder in agent jobs

Completed

  • Update generateCheckoutGitHubFolder() to include .agents in sparse-checkout
  • Update function documentation to reflect .agents checkout
  • Update test cases to verify .agents is checked out
  • Add unit tests for the function
  • Run validation (fmt, lint, test)
  • Recompile workflows to apply changes
  • Remove redundant documentation (sparse-checkout behavior is implied)

Changes Made

  1. Modified pkg/workflow/compiler_yaml_helpers.go:

    • Updated generateCheckoutGitHubFolder() to include .agents folder in sparse-checkout
    • Changed step name to "Checkout .github and .agents folders"
    • Added .agents to the sparse-checkout configuration
    • Updated all log messages to mention both folders
  2. Updated Tests:

    • Modified TestGitHubFolderCheckoutOptimization to check for new step name
    • Added assertions to verify .agents is in sparse-checkout configuration
    • Added TestGenerateCheckoutGitHubFolder unit test

Validation Results

  • ✅ All tests passing
  • ✅ Linting passed
  • ✅ Code formatted
Original prompt

The .agents folder should be checkout by default if the action job does not have contents read (like the .github folder). Only in agent job.

This is to support the new location for storing skills.


💡 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.

Copilot AI and others added 2 commits February 5, 2026 12:54
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] Add default checkout for .agents folder in agent job Include .agents folder in sparse checkout for agent jobs Feb 5, 2026
Copilot AI requested a review from pelikhan February 5, 2026 13:00
@pelikhan
Copy link
Contributor

pelikhan commented Feb 5, 2026

@copilot .agent maybe missing, do not check

" sparse-checkout: |\n",
" .github\n",
" .agents\n",
" depth: 1\n",
Copy link
Contributor

Choose a reason for hiding this comment

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

@copilot this is implied by sparse checkout

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed the redundant note. Sparse-checkout behavior is indeed implied. (9d6b778)

@pelikhan pelikhan added the smoke label Feb 5, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Feb 5, 2026

🌑 The shadows whisper... Smoke Codex failed. The oracle requires further meditation...

@github-actions
Copy link
Contributor

github-actions bot commented Feb 5, 2026

📰 BREAKING: Smoke Copilot is now investigating this pull request. Sources say the story is developing...

@github-actions
Copy link
Contributor

github-actions bot commented Feb 5, 2026

Changeset Generator failed. Please review the logs for details.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 5, 2026

🎬 THE ENDSmoke Claude MISSION: ACCOMPLISHED! The hero saves the day! ✨

Copy link
Contributor Author

Copilot AI commented Feb 5, 2026

@copilot .agent maybe missing, do not check

The .agents folder is included in the sparse-checkout configuration, but the checkout won't fail if it doesn't exist. The actions/checkout action with sparse-checkout gracefully handles non-existent paths by simply not checking them out. This means:

  1. If .agents exists in the repo → it will be checked out
  2. If .agents doesn't exist → the checkout succeeds, just without that folder

This is the standard sparse-checkout behavior and doesn't require any additional handling. Is there a specific issue you'd like me to address differently?

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

github-actions bot commented Feb 5, 2026

Agent Container Tool Check

Tool Status Version
bash GNU bash, version 5.2.21(1)-release
sh available
git git version 2.52.0
jq jq-1.7
yq yq version v4.50.1
curl curl 8.5.0
gh gh version 2.86.0
node v20.20.0
python3 Python 3.12.3
go go version go1.24.12
java available (detection issue - needs fix)
dotnet not available

Result: 11/12 tools available ❌
Status: FAIL - .NET runtime (dotnet) is missing

Note: Java version check returned bash output incorrectly but Java is available in the container.

AI generated by Agent Container Smoke Test

@github-actions
Copy link
Contributor

github-actions bot commented Feb 5, 2026

🤖 Beep boop! The smoke test agent just passed through discussion #13913 like a gentle breeze on a spring day. All systems nominal! ✨

P.S. If discussions could talk, this one would probably say "Hey, nice triage report!" 🎯

AI generated by Smoke Copilot

@github-actions
Copy link
Contributor

github-actions bot commented Feb 5, 2026

@github-actions
Copy link
Contributor

github-actions bot commented Feb 5, 2026

📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤

@pelikhan pelikhan marked this pull request as ready for review February 5, 2026 13:36
Copilot AI review requested due to automatic review settings February 5, 2026 13:36
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds support for checking out the .agents folder alongside the .github folder in agent jobs. This enables workflows to access skills stored in the new .agents location while maintaining the existing functionality for workflow configurations and runtime imports.

Changes:

  • Updated sparse checkout configuration to include .agents folder
  • Modified step naming and documentation to reflect both folders
  • Added comprehensive test coverage for the new behavior

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
pkg/workflow/compiler_yaml_helpers.go Modified generateCheckoutGitHubFolder() to include .agents in sparse-checkout configuration, updated function documentation and log messages
pkg/workflow/github_folder_checkout_optimization_test.go Updated test assertions to verify both .github and .agents folders are included in sparse checkout
pkg/workflow/compiler_yaml_helpers_test.go Added new unit test TestGenerateCheckoutGitHubFolder to verify sparse checkout includes both folders
Comments suppressed due to low confidence (2)

pkg/workflow/compiler_yaml_helpers.go:185

  • Inconsistent logger variable usage. This should use compilerYamlHelpersLog instead of compilerYamlLog to be consistent with the rest of the file. See comment on line 178 for details.
	// Skip .github and .agents checkout if an automatic full repository checkout will be added

pkg/workflow/compiler_yaml_helpers.go:192

  • Inconsistent logger variable usage. This should use compilerYamlHelpersLog instead of compilerYamlLog to be consistent with the rest of the file. See comment on line 178 for details.
	// For all modes (dev, script, release), checkout .github and .agents folders

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


// Skip .github checkout if custom steps already contain a full repository checkout
// The full checkout already includes the .github folder, making sparse checkout redundant
// Skip .github and .agents checkout if custom steps already contain a full repository checkout
Copy link

Copilot AI Feb 5, 2026

Choose a reason for hiding this comment

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

Inconsistent logger variable usage. This file defines and uses compilerYamlHelpersLog at line 12, and all other functions in this file use that logger (see lines 31, 35, 49, 62). The log statements on lines 178, 185, and 192 should use compilerYamlHelpersLog instead of compilerYamlLog to be consistent with the rest of the file.

This issue also appears in the following locations of the same file:

  • line 185
  • line 192

Copilot uses AI. Check for mistakes.
@pelikhan pelikhan merged commit 744c09f into main Feb 5, 2026
@pelikhan pelikhan deleted the copilot/checkout-agents-folder-by-default branch February 5, 2026 13:41
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.

2 participants