Skip to content

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

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

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

Conversation

CopilotAI commented Feb 5, 2026

Copy link
Copy Markdown
Contributor

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.

CopilotAIand 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>
CopilotAI changed the title [WIP] Add default checkout for .agents folder in agent jobInclude .agents folder in sparse checkout for agent jobsFeb 5, 2026
CopilotAI requested a review from pelikhanFebruary 5, 2026 13:00
@pelikhan

Copy link
Copy Markdown
Collaborator

@copilot .agent maybe missing, do not check

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

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 this is implied by sparse checkout

Copy link
Copy Markdown
ContributorAuthor

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)

@github-actions

github-actionsBot commented Feb 5, 2026

Copy link
Copy Markdown
Contributor

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

@github-actions

Copy link
Copy Markdown
Contributor

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

@github-actions

github-actionsBot commented Feb 5, 2026

Copy link
Copy Markdown
Contributor

Changeset Generator failed. Please review the logs for details.

@github-actions

github-actionsBot commented Feb 5, 2026

Copy link
Copy Markdown
Contributor

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

CopilotAI commented Feb 5, 2026

Copy link
Copy Markdown
ContributorAuthor

@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
Copy Markdown
Contributor

Agent Container Tool Check

ToolStatusVersion
bashGNU bash, version 5.2.21(1)-release
shavailable
gitgit version 2.52.0
jqjq-1.7
yqyq version v4.50.1
curlcurl 8.5.0
ghgh version 2.86.0
nodev20.20.0
python3Python 3.12.3
gogo version go1.24.12
javaavailable (detection issue - needs fix)
dotnetnot 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
Copy Markdown
Contributor

🤖 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
Copy Markdown
Contributor

@github-actions

Copy link
Copy Markdown
Contributor

📰 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
CopilotAI review requested due to automatic review settings February 5, 2026 13:36
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

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.

FileDescription
pkg/workflow/compiler_yaml_helpers.goModified generateCheckoutGitHubFolder() to include .agents in sparse-checkout configuration, updated function documentation and log messages
pkg/workflow/github_folder_checkout_optimization_test.goUpdated test assertions to verify both .github and .agents folders are included in sparse checkout
pkg/workflow/compiler_yaml_helpers_test.goAdded 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

CopilotAIFeb 5, 2026

Copy link

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 mainFeb 5, 2026
@pelikhan
pelikhan deleted the copilot/checkout-agents-folder-by-default branch February 5, 2026 13:41
Sign up for freeto 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.

3 participants

@pelikhan