-
Notifications
You must be signed in to change notification settings - Fork 43
Unify safe output processing into single handler manager with compiler-managed flag #12967
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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>
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>
|
@copilot the package "@actions/github" is not available in GitHub actions vm, so it needs to be npm installed. |
…ipt context
The @actions/github package is not available in GitHub Actions VM at runtime.
Instead, use the global github object provided by github-script action which
is already authenticated with the appropriate token (GH_AW_GITHUB_TOKEN for
regular handlers, GH_AW_PROJECT_GITHUB_TOKEN for project handlers).
Changes:
- Removed require("@actions/github") import
- Removed setupProjectGitHubClient() function
- Updated loadHandlers() to not require octokit parameter
- Both regular and project handlers now use the global github object
- Updated documentation to clarify token authentication approach
- Removed setupProjectGitHubClient test (5 tests now passing)
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Fixed in commit 165be7d. Removed the |
|
@copilot unify temporarary map into a single map. Temp ids are unique . |
Since temporary IDs are unique (randomly generated 12-char hex strings),
we can use a single unified map instead of separate temporaryIdMap and
temporaryProjectMap.
Unified structure:
- Issue/PR: temporary_id -> {repo: string, number: number}
- Project: temporary_id -> {projectUrl: string}
Changes:
- Removed separate temporaryProjectMap from processMessages()
- Updated temporaryIdMap to store both issue/PR and project references
- Updated all project handler signatures to use unified map
- create_project now stores {projectUrl} in unified map
- update_project resolves project URLs from unified map
- Updated JSDoc to reflect unified map structure
- Removed temporary_project_map output (now part of temporary_id_map)
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Unified in commit e4a1af3. Since temporary IDs are unique, merged |
|
@copilot the project handle need a DIFFERENT TOKEN! they use the project token, so they need a different octokit client, so we need the actions/github package installed
|
Project handlers require a different GitHub token (GH_AW_PROJECT_GITHUB_TOKEN) with Projects permissions. This requires a separate Octokit client instance. Changes: - Re-added @actions/github import and getOctokit usage - Added setupProjectGitHubClient() to create separate Octokit instance - Updated setup.sh to npm install @actions/github at runtime - Project handlers temporarily use project Octokit via global.github swap - Updated loadHandlers() to accept projectOctokit parameter - Updated processMessages() to accept projectOctokit parameter - Project handlers swap github object before/after execution - Added tests for setupProjectGitHubClient (7 tests now passing) Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Fixed in commit 05b2f2d.
|
|
@copilot do NOT override the global.github in the handler loop. Instead pass the octokit client as a parameter to the handler (it will also make testing cleaner). |
|
@copilot merge main and recompile |
Completed merge from main branch with conflict resolution: - Resolved conflicts in ci-doctor.md (kept our version with safe-output-projects changes) - Resolved conflicts in ci-doctor.lock.yml (recompiled) - Resolved conflicts in agent-factory-status.mdx (kept main's version) - Fixed functional-pragmatist.md workflow: removed invalid cache tool configuration - Successfully recompiled all 147 workflows - All workflows now compile without errors Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Completed in commit 8d26b1e. Merged main branch with conflict resolution and successfully recompiled all 147 workflows. Fixed functional-pragmatist.md workflow compilation error that was present in main (removed invalid cache tool configuration). All workflows now compile without errors. |
|
@copilot merge main and recompile |
…tput-processing # Conflicts: # .github/workflows/ci-doctor.lock.yml # .github/workflows/ci-doctor.md # .github/workflows/functional-pragmatist.lock.yml # .github/workflows/functional-pragmatist.md # docs/src/content/docs/agent-factory-status.mdx
Second merge from main branch with additional changes: - Merged commits 08055e9 through 196ba42 (15 new commits) - Resolved conflicts in ci-doctor.md: added noop tool to safe-outputs - Resolved conflicts in ci-doctor.md: updated Investigation Protocol with noop guidance - Resolved conflicts in functional-pragmatist.md: kept working version without invalid cache tool - Resolved conflicts in agent-factory-status.mdx: accepted main's version - Successfully recompiled all 147 workflows - All workflows compile without errors Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Completed in commits 64e9b4c and 6593fff. Merged 15 new commits from main branch including:
|
|
🎉 Yo ho ho! Changeset Generator found the treasure and completed successfully! ⚓💰 |
|
✨ The prophecy is fulfilled... Smoke Codex has completed its mystical journey. The stars align. 🌟 |
|
📰 BREAKING: Smoke Copilot is now investigating this pull request. Sources say the story is developing... |
|
🎬 THE END — Smoke Claude MISSION: ACCOMPLISHED! The hero saves the day! ✨ |
Agent Container Tool Check
Result: 10/12 tools available Missing Tools: java, dotnet
|
Smoke Test ResultsPRs Reviewed:
Overall Status: ✅ PASS cc @pelikhan
|
|
Fix workflow compilation error in functional-pragmatist.md
|
|
📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤 |
Smoke Test ResultsPR #12989: Fix workflow compilation error
Overall Status: PASS ✅
|
Implementation Complete: Unified Safe Output Processing ✅
Successfully unified the processing of regular and project-related safe outputs into a single handler manager with proper token separation, clean parameter passing, automatic compiler-managed flag for package installation, lazy-loading optimizations, and integration with latest main branch changes.
Summary of Changes
1. New Unified Handler Manager
File:
actions/setup/js/safe_output_unified_handler_manager.cjsgithubobject from github-script (GH_AW_GITHUB_TOKEN)temporary_id_map(unified map containing all temporary ID types)2. Campaign Labels Helper
File:
actions/setup/js/campaign_labels.cjs(NEW)formatCampaignLabel()- Normalizes campaign IDs to label formatgetCampaignLabelsFromEnv()- Retrieves campaign labels from environment variables3. Runtime Package Installation (Compiler-Managed)
Files:
actions/setup/action.yml,actions/setup/setup.shsafe-output-projectsboolean input flag to the setup action (default: false)@actions/github@^7.0.0package runs ONLY when flag is true/opt/gh-aw/actionsdirectory4. Compiler Auto-Detection
Files:
compiler_safe_outputs_core.go,compiler_yaml_helpers.go,compiler_safe_outputs_job.go, and 7 othershasProjectRelatedSafeOutputs()helper functiongenerateSetupStep()to acceptenableSafeOutputProjectsboolean parametertrueonly for safe_outputs job when project types are detectedcreate-project,update-project,copy-project,create-project-status-updatefalse5. Updated Project Handlers
Files:
create_project.cjs,copy_project.cjs,create_project_status_update.cjs,update_project.cjsasync function main(config, githubClient)async function handle(message, temporaryIdMap, resolvedTemporaryIds)6. Tests & Validation
Files:
safe_output_unified_handler_manager.test.cjs,cjs_require_validation_test.go7. Main Branch Integration (2 Merges)
First merge (commit 8d26b1e):
Second merge (this commit):
Clean Architecture
Token Separation:
githubobject from github-script (GH_AW_GITHUB_TOKEN)Test Results
Requirements Met
safe-output-projectsOriginal prompt
💡 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.