Skip to content

refactor: share setup preview environment - #159

Open
ivanmilevtues wants to merge 1 commit into
mainfrom
refactor/preview-composite
Open

ivanmilevtues wants to merge 1 commit into
mainfrom
refactor/preview-composite

Conversation

@ivanmilevtues

Copy link
Copy Markdown
Member

Why

Addresses Svilen's duplication comment on merged PR #152. Based on latest origin/main, including the 1.17.0 release.

Change

Define the 14 shared preview environment bindings once, serialize them into a same-job step output, and consume them with fromJSON in each preview. Keep the three explicit analysis/upload pairs: their distinct artifacts, conditions, per-step failure isolation, and the notification between the first and second previews are unchanged. MAX_PREVIEWS stays 3; incremental analysis is untouched. KEEP_AUTH=true is command-scoped on previews 1 and 2; preview 3 and the existing always() cleanup retain their behavior. Provider credentials remain in the existing auth files, not this output. No environment is exported into the caller's GITHUB_ENV.

This deliberately uses supported composite step environment expressions rather than YAML anchors: the runner's action YAML reader rejects anchors, while its step environment converter accepts expressions. Upload boilerplate remains because separate upload steps preserve existing artifact semantics.

Verification

  • python -m unittest discover -s tests -v: 273 tests ran, OK, 7 skipped (pinned engine not installed locally).
  • Black check and git diff --check passed.
  • Scratch validation compared all 14 environment bindings against main and confirmed unchanged upload definitions, conditions, notification, cleanup, and ordering.
  • Executed the actual JSON-output shell with quotes/newlines/shell metacharacters and malformed JSON; verified round-trip and failure handling.
  • Executed all three preview commands with success/failure probes: auth retention was true, true, false in both cases.
  • Updated only the existing, unprotected credential-wiring test to recognize command-scoped KEEP_AUTH. No protected tests changed.

Limitations: local tests do not execute GitHub's composite expression evaluator, real artifact service, email notification delivery, or live LLM analysis. Normal PR CI also does not exercise the setup-branch-only preview path end to end. Engine compatibility is delegated to existing CI.

Keep separate analysis and upload steps while defining their common environment once through a composite-compatible JSON step output.

Amp-Thread-ID: https://ampcode.com/threads/T-01a1836f-dd66-7523-8dfe-445e32623212
Co-authored-by: Ivan Milev <ivanmilevtues@gmail.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-28T17:04:39.175889Z b0e9a5a PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@codeboarding-review

codeboarding-review Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

CodeBoarding review

Status: 0 changed components (no analysed file changed)

See the full change in CodeBoarding.

Compared against the merge base: this branch is 1 commit behind main.

graph LR
    n_action_support_scripts["action_support_scripts"]
    classDef added fill:#1f883d,stroke:#0b5d23,color:#ffffff;
    classDef modified fill:#bf8700,stroke:#7d4e00,color:#ffffff;
    classDef deleted fill:#cf222e,stroke:#82071e,color:#ffffff,stroke-dasharray:5 3;
Loading

download artifacts · run 40731654950

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