Skip to content

ci: add workflow_dispatch to Deploy for cross-repo triggers#263

Open
leostar0412 wants to merge 2 commits into
cppalliance:developfrom
leostar0412:ci/deploy-workflow-dispatch
Open

ci: add workflow_dispatch to Deploy for cross-repo triggers#263
leostar0412 wants to merge 2 commits into
cppalliance:developfrom
leostar0412:ci/deploy-workflow-dispatch

Conversation

@leostar0412
Copy link
Copy Markdown
Collaborator

@leostar0412 leostar0412 commented Jun 3, 2026

Summary

  • Extends the Deploy workflow with workflow_dispatch and a ref input (develop | main).
  • Keeps the existing workflow_run trigger after CI on push unchanged.
  • BRANCH, environment (staging / production), and SCRIPT_URL work for both triggers.

Apps touched

Allows a trusted external workflow (e.g. a private overlay repo) to start Deploy after its own CI passes, without adding overlay-specific names or secrets to this public repository. Server deploy still uses environment DEPLOY_SCRIPT_URL when configured.

Test plan

  • python -m pytest (or scoped: python -m pytest <app>/tests)
  • uv run pyright (if typed code changed)
  • lint-imports (if imports or cross-app coupling changed)
  • App command smoke-tested (if collector/command changed):

Related cppalliance/wg21-reflector-collector#2

Summary by CodeRabbit

  • New Features

    • Added manual deployment trigger with selectable branch (develop or main).
  • Chores

    • Workflow now supports both CI-triggered and manual deployments.
    • Deployment gating expanded to allow manual runs alongside CI completion.
    • Concurrency, target environment selection, and script source now adapt based on whether the run is manual or CI-driven.

@leostar0412 leostar0412 self-assigned this Jun 3, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jun 3, 2026

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 9c9a84c1-ad74-4537-9f57-f44e382d67aa

📥 Commits

Reviewing files that changed from the base of the PR and between ce69846 and 42ff828.

📒 Files selected for processing (1)
  • .github/workflows/deploy.yml

📝 Walkthrough

Walkthrough

The deploy workflow now supports manual workflow_dispatch with a required ref (develop|main). Concurrency, job gating, environment selection, BRANCH, and SCRIPT_URL resolution use the dispatch ref for manual runs or the workflow_run head branch/sha for CI-triggered runs.

Changes

Manual Deployment Support

Layer / File(s) Summary
Manual dispatch trigger configuration
.github/workflows/deploy.yml
Adds workflow_dispatch with a required ref input restricted to develop or main.
Concurrency, gating, and environment selection
.github/workflows/deploy.yml
concurrency.group keys off dispatch input or CI head branch; jobs.deploy.if allows workflow_dispatch or CI workflow_run; jobs.deploy.environment and env.BRANCH derive from dispatch ref when present otherwise from workflow_run.head_branch; env.SCRIPT_URL uses the dispatch ref for manual runs and workflow_run.head_sha for CI runs.

Possibly Related PRs

Estimated Code Review Effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 I press the button, choose main or develop,
A gentle deploy with a soft little hop,
Branch or CI, the workflow knows where to go,
Scripts picked rightly, then off goes the job,
the rabbit smiles and sips some tea.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive The description includes a Summary and Apps touched section, but the Test plan is incomplete with unchecked items and lacks verification details; other required sections are missing or incomplete. Complete the Test plan by checking applicable items and adding actual test results; clarify which apps were tested and ensure all required documentation sections are addressed.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: adding workflow_dispatch trigger to the Deploy workflow for cross-repository triggers.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/deploy.yml:
- Line 38: SCRIPT_URL is constructed using github.sha for workflow_dispatch
while BRANCH uses github.event.inputs.ref, which can cause deploy script/branch
mismatch; change SCRIPT_URL to use the same computed ref/variable as BRANCH (or
introduce a single REF variable used by both) so both the branch to deploy and
the URL to fetch the deploy script resolve from the same source (use
github.event.inputs.ref when present for workflow_dispatch, otherwise fall back
to github.sha) and update the SCRIPT_URL expression to reference that shared REF
variable instead of github.sha.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 5bf331da-0c88-4e47-8a6c-2ebb08a9a0e0

📥 Commits

Reviewing files that changed from the base of the PR and between ce69846 and 5332d57.

📒 Files selected for processing (1)
  • .github/workflows/deploy.yml

Comment thread .github/workflows/deploy.yml Outdated
@leostar0412
Copy link
Copy Markdown
Collaborator Author

@coderabbitai full review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jun 3, 2026

✅ Action performed

Full review finished.

@leostar0412 leostar0412 requested a review from jonathanMLDev June 3, 2026 20:52
Copy link
Copy Markdown
Collaborator

@jonathanMLDev jonathanMLDev left a comment

Choose a reason for hiding this comment

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

Please update docs/deployment.md too

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