Add repo-memory tool for git-based persistent storage with threat detection integration#5433
Add repo-memory tool for git-based persistent storage with threat detection integration#5433
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
…ry with markdown-only constraint Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Done! Changes in commit dc19331: Test workflow added:
Deep-report workflow updated:
The workflow now stores long-term insights in version-controlled markdown files on the |
|
@copilot move test-repo-memory to pkg/cli/workflows |
…ws and rename to test-copilot-repo-memory Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Done in commit 6be5281. Changed default max file size from 1MB (1048576 bytes) to 10KB (10240 bytes). Updated in:
All tests pass. Generated workflows now display "10240 bytes (0.01 MB)" in agent prompts and validate with "max: 10240 bytes" in push steps. |
|
@copilot update daily firewall report agentic workflow to use repo-memory |
…script action - Created push_repo_memory.cjs JavaScript implementation - Removed push_repo_memory.sh shell script - Updated repo_memory.go to use github-script action instead of inline bash - Added embed directive for push_repo_memory.cjs in js.go - Removed shell script embed from sh.go - JavaScript implementation provides same functionality: - Git user configuration as github-actions[bot] - File pattern validation with glob filters - File size and count validation - Merge conflict resolution with ours strategy - Environment variable-based configuration - All tests passing, code formatted and linted - Workflows compile successfully with new JavaScript-based implementation Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
@copilot reuse helper code that configures the github user from other jobs in the compiler, do not set it up on the JavaScript |
…avaScript - Added call to generateGitConfigurationSteps() in buildPushRepoMemoryJob - Removed git user configuration from push_repo_memory.cjs JavaScript file - Git user now configured globally as github-actions[bot] via compiler helper - Fixed FILE_GLOB_FILTER YAML quoting to prevent alias interpretation - Updated test expectations from shell variables to JavaScript template literals - All tests passing, code formatted and linted Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Done in commit b11490b. Changes:
The job now uses the shared git configuration helper that sets up github-actions[bot] globally, consistent with all other git operations in the codebase. |
|
|
@copilot the push to repo memory is missing the step that copies the files from artifact folder into the git repository checkout folder. Then the push must be done from the git folder. Use javascript to copy each file and validate file name, size restrictions on each file. |
…ushing
Major architectural fix for push_repo_memory job:
- Download artifacts to temp location
- Checkout/create memory branch in git repo
- Copy files from artifact to git repo with validation
- Validate file names, sizes, and counts before copying
- Commit and push from git repository (not artifact directory)
JavaScript implementation changes:
- Added ARTIFACT_DIR and MEMORY_ID environment variables
- Removed MEMORY_DIR (was confusing - artifact vs repo)
- Files copied from artifact/memory/{id}/ to repo/memory/{id}/
- Validation happens during copy (not after git operations)
- Git operations now work correctly on actual repository
Go compiler changes:
- Updated buildPushRepoMemoryJob to pass ARTIFACT_DIR and MEMORY_ID
- Changed from MEMORY_DIR to ARTIFACT_DIR in environment variables
Test updates:
- Updated integration test expectations for new validation messages
- All unit tests passing
This fixes the critical issue where git operations were being performed on
the artifact directory instead of the checked-out repository.
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Done in commit 107d9ab. Fixed the workflow:
Environment variables changed:
All validations happen in JavaScript during the copy operation, before any git operations. |
|
@copilot configure actions/checkout to only configure git, but not checkout the repo content in the push repo memory job |
…sh_repo_memory job - Added sparse-checkout: . parameter to actions/checkout in push_repo_memory job - This avoids downloading repository files since we immediately checkout the memory branch - Reduces unnecessary data transfer and speeds up the workflow - Git is properly configured but no repository content is checked out - All tests passing, workflows recompiled successfully Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Done in commit 4da5496. Added |
|
|
@copilot update the JavaScript that pushes the changes to assume a sparse checkout and run git commands accordingly |
- Added git sparse-checkout disable before branch operations - Ensures repository is fully accessible after sparse checkout setup - Handles case where sparse checkout wasn't enabled (ignores error) - All git operations now work correctly with sparse checkout configuration - Updated compiled workflows with new JavaScript implementation - All tests passing Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Done in commit 2d675bd. Added |
✅ Dev Hawk Report - SuccessWorkflow Run: #3041
The Dev workflow completed successfully! 🎉 What Was ValidatedThis run validated the latest sparse checkout handling improvements:
The workflow confirms that all build, test, and compilation steps pass with the updated
|
✅ Dev Hawk Report - SuccessWorkflow Run: #3042
The Dev workflow completed successfully! 🎉 SummaryThis workflow run validated the sparse checkout handling improvements for the repo-memory tool:
The implementation correctly handles the case where
|
Implementation Plan for repo-memory Tool ✅
This PR adds a "repo-memory" tool that stores persistent data in git branches rather than GitHub Actions cache, enabling version-controlled memory with automatic conflict resolution and threat detection integration.
Requirements Checklist:
Latest Changes (Sparse Checkout Handling):
JavaScript Update for Sparse Checkout:
git sparse-checkout disablecommand before branch operationsWhy This Is Needed:
When
sparse-checkout: .is used in actions/checkout, only git metadata is initialized without checking out file contents. Before we can work with the memory branch, we need to disable sparse checkout so we can:Implementation Details:
Benefits:
Complete Workflow:
sparse-checkout: .(fast, no file downloads)All tests passing, workflows compiled successfully.
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.