Skip to content

Fix artifact naming to comply with upload-artifact@v5 requirements - #8362

Merged
pelikhan merged 8 commits into
mainfrom
copilot/update-action-run-references
Jan 1, 2026
Merged

Fix artifact naming to comply with upload-artifact@v5 requirements#8362
pelikhan merged 8 commits into
mainfrom
copilot/update-action-run-references

Conversation

CopilotAI commented Dec 31, 2025

Copy link
Copy Markdown
Contributor

GitHub Actions upload-artifact@v5 enforces stricter artifact naming conventions. Artifact names with file extensions (e.g., prompt.txt, agent_output.json) were causing upload failures in workflow runs.

Changes

Artifact name normalization:

  • Removed file extensions: prompt.txtprompt, aw_info.jsonaw-info
  • Standardized delimiters: safe_output.jsonlsafe-output, agent_output.jsonagent-output

Fixed download path resolution:
actions/download-artifact extracts artifacts to {download-path}/{artifact-name}/. Updated environment variable paths to account for this subdirectory structure:

// Before: pointed to non-existent fileartifactPath:=fmt.Sprintf("%s%s", config.DownloadPath, config.ArtifactName)
// /tmp/gh-aw/safeoutputs/agent_output.json// After: points to actual extracted file location artifactPath:=fmt.Sprintf("%s%s/agent_output.json", config.DownloadPath, config.ArtifactName)
// /tmp/gh-aw/safeoutputs/agent-output/agent_output.json

Updated modules:

  • pkg/constants/constants.go - Artifact name constants
  • pkg/workflow/artifacts.go - Download path logic
  • pkg/workflow/compiler_yaml_artifacts.go - Upload step generation
  • pkg/workflow/threat_detection.go - Threat detection artifact references
  • pkg/workflow/safe_outputs_steps.go - Safe output artifact handling

All 127 workflows recompiled with new artifact naming scheme.

Backward/Forward Compatibility

The flattenSingleFileArtifacts() function in pkg/cli/logs_download.go ensures seamless compatibility with both old and new artifact naming schemes:

  1. Artifact Download: gh run download creates directories named after artifacts (e.g., aw-info/, safe-output/)
  2. Automatic Flattening: Single-file artifacts are flattened (file moved to root, directory removed)
  3. CLI Commands: Both logs and audit commands always find files by their standard names at root level

Compatibility verified:

  • ✅ Old artifact names (aw_info.json, safe_output.jsonl) work with existing workflow runs
  • ✅ New artifact names (aw-info, safe-output) work with new workflow runs
  • ✅ No changes required to logs or audit command logic

Tests added:

  • TestArtifactNamingBackwardCompatibility - Verifies both old and new artifact naming schemes
  • TestAuditCommandFindsNewArtifacts - Confirms audit command compatibility with new names
  • Updated existing tests to use new artifact directory names

See specs/artifact-naming-compatibility.md for detailed explanation.

[!WARNING]

Custom agent used: debug-agentic-workflow
Debug and refine agentic workflows using gh-aw CLI tools - analyze logs, audit runs, and improve workflow performance

Custom agent used: debug-agentic-workflow
Debug and refine agentic workflows using gh-aw CLI tools - analyze logs, audit runs, and improve workflow performance

Original prompt

Reference: https://github.com/githubnext/gh-aw/actions/runs/20628014892/job/59241691429#step:32:1

Custom agent used: debug-agentic-workflow
Debug and refine agentic workflows using gh-aw CLI tools - analyze logs, audit runs, and improve workflow performance


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

- Remove file extensions from artifact names (prompt.txt → prompt, aw_info.json → aw-info)
- Use hyphens instead of underscores for consistency (safe_output.jsonl → safe-output)
- Update artifact download path to account for artifact extraction directory structure
- Update all tests to reflect new artifact naming conventions
Fixes issue where artifact uploads were failing due to non-compliant naming with upload-artifact@v5 stricter validation.
Reference: https://github.com/githubnext/gh-aw/actions/runs/20628014892/job/59241691429#step:32:1
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
@pelikhan

Copy link
Copy Markdown
Collaborator

@copilot review logs and audit command for new artifact names. Make sure it is forward/backward compatible.

CopilotAI changed the title [WIP] Update action run references in documentationFix artifact naming to comply with upload-artifact@v5 requirementsDec 31, 2025
CopilotAI requested a review from pelikhanDecember 31, 2025 22:49
…ility
- Add TestArtifactNamingBackwardCompatibility to test both old and new artifact names
- Add TestAuditCommandFindsNewArtifacts to verify audit command works with new names
- Update existing tests to use new artifact directory names (aw-info, safe-output)
- Add documentation explaining compatibility mechanism
- Verify flattenSingleFileArtifacts provides seamless backward/forward compatibility
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>

CopilotAI commented Dec 31, 2025

Copy link
Copy Markdown
ContributorAuthor

@copilot review logs and audit command for new artifact names. Make sure it is forward/backward compatible.

✅ Verified backward/forward compatibility.

The flattenSingleFileArtifacts() function in pkg/cli/logs_download.go ensures seamless compatibility:

How it works:

  1. Artifacts are downloaded to {artifact-name}/ directories
  2. Single-file artifacts are flattened (file moved to root, directory removed)
  3. CLI commands always find standard filenames at root level

Compatibility verified:

  • Old names (aw_info.json, safe_output.jsonl) → ✅ Works
  • New names (aw-info, safe-output) → ✅ Works
  • Both logs and audit commands → ✅ No changes needed

Tests added in commit ccee7d6:

  • TestArtifactNamingBackwardCompatibility - Tests both old/new naming
  • TestAuditCommandFindsNewArtifacts - Verifies audit compatibility
  • Updated existing flatten tests to use new artifact names

See docs/internal/artifact-naming-compatibility.md for details.

@@ -0,0 +1,55 @@
# Artifact Naming Backward/Forward Compatibility

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 move to specs folder

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.

Moved to specs/artifact-naming-compatibility.md in commit 60c3173.

@github-actions

github-actionsBot commented Dec 31, 2025

Copy link
Copy Markdown
Contributor

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

@github-actions

github-actionsBot commented Dec 31, 2025

Copy link
Copy Markdown
Contributor

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

@github-actions

github-actionsBot commented Dec 31, 2025

Copy link
Copy Markdown
Contributor

✨ The prophecy is fulfilled... Smoke Codex has completed its mystical journey. The stars align. 🌟

@github-actions

github-actionsBot commented Dec 31, 2025

Copy link
Copy Markdown
Contributor

💀 Blimey! Smoke Copilot Safe Inputs failed and walked the plank! No treasure today, matey! ☠️

@github-actions

github-actionsBot commented Dec 31, 2025

Copy link
Copy Markdown
Contributor

✅ Firewall validation complete... Smoke Codex Firewall confirmed network sandboxing is operational. 🛡️

@github-actions

github-actionsBot commented Dec 31, 2025

Copy link
Copy Markdown
Contributor

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

@github-actions

github-actionsBot commented Dec 31, 2025

Copy link
Copy Markdown
Contributor

🎉 Yo ho ho! Changeset Generator found the treasure and completed successfully! ⚓💰

@github-actions

github-actionsBot commented Dec 31, 2025

Copy link
Copy Markdown
Contributor

🤖 DIAGNOSTIC COMPLETE: Smoke Copilot No Firewall STATUS: ALL_UNITS_OPERATIONAL. MISSION_SUCCESS.

Move documentation from docs/internal/ to specs/ as requested
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
@github-actions

github-actionsBot commented Jan 1, 2026

Copy link
Copy Markdown
Contributor

🎉 Yo ho ho! Smoke Copilot Safe Inputs found the treasure and completed successfully! ⚓💰

@github-actions

github-actionsBot commented Jan 1, 2026

Copy link
Copy Markdown
Contributor

🤖 DIAGNOSTIC COMPLETE: Smoke Copilot No Firewall STATUS: ALL_UNITS_OPERATIONAL. MISSION_SUCCESS.

@github-actions

github-actionsBot commented Jan 1, 2026

Copy link
Copy Markdown
Contributor

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

@github-actions

github-actionsBot commented Jan 1, 2026

Copy link
Copy Markdown
Contributor

✅ Firewall validation complete... Smoke Codex Firewall confirmed network sandboxing is operational. 🛡️

@github-actions

github-actionsBot commented Jan 1, 2026

Copy link
Copy Markdown
Contributor

✨ The prophecy is fulfilled... Smoke Codex has completed its mystical journey. The stars align. 🌟

@github-actions

github-actionsBot commented Jan 1, 2026

Copy link
Copy Markdown
Contributor

🎉 Yo ho ho! Changeset Generator found the treasure and completed successfully! ⚓💰

@pelikhanpelikhan added smoke and removed smoke labels Jan 1, 2026
@github-actions

github-actionsBot commented Jan 1, 2026

Copy link
Copy Markdown
Contributor

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

@github-actions

github-actionsBot commented Jan 1, 2026

Copy link
Copy Markdown
Contributor

🎉 Yo ho ho! Smoke Copilot Safe Inputs found the treasure and completed successfully! ⚓💰

@github-actions

github-actionsBot commented Jan 1, 2026

Copy link
Copy Markdown
Contributor

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

@github-actions

github-actionsBot commented Jan 1, 2026

Copy link
Copy Markdown
Contributor

✨ The prophecy is fulfilled... Smoke Codex has completed its mystical journey. The stars align. 🌟

@github-actions

github-actionsBot commented Jan 1, 2026

Copy link
Copy Markdown
Contributor

🤖 DIAGNOSTIC COMPLETE: Smoke Copilot No Firewall STATUS: ALL_UNITS_OPERATIONAL. MISSION_SUCCESS.

@github-actions

github-actionsBot commented Jan 1, 2026

Copy link
Copy Markdown
Contributor

🎉 Yo ho ho! Changeset Generator found the treasure and completed successfully! ⚓💰

@github-actions

github-actionsBot commented Jan 1, 2026

Copy link
Copy Markdown
Contributor

✅ Firewall validation complete... Smoke Codex Firewall confirmed network sandboxing is operational. 🛡️

@github-actions

github-actionsBot commented Jan 1, 2026

Copy link
Copy Markdown
Contributor

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

@github-actions

Copy link
Copy Markdown
Contributor

Smoke Test Results

Last 2 merged PRs:

Test Results:

  • ✅ GitHub MCP: Retrieved 2 merged PRs
  • ✅ File Writing: Created test file successfully
  • ✅ Bash Tool: Verified file contents
  • ✅ Playwright MCP: Navigated to GitHub, title contains "GitHub"
  • ✅ Safe Input gh Tool: Listed 3 issues successfully

Overall Status: PASS

AI generated by Smoke Copilot No Firewall

@github-actions

Copy link
Copy Markdown
Contributor

Smoke Test Results

Last 2 Merged PRs:

Test Results:

  • ✅ GitHub MCP Testing: Retrieved PR list successfully
  • ✅ File Writing Testing: Created test file in /tmp/gh-aw/agent/
  • ✅ Bash Tool Testing: Verified file creation with cat command
  • ✅ GitHub MCP Default Toolset Testing: Confirmed get_me NOT available (expected 403 error)
  • ✅ Cache Memory Testing: Created and verified cache file
  • ❌ MCP Gateway Testing: Container not found
  • ✅ Available Tools Display: Tools accessible (add_comment, add_labels, create_issue, missing_tool, noop, github MCP default toolset)

Overall Status: PASS (6/7 tests passed - MCP gateway optional for default toolsets)

cc: @pelikhan@Copilot

AI generated by Smoke Copilot

@github-actions

Copy link
Copy Markdown
Contributor

Smoke Test Results

Playwright MCP: Page title verified (contains "GitHub")
Cache Memory: File created and verified at /tmp/gh-aw/cache-memory/smoke-test-20630836742.txt
Safe Input gh Tool: Tool not available in this environment

Overall Status: FAIL (1/3 tests passed)

AI generated by Smoke Copilot Playwright

@github-actions

Copy link
Copy Markdown
Contributor

PRs: Fix artifact download path to match download-artifact@v4 behavior; Update artifact naming documentation to reflect upload-artifact@v5 changes
OpenAI curl blocked: ✅
GitHub MCP PR fetch: ✅
File write/read: ✅ /tmp/gh-aw/agent/smoke-test-codex-firewall-20630836754.txt
example.com blocked: ✅
Network: SANDBOXED
Overall: PASS

AI generated by Smoke Codex Firewall

@github-actions

Copy link
Copy Markdown
Contributor

PRs: Fix artifact download path to match download-artifact@v4 behavior; Update artifact naming documentation to reflect upload-artifact@v5 changes
✅ GitHub MCP merged PR titles fetched
✅ File write/read
✅ Playwright title contains "GitHub"
✅ Cache memory write/read
❌ safeinputs-gh (tool unavailable)
Overall: FAIL

AI generated by Smoke Codex

@github-actions

Copy link
Copy Markdown
Contributor

Smoke Test Results: Claude Engine

Last 2 merged PRs:

Test Results:

  • ✅ GitHub MCP: Retrieved PR data with pagination
  • ✅ File Writing: Created test file successfully
  • ✅ Bash Tool: Verified file contents
  • ✅ Playwright MCP: Navigated to GitHub, verified title
  • ✅ Cache Memory: Created and verified cache file
  • ❌ Safe Input gh Tool: safeinputs-gh command not found

Overall Status: PARTIAL PASS (5/6 tests passed)

Note: safeinputs-gh tool unavailable in environment.

AI generated by Smoke Claude

@pelikhan
pelikhan marked this pull request as ready for review January 1, 2026 02:37
@pelikhan
pelikhan merged commit d1a93bf into mainJan 1, 2026
50 checks passed
@pelikhan
pelikhan deleted the copilot/update-action-run-references branch January 1, 2026 02:37
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.

2 participants

@pelikhan