Skip to content

Move dev targets to makefiles/ to survive terraform bot#19

Merged
simantak-dabhade merged 2 commits into
mainfrom
simantak/updates-makefile
May 20, 2026
Merged

Move dev targets to makefiles/ to survive terraform bot#19
simantak-dabhade merged 2 commits into
mainfrom
simantak/updates-makefile

Conversation

@simantak-dabhade
Copy link
Copy Markdown
Contributor

Summary

  • Moves dev, down, clean, convex-push, and convex-env targets from the root Makefile into makefiles/Makefile
  • The root Makefile already does include $(wildcard makefiles/*), so make dev continues to work as before
  • Prevents tinyfish-github-terraform[bot] from wiping these targets on every run (has happened 4 times: c4eec12, 29e6357, 63f6b0f, 4f3cb52)

Test plan

  • make dev starts all services as before
  • make down and make clean still work
  • Next terraform bot run no longer breaks dev workflow

🤖 Generated with Claude Code

The tinyfish-github-terraform bot periodically overwrites the root
Makefile with a template. The root Makefile already includes
makefiles/*, so putting dev targets there keeps them safe.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 20, 2026

Review Change Stack

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Walkthrough

This PR adds a Makefile that automates local development environment setup. The dev target orchestrates starting a Docker Compose stack, waits up to 120 seconds for the Convex service health endpoint to respond, configures environment variables via npx convex env set and npx convex deploy, then tails Docker logs. Helper targets convex-env and convex-push extract credentials from frontend/.env.local using shell utilities. Cleanup targets down and clean stop and optionally remove the compose stack and its resources.

Possibly related PRs

  • tinyfish-io/bigset#14: Adds the same Makefile development targets with identical Docker Compose and Convex CLI workflow for local development setup.

Suggested reviewers

  • hwennnn
  • manav-tf
🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: moving dev targets from root Makefile to makefiles/ directory to prevent terraform bot overwrites.
Description check ✅ Passed The description is clearly related to the changeset, explaining the rationale (preventing terraform bot overwrites), what was moved, and how it works (via existing wildcard include).
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
  • Commit unit tests in branch simantak/updates-makefile

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

Copy link
Copy Markdown
Contributor

@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: 3

🤖 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 `@makefiles/Makefile`:
- Around line 25-27: The Makefile recipe that runs "cd frontend && npx convex
deploy --url http://127.0.0.1:3210 --admin-key "$$(grep
CONVEX_SELF_HOSTED_ADMIN_KEY .env.local | cut -d= -f2-)"" is currently echoed by
make, leaking the admin key; edit the Makefile and prefix that recipe line with
a single '@' (i.e., change the start of the command to '`@cd` frontend && npx
convex deploy ...') so make suppresses printing the command (ensure the '@' is
the very first character of the recipe line and that the line remains a
tab-indented Makefile recipe).
- Around line 19-22: The convex-env Makefile recipe should validate
frontend/.env.local and that CLERK_JWT_ISSUER_DOMAIN and
CONVEX_SELF_HOSTED_ADMIN_KEY are present before calling npx convex env set;
update the convex-env target to (1) check the file exists (frontend/.env.local),
(2) extract the two values into shell variables (using grep or cut) and verify
each is non-empty, and (3) print a clear error and exit non-zero if any check
fails, otherwise call npx convex env set with the extracted values; reference
the convex-env target, the frontend/.env.local path, the CLERK_JWT_ISSUER_DOMAIN
and CONVEX_SELF_HOSTED_ADMIN_KEY keys, and the npx convex env set invocation
when making the changes.
- Around line 24-27: The convex-push Makefile target currently shells out to
grep and may pass an empty admin key to npx convex deploy; update the
convex-push recipe to first check that frontend/.env.local exists and then
extract CONVEX_SELF_HOSTED_ADMIN_KEY into a variable (e.g., ADMIN_KEY) and
verify it is non-empty before running npx convex deploy; if the file is missing
or the key is absent/empty, print a clear error mentioning frontend/.env.local
and CONVEX_SELF_HOSTED_ADMIN_KEY and exit non-zero instead of invoking npx
convex deploy with an empty value.
🪄 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: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 40911379-b828-49bf-8d89-198ed86f93f5

📥 Commits

Reviewing files that changed from the base of the PR and between 1e5c1bf and 8b3ce60.

📒 Files selected for processing (1)
  • makefiles/Makefile

Comment thread makefiles/Makefile
Comment thread makefiles/Makefile
Comment thread makefiles/Makefile Outdated
… echo

- Add @ prefix to convex-push to prevent leaking admin key in terminal
- Validate frontend/.env.local exists and required keys are present
  before running convex-env and convex-push

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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