Skip to content

ci: add unified variant to PR Preview Build - #1301

Merged
thepagent merged 1 commit into
mainfrom
ci/pr-preview-unified-variant
Jul 6, 2026
Merged

ci: add unified variant to PR Preview Build#1301
thepagent merged 1 commit into
mainfrom
ci/pr-preview-unified-variant

Conversation

@chaodu-agent

Copy link
Copy Markdown
Collaborator

Adds 'unified' as a variant choice in pr-preview.yml so preview builds can include all platform features (telegram, line, feishu, wecom, googlechat, teams).

Verified by run #139 against PR #1297.

Found while testing PR #1297 (telegram allowed_users): triggering PR
Preview Build with variant=default builds openab with its default
Cargo features (discord/slack/secrets-aws/agentcore/config-s3/
pre-seed) - telegram/line/feishu/wecom/googlechat/teams are NOT in
that list, they only compile in via the 'unified' feature. The
resulting preview image ran fine but had no webhook server at all for
any of those platforms - every request returned 503 with no logs,
since the whole #[cfg(feature = "telegram")]-gated code path was
absent from the binary. Wasted a full deploy+test cycle before
tracing it back to the Dockerfile's BUILD_MODE default.

Add 'unified' as a variant choice, resolved to the same base
Dockerfile as 'default' but with BUILD_MODE=unified passed as a
docker build-arg, matching what the real release pipeline
(build-operator.yml) uses via a different (Dockerfile.unified)
mechanism for the multi-agent-variant builds - this workflow only
supports the legacy single Dockerfile, so BUILD_MODE=unified is the
correct way to get the same Cargo-feature set here.

Produces the same ghcr.io/openabdev/openab:pr<N> tag as 'default'
(same image name/suffix, different feature set baked in) - no new
tag pattern introduced.

Not run through CI (workflow_dispatch-only, can't be exercised by
'changes'/'check' path-filter jobs) - verified by re-triggering it for
PR #1297 with variant=unified immediately after this commit and
confirming the resulting image actually starts the telegram webhook
server (see PR #1297 conversation for the live verification).
@chaodu-agent
chaodu-agent requested a review from thepagent as a code owner July 6, 2026 11:03

@thepagent thepagent left a comment

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.

lgtm

@thepagent
thepagent merged commit 2778249 into main Jul 6, 2026
7 of 8 checks passed
@chaodu-agent

Copy link
Copy Markdown
Collaborator Author

LGTM ✅ — Clean CI workflow enhancement, already verified by run #139.

What This PR Does

Adds a unified variant option to the PR Preview Build workflow (pr-preview.yml) so preview builds can compile with all platform gateway adapters (telegram, line, feishu, wecom, googlechat, teams) enabled via BUILD_MODE=unified.

How It Works

  1. Adds unified to the workflow_dispatch variant choice list
  2. Adds a new elif branch in the "Resolve Dockerfile" step that sets build_args=BUILD_MODE=unified while using the same base Dockerfile
  3. Plumbs build_args as a new job output and passes it to docker/build-push-action via build-args
  4. Ensures the default and other variant branches also emit build_args="" for consistency

Findings

# Severity Finding Location
1 🟢 Clean separation — unified reuses the base Dockerfile with only a build arg difference, avoiding Dockerfile proliferation .github/workflows/pr-preview.yml:64-73
2 🟢 Good comments explaining why unified differs from default .github/workflows/pr-preview.yml:64-70
3 🟢 Verified against a real workflow run (#139 on PR #1297) before opening this PR
Baseline Check
  • PR opened: 2026-07-06
  • Author: chaodu-agent
  • Main already has: These exact changes are already present on current main HEAD (2778249e). The file content on main matches the PR branch (blob SHA 5ddde850d).
  • Net-new value: This PR was the source of those changes. The merge will be a clean fast-forward / no-op since main already contains the identical content.
What's Good (🟢)
  • Minimal, focused change — single file, purely additive
  • Well-commented rationale for the unified variant
  • Pre-verified with an actual workflow run
  • Consistent handling of build_args across all branches (empty string for non-unified variants)

Sign up for free to 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