Skip to content

fix(deploy): use project-directory for compose identity - #142

Merged
LucasSantana-Dev merged 1 commit into
mainfrom
fix/deploy-webhook-project-dir
Mar 10, 2026
Merged

LucasSantana-Dev merged 1 commit into
mainfrom
fix/deploy-webhook-project-dir

Conversation

@LucasSantana-Dev

@LucasSantana-Dev LucasSantana-Dev commented Mar 10, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • run compose commands with explicit --project-directory "$COMPOSE_WORKDIR"
  • keep -p lucky project pinning while avoiding symlink creation under /home
  • ensure webhook-side compose actions target the same stack identity labels as host-run compose

Validation

  • bash -n scripts/deploy.sh
  • compose identity check inside webhook container:
    • docker compose --project-directory /home/luk-server/Lucky -p lucky ps

Summary by CodeRabbit

  • Chores
    • Enhanced Docker Compose deployment invocation with explicit project directory specification
    • Removed symlink creation logic between working and deployment directories
    • Streamlined deployment script execution with simplified directory management for image operations

@vercel

vercel Bot commented Mar 10, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
lucky Ready Ready Preview, Comment Mar 10, 2026 4:48pm

@netlify

netlify Bot commented Mar 10, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for regal-bunny-0c8efe ready!

Name Link
🔨 Latest commit b0a415f
🔍 Latest deploy log https://app.netlify.com/projects/regal-bunny-0c8efe/deploys/69b04b30c2a8c3000829c232
😎 Deploy Preview https://deploy-preview-142--regal-bunny-0c8efe.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai

coderabbitai Bot commented Mar 10, 2026 •

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: e4898405-e33a-4036-b0fc-b5fb589e6ac0

📥 Commits

Reviewing files that changed from the base of the PR and between 0842109 and b0a415f.

📒 Files selected for processing (1)
  • scripts/deploy.sh
📜 Recent review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Quality Gates
  • GitHub Check: SonarCloud Scan
🧰 Additional context used
📓 Path-based instructions (3)
**/{.scripts,scripts}/**/*.{sh,bash,js,ts}

📄 CodeRabbit inference engine (.cursor/rules/scripts-terminal.mdc)

Use cross-platform deletion utilities instead of OS-specific rm -rf

Files:

  • scripts/deploy.sh
{scripts/**,packages/scripts/**}

📄 CodeRabbit inference engine (.cursor/rules/lucky-project.mdc)

Prefer packages/scripts or root scripts/ for one-off automation; avoid maintaining one-time scripts in the repository long term

Files:

  • scripts/deploy.sh
{**/scripts/**,scripts/**,.github/workflows/**/*.{yml,yaml},**/.gitlab-ci.yml,.circleci/config.yml}

📄 CodeRabbit inference engine (.cursor/rules/workflow.mdc)

{**/scripts/**,scripts/**,.github/workflows/**/*.{yml,yaml},**/.gitlab-ci.yml,.circleci/config.yml}: Use cross-platform environment handling in scripts, cross-platform deletion utilities instead of OS-specific commands, pass non-interactive flags (--yes, --ci) by default in automation, and avoid OS-specific commands
Ensure logs are stream-friendly (no pagers) in scripts; when a pager might be used, pipe to cat

Files:

  • scripts/deploy.sh
🧠 Learnings (3)
📓 Common learnings
Learnt from: CR
Repo: LucasSantana-Dev/Lucky PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-03-09T20:22:47.441Z
Learning: For Docker, compose, and local run operations, use the `lucky-docker-dev` skill
Learnt from: CR
Repo: LucasSantana-Dev/Lucky PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-03-09T20:22:47.441Z
Learning: Use Docker for local development when available via `docker-compose.dev.yml`; prefer scripts in `scripts/` for documented operations
Learnt from: CR
Repo: LucasSantana-Dev/Lucky PR: 0
File: .cursor/rules/lucky-project.mdc:0-0
Timestamp: 2026-03-09T20:21:08.600Z
Learning: Applies to docker-compose.dev.yml : Use Docker for local environment setup when available via `docker-compose.dev.yml`
📚 Learning: 2026-03-09T20:22:47.441Z
Learnt from: CR
Repo: LucasSantana-Dev/Lucky PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-03-09T20:22:47.441Z
Learning: Use Docker for local development when available via `docker-compose.dev.yml`; prefer scripts in `scripts/` for documented operations

Applied to files:

  • scripts/deploy.sh
📚 Learning: 2026-03-09T20:21:08.600Z
Learnt from: CR
Repo: LucasSantana-Dev/Lucky PR: 0
File: .cursor/rules/lucky-project.mdc:0-0
Timestamp: 2026-03-09T20:21:08.600Z
Learning: Applies to docker-compose.dev.yml : Use Docker for local environment setup when available via `docker-compose.dev.yml`

Applied to files:

  • scripts/deploy.sh
🔇 Additional comments (1)
scripts/deploy.sh (1)

35-40: LGTM!

The addition of --project-directory "$COMPOSE_WORKDIR" ensures Docker Compose uses the correct project directory for stack identity labels. Combined with the explicit -p flag, this correctly addresses the issue where webhook-side compose actions need to match the same stack identity as host-run compose commands.

The variable is properly quoted and only referenced after resolve_compose_workdir() initializes it at line 80.


📝 Walkthrough

Walkthrough

The deployment script's Docker Compose invocation is modified to include an explicit project directory argument. Conditional symlink creation logic between COMPOSE_WORKDIR and DEPLOY_DIR is removed, along with the directory change step prior to pulling images.

Changes

Cohort / File(s) Summary
Docker Compose Deployment Configuration
scripts/deploy.sh
Modified docker_compose function to include explicit --project-directory argument. Removed conditional symlink creation between COMPOSE_WORKDIR and DEPLOY_DIR, and eliminated the cd operation prior to pulling images. Operations now execute from DEPLOY_DIR directly.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Suggested labels

ci, size/m

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: adding explicit --project-directory flag to docker compose invocations in the deploy script.

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

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/deploy-webhook-project-dir

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@sonarqubecloud

Copy link
Copy Markdown

@sonarqubecloud

Copy link
Copy Markdown

@LucasSantana-Dev
LucasSantana-Dev merged commit bd0ad8e into main Mar 10, 2026
15 checks passed
@LucasSantana-Dev
LucasSantana-Dev deleted the fix/deploy-webhook-project-dir branch March 10, 2026 16:51

This branch was successfully deployed

1 active deployment
Preview — b0a415fa Deployed Mar 10, 2026 by vercel[bot]
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.

1 participant