Skip to content

chore: upload wizard artifacts to s3#941

Open
joshsny wants to merge 6 commits into
mainfrom
js/upload-artifacts-to-s3-conflicts
Open

chore: upload wizard artifacts to s3#941
joshsny wants to merge 6 commits into
mainfrom
js/upload-artifacts-to-s3-conflicts

Conversation

@joshsny
Copy link
Copy Markdown

@joshsny joshsny commented Mar 20, 2026

Summary

  • Adds OIDC-based AWS credential configuration to the wizard-ci workflow
  • Uploads wizard CI artifacts (output logs, context-mill resources, skills resources, YARA reports) to an S3 bucket
  • Artifacts are organized by trigger ID and app name: s3://<bucket>/<trigger-id>/<app-name>/
  • Uses continue-on-error: true so S3 upload failures don't break the CI run

Setup required

After the corresponding posthog-cloud-infra PR is applied, three secrets need to be added to this repo:

  • AWS_WIZARD_ARTIFACTS_ROLE_ARN — the IAM role ARN from terraform output
  • AWS_WIZARD_ARTIFACTS_REGIONus-east-1
  • AWS_WIZARD_ARTIFACTS_BUCKETposthog-wizard-artifacts-prod-us

Test plan

  • Infra PR is applied first to create the S3 bucket and IAM role
  • Secrets are configured in wizard-workbench repo settings
  • Run a wizard-ci workflow and verify artifacts appear in S3 under the expected path

🤖 Generated with Claude Code

joshsny and others added 3 commits March 20, 2026 20:58
Add OIDC-based AWS credential configuration and S3 upload steps to the
wizard-ci workflow. Artifacts (wizard output logs, context-mill resources,
skills resources, YARA reports) are uploaded to an S3 bucket organized by
trigger ID and app name.

Requires three secrets to be configured:
- AWS_WIZARD_ARTIFACTS_ROLE_ARN
- AWS_WIZARD_ARTIFACTS_REGION
- AWS_WIZARD_ARTIFACTS_BUCKET

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
GitHub artifacts on a public repo are accessible to anyone.
Since these contain CI output that should be private, remove
the upload-artifact steps and rely solely on S3.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@joshsny joshsny changed the title Upload wizard CI artifacts to S3 chore: upload wizard artifacts to s3 Mar 20, 2026
@joshsny joshsny requested a review from a team March 20, 2026 21:25
Copy link
Copy Markdown
Contributor

@gewenyu99 gewenyu99 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Noice! We do just need to add the log file to this, tho. I think these suggestions work :squint:

Comment thread .github/workflows/wizard-ci.yml Outdated
TRIGGER_ID="${{ needs.discover.outputs.trigger_id }}"
SAFE_APP="${{ matrix.app }}"
SAFE_APP="${SAFE_APP//\//-}"
S3_PREFIX="s3://${{ secrets.AWS_WIZARD_ARTIFACTS_BUCKET }}/${TRIGGER_ID}/${SAFE_APP}"
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.

Trigger ID is a UID yah?


aws s3 cp wizard-output.log "${S3_PREFIX}/wizard-output.log" || true
aws s3 cp context-mill-mcp-resources.zip "${S3_PREFIX}/context-mill-mcp-resources.zip" || true
aws s3 cp skills-mcp-resources.zip "${S3_PREFIX}/skills-mcp-resources.zip" || true
Copy link
Copy Markdown
Contributor

@gewenyu99 gewenyu99 Mar 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
aws s3 cp skills-mcp-resources.zip "${S3_PREFIX}/skills-mcp-resources.zip" || true
aws s3 cp wizard-log.log "/tmp/posthog-wizard.log" || true

@gewenyu99
Copy link
Copy Markdown
Contributor

@joshsny can we merge this yet?

gewenyu99 added 3 commits May 27, 2026 14:52
…ctor

Adopts main's split wizard-ci structure (Run Wizard CI / Execute wizard /
Process results), positions the new S3 upload after Process results so
resources zips and YARA JSON are on disk, and updates Label and close PR
to read steps.process-results.outputs.pr_number.

Addresses review feedback on #941 by replacing the wizard-output.log
upload with /tmp/posthog-wizard.log (the wizard's verbose internal log,
the file that actually carries the interesting debug info). The wrapper
stdout that wizard-output.log captured is already retained in the
GitHub Actions step log for 90 days.

Sets POSTHOG_WIZARD_LOG_DIR=/tmp explicitly in the Execute wizard and
Upload artifacts to S3 steps so the source path and upload path stay in
sync; uses ${POSTHOG_WIZARD_LOG_DIR}/posthog-wizard.log to derive the
file. Renames the YARA destination to posthog-wizard-yara-report.json
to match the source basename.

Moves matrix.app and bucket interpolations into env vars to match the
shell-step pattern that main now uses elsewhere in this job.

Generated-By: PostHog Code
Task-Id: 28becca6-325e-4d34-9779-bdb231e3b5b4
Temporarily replaces wizard-ci.yml with main's version so that the
subsequent merge of main into this branch can be performed via the
signed-merge API (which fails on conflicts). The next commit restores
our resolved content on top of the merged history.

Generated-By: PostHog Code
Task-Id: 28becca6-325e-4d34-9779-bdb231e3b5b4
The previous commit temporarily aligned wizard-ci.yml with main so the
file content would match across both branches. This commit restores the
S3 upload step, removes the GitHub artifact upload steps it replaces,
and wires up POSTHOG_WIZARD_LOG_DIR for both Execute wizard and Upload
artifacts to S3 so the source and destination paths stay in sync.

Net of the prior commit, the only diff vs main in this file is:
- permissions.id-token: write on the wizard-ci job
- Drop "Prepare artifact name", "Upload context-mill resources",
  "Upload skills resources" (replaced by AWS S3 upload)
- Add Configure AWS credentials + Upload artifacts to S3 steps after
  Process results
- POSTHOG_WIZARD_LOG_DIR=/tmp env var on Execute wizard and Upload
  steps, used to derive the wizard log source path
- Uploads /tmp/posthog-wizard.log (wizard verbose log) instead of
  wizard-output.log (wrapper stdout is in Actions logs already)
- YARA report uploaded as posthog-wizard-yara-report.json to match
  the source basename

Generated-By: PostHog Code
Task-Id: 28becca6-325e-4d34-9779-bdb231e3b5b4
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