Skip to content

Integrate Rabbit lifecycle resolution#2

Open
fqjony wants to merge 3 commits into
productionfrom
lifecycle-action-integration
Open

Integrate Rabbit lifecycle resolution#2
fqjony wants to merge 3 commits into
productionfrom
lifecycle-action-integration

Conversation

@fqjony
Copy link
Copy Markdown

@fqjony fqjony commented May 27, 2026

Scope

  • Delegate lifecycle/env/protection resolution to udx/rabbit-lifecycle.
  • Keep Rabbit config discovery, ordered merge behavior, manifest merge semantics, and deployment execution in this action.
  • Remove the unused internal GitHub branch-protection helper and protected/fallback lifecycle policy fields from this repo.
  • Add smoke coverage for lifecycle base plus env override merge behavior, including configurable source_dir layouts.
  • Add repo repair surfaces: configuration contract docs, validation docs, .env.example, Makefile test target, and CI workflow.
  • Refresh repo context with dev.kit; context now reports documentation, dependencies, config, and pipeline present.

Compatibility

  • Normal action runs use udx/rabbit-lifecycle outputs.
  • Direct/local merge script runs retain a simple fallback: explicit lifecycle name, preferred lifecycle subdir, then development.

Validation

  • make test
  • tests/run-merge-tests.sh
  • bash -n bin/merge-configs.sh bin/lib/config.sh bin/lib/lifecycle.sh bin/lib/validation.sh bin/lib/environment.sh tests/run-merge-tests.sh
  • yq eval '.' action.yml >/dev/null
  • yq eval '.' .github/workflows/ci.yml >/dev/null
  • git diff --check
  • dev.kit repo

Copilot AI review requested due to automatic review settings May 27, 2026 14:33
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR delegates lifecycle resolution to the external udx/rabbit-lifecycle action while keeping this action responsible for config discovery and deep-merge behavior. It also adds a small smoke test script and updates docs to reflect the new lifecycle flow and source_dir layout guidance.

Changes:

  • Add a new “Resolve Rabbit lifecycle” step (via udx/rabbit-lifecycle) and surface additional lifecycle metadata outputs (is_protected, resolution_reason).
  • Tighten config discovery to only consider directories under configured lifecycle roots, including supporting nested source_dir layouts (e.g. .rabbit/infra_configs).
  • Add bash-based smoke coverage for lifecycle base + env override merge behavior and update README documentation.

Reviewed changes

Copilot reviewed 5 out of 8 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
action.yml Adds lifecycle resolution step and new outputs; pins yq install to a specific version.
bin/merge-configs.sh Filters discovered config files by lifecycle root directories before merging.
bin/lib/lifecycle.sh Adjusts lifecycle resolution to prefer pre-resolved lifecycle metadata and filters detection by lifecycle roots.
bin/lib/config.sh Exports lifecycle metadata (LIFECYCLE, IS_PROTECTED, RESOLUTION_REASON) from inputs.
tests/run-merge-tests.sh Adds smoke tests for merge behavior across lifecycle roots and nested source_dir layouts.
README.md Updates “How it works”, environment/lifecycle wording, and documents nested source_dir usage and new outputs.
.rabbit/context.yaml Adds refreshed dev.kit repo context manifest.
.github/dependabot.yml Enables weekly Dependabot updates for GitHub Actions.
Comments suppressed due to low confidence (1)

README.md:152

  • In the updated flow, the diagram’s step numbers are now inconsistent: after adding “1. Resolve Lifecycle” and “2. Merge Configs”, the next box still says “2. Safety Checks” and subsequent steps are off by one. Update the numbering so the sequence matches the new action step order.
        ┌─────────────▼──────────────┐
        │   2. Merge Configs         │
        │   Discover .rabbit/ YAML   │
        │   Deep merge by module::id │
         └─────────────┬──────────────┘
                       │
         ┌─────────────▼──────────────┐
         │   2. Safety Checks         │
         │   Block production manual  │
         │   Block production destroy │
         │   Auto plan-only for PRs   │
         └─────────────┬──────────────┘

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread action.yml
Comment on lines +136 to +142
- name: Resolve Rabbit lifecycle
id: resolve-lifecycle
uses: udx/rabbit-lifecycle@lifecycle-action-contract
with:
source_dir: ${{ inputs.source_dir }}
env_name: ${{ inputs.environment || (github.event_name == 'pull_request' && github.base_ref) || (github.event_name == 'delete' && github.event.ref) || github.ref_name }}
github_token: ${{ inputs.github_token }}
Comment thread action.yml
Comment on lines +151 to 160
version="v4.44.3"
install_dir="${RUNNER_TEMP:-/tmp}/rabbit-action-bin"
mkdir -p "$install_dir"

url="https://github.com/mikefarah/yq/releases/download/${version}/yq_linux_amd64"
curl -fsSL "$url" -o "$install_dir/yq"
chmod +x "$install_dir/yq"
echo "$install_dir" >> "$GITHUB_PATH"
export PATH="$install_dir:$PATH"
yq --version
Copilot AI review requested due to automatic review settings May 27, 2026 14:47
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 11 out of 17 changed files in this pull request and generated 2 comments.

Comment thread action.yml
Comment on lines +147 to 160
- name: Install pinned yq
shell: bash
run: |
set -euo pipefail
if ! command -v yq >/dev/null 2>&1; then
echo "Installing yq..."
curl -sSL "https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64" -o /usr/local/bin/yq
chmod +x /usr/local/bin/yq
fi
version="v4.44.3"
install_dir="${RUNNER_TEMP:-/tmp}/rabbit-action-bin"
mkdir -p "$install_dir"

url="https://github.com/mikefarah/yq/releases/download/${version}/yq_linux_amd64"
curl -fsSL "$url" -o "$install_dir/yq"
chmod +x "$install_dir/yq"
echo "$install_dir" >> "$GITHUB_PATH"
export PATH="$install_dir:$PATH"
yq --version
Comment thread .github/workflows/ci.yml
Comment on lines +21 to +31
- name: Install pinned yq
shell: bash
run: |
set -euo pipefail
version="v4.44.3"
install_dir="${RUNNER_TEMP}/rabbit-action-bin"
mkdir -p "$install_dir"
curl -fsSL "https://github.com/mikefarah/yq/releases/download/${version}/yq_linux_amd64" -o "$install_dir/yq"
chmod +x "$install_dir/yq"
echo "$install_dir" >> "$GITHUB_PATH"

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