Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 6, 2026

The upload_assets job was failing to download a non-existent safe-outputs-assets artifact, preventing generated assets (charts, images) from being published to orphaned branches.

Changes

  • publish_assets.go: Added generateSafeOutputsAssetsArtifactUpload() function to create a dedicated artifact upload step for safe-outputs assets
  • compiler_yaml_main_job.go: Added call to generate separate assets artifact upload; removed code that added assets to unified agent-artifacts
  • upload_assets.cjs: Modified to fail immediately when asset files cannot be found or are corrupted, changing from warnings to failures for missing files, SHA mismatches, and invalid asset entries

Result

Assets are now uploaded as a separate, dedicated artifact:

# Upload safe-outputs assets for upload_assets job
- name: Upload safe-outputs assets
  if: always()
  uses: actions/[email protected]
  with:
    name: safe-outputs-assets
    path: /tmp/gh-aw/safeoutputs/assets/
    retention-days: 1
    if-no-files-found: ignore

The upload_assets job downloads this separate safe-outputs-assets artifact to access generated assets at /tmp/gh-aw/safeoutputs/assets/. This clean separation ensures assets are handled independently from other agent artifacts.

The JavaScript upload handler now fails the job immediately if any expected asset is missing, corrupted (SHA mismatch), or cannot be processed, providing clear error feedback rather than silently continuing with warnings.

Original prompt

Reference: https://github.com/githubnext/gh-aw/actions/runs/20723113042/job/59492981185#step:6:

Review what the safe-output-assets artifact is not generated anymore and restore the code. Look at the same agentic workflow compiled in the branch v0.33.5


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

@pelikhan
Copy link
Contributor

pelikhan commented Jan 6, 2026

@copilot put asset files in separate artifact "assets", not in agent-outputs

Copilot AI changed the title [WIP] Restore safe-output-assets artifact generation Include assets in agent-output artifact for upload_assets job Jan 6, 2026
Copilot AI requested a review from pelikhan January 6, 2026 03:26
Copy link
Contributor Author

Copilot AI commented Jan 6, 2026

@copilot put asset files in separate artifact "assets", not in agent-outputs

Done. Assets are now uploaded as a separate artifact named "safe-outputs-assets" instead of being included in agent-output. Commit: f1a7b66

Copilot AI changed the title Include assets in agent-output artifact for upload_assets job Create separate safe-outputs-assets artifact for upload_assets job Jan 6, 2026
@pelikhan
Copy link
Contributor

pelikhan commented Jan 6, 2026

@copilot update daily code metrics

Copy link
Contributor Author

Copilot AI commented Jan 6, 2026

@copilot update daily code metrics

Could you clarify what needs to be updated in the daily code metrics workflow? The workflow compiles successfully and the safe-outputs-assets artifact changes have been applied. Are you referring to updating the workflow content, recompiling it, or something else?

@pelikhan
Copy link
Contributor

pelikhan commented Jan 6, 2026

@copilot review the code generated in the upload_assets job. There needs to be a download artifact step to download the assets artifact and the JavaScript must be pointing at the correct folder

Copy link
Contributor Author

Copilot AI commented Jan 6, 2026

@copilot review the code generated in the upload_assets job. There needs to be a download artifact step to download the assets artifact and the JavaScript must be pointing at the correct folder

Reviewed the upload_assets job. The implementation is correct:

  1. ✅ Download artifact step exists: Downloads safe-outputs-assets to /tmp/gh-aw/safeoutputs/assets/
  2. ✅ JavaScript points to correct folder: upload_assets.cjs line 130 looks for assets at /tmp/gh-aw/safeoutputs/assets/

The paths match correctly between the download step and the JavaScript processing code.

@pelikhan
Copy link
Contributor

pelikhan commented Jan 6, 2026

@copilot the JavaScript that uploads assets should fail if it cannot find one of the asset

Modified the JavaScript to use core.setFailed() instead of core.warning() when:
- Asset file is not found at expected path
- SHA mismatch occurs between expected and computed hash
- Invalid asset entry is missing required fields
- File copy operation fails

This ensures the upload_assets job fails immediately if any asset cannot be processed, providing clear feedback about missing or corrupted files.

Co-authored-by: pelikhan <[email protected]>
Copy link
Contributor Author

Copilot AI commented Jan 6, 2026

@copilot the JavaScript that uploads assets should fail if it cannot find one of the asset

Modified upload_assets.cjs to fail immediately when assets cannot be found. Changed from core.warning() to core.setFailed() for:

  • Missing asset files
  • SHA mismatches
  • Invalid asset entries
  • File copy failures

Commit: 70ec338

@pelikhan pelikhan marked this pull request as ready for review January 6, 2026 06:02
@pelikhan pelikhan merged commit bf216e9 into main Jan 6, 2026
47 of 49 checks passed
@pelikhan pelikhan deleted the copilot/restore-safe-output-assets branch January 6, 2026 06:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants