Skip to content

fix: deployment script and test tooling bugs found in docs audit - #10264

Merged
sriramveeraghanta merged 1 commit into
previewfrom
fix/deploy-and-test-script-bugs
Nov 11, 2026
Merged

sriramveeraghanta merged 1 commit into
previewfrom
fix/deploy-and-test-script-bugs

Conversation

@sriramveeraghanta

@sriramveeraghanta sriramveeraghanta commented Nov 11, 2026 •

Copy link
Copy Markdown
Member

Description

Fixes four bugs found while auditing the repo docs (docs PR: #10263):

  • Swarm installer can't exit from the menu. deployments/swarm/community/swarm.sh validated the action with ^[1-6]$, so choosing 7) Exit printed "invalid selection". The regex now accepts 1-7.
  • Two CLI plane.env settings had no effect. In deployments/cli/community/docker-compose.yml:
    • GUNICORN_WORKERS was hardcoded to 1.
    • AUTHENTICATION_RATE_LIMIT, which plane/authentication/rate_limit.py reads for the sign-in/sign-up throttle, was never passed to the containers.
    • Both are now passed through with the same defaults (1, 10/minute), so existing installs behave the same unless they set the variables.
    • Also removed the commented DOCKER_PLATFORM hint from variables.env; nothing reads it.
    • Swarm deploys the same compose file and sources plane.env, so the fix covers it too.
  • apps/api/run_tests.sh was broken. It exec'd tests/run_tests.sh, which has never existed in the repo's history. It now cds to apps/api and runs uv run python run_tests.py "$@". uv run syncs inexactly, so it is safe inside the dev/test images.
  • Test mock fixtures were never loaded. conftest_external.py is not a conftest.py, so pytest never saw mock_redis, mock_elasticsearch or mock_celery, even though the test docs advertise them.
    • mock_redis and mock_celery are now imported into conftest.py, the same way it already imports django_db_setup.
    • mock_elasticsearch is removed: Elasticsearch is not a dependency, so the fixture would fail whenever it was used.
    • New test_external_fixtures.py covers both remaining fixtures.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • Feature (non-breaking change which adds functionality)
  • Improvement (change that would cause existing functionality to not work as expected)
  • Code refactoring
  • Performance improvements
  • Documentation update

Screenshots and Media (if applicable)

Test Scenarios

  • Ran in the Docker test stack: pytest plane/tests/unit/test_external_fixtures.py (2 passed), pytest --collect-only (1563 collected, no errors), pytest -m unit (581 passed).
  • docker compose -f deployments/cli/community/docker-compose.yml --env-file <plane.env with GUNICORN_WORKERS=3, AUTHENTICATION_RATE_LIMIT=20/minute> config renders those values on the app services; without them it renders the defaults 1 and 10/minute.
  • apps/api/run_tests.sh --help, run from another directory, prints the run_tests.py usage.
  • Swarm: run ./setup.sh from swarm.sh and choose 7; the script now exits instead of re-prompting.

References

Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Community deployments can now configure the number of application workers and the authentication rate limit, with defaults provided.
  • Bug Fixes
    • The community deployment menu now accepts the selection for Exit.
  • Chores
    • Updated API test setup and test-running commands.

- swarm.sh: the action prompt only accepted 1-6, so "7) Exit" was
  rejected as an invalid selection
- CLI docker-compose.yml: GUNICORN_WORKERS was hardcoded to 1 and
  AUTHENTICATION_RATE_LIMIT was never passed to the API, so both
  plane.env settings had no effect; pass them through with the same
  defaults. Drop the DOCKER_PLATFORM comment, which nothing reads
- apps/api/run_tests.sh exec'd tests/run_tests.sh, which never existed;
  run run_tests.py through uv from apps/api instead
- conftest_external.py fixtures were never loaded by pytest; import
  mock_redis and mock_celery into conftest.py and drop mock_elasticsearch
  (Elasticsearch is not a dependency). Add a test that both fixtures work
@coderabbitai

coderabbitai Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The changes update API test fixtures and the test wrapper, adjust community CLI deployment environment settings, and allow selection 7 in the Swarm menu.

Changes: API Test Setup

Layer / File(s) Summary
External fixture setup and tests
apps/api/plane/tests/conftest.py, apps/api/plane/tests/conftest_external.py, apps/api/plane/tests/unit/test_external_fixtures.py
The main conftest imports mock_redis and mock_celery. The mock_elasticsearch fixture is removed. New unit tests check the Redis and Celery fixtures.
API test runner
apps/api/run_tests.sh
The wrapper changes to the API directory and runs run_tests.py through uv, forwarding its arguments.

CLI Community Deployment

Layer / File(s) Summary
Compose environment settings
deployments/cli/community/docker-compose.yml, deployments/cli/community/variables.env
GUNICORN_WORKERS is configurable with a default of 1. AUTHENTICATION_RATE_LIMIT is configurable with a default of 10/minute. The variables file no longer includes the commented platform setting or ARM64 guidance.

Swarm Community Deployment

Layer / File(s) Summary
Menu selection range
deployments/swarm/community/swarm.sh
Menu validation accepts selections 1–7, allowing selection 7 to reach the existing Exit action.

Estimated code review effort: 2 (Simple) | ~12 minutes

Change: Bug fix

Merge Risk: Minimal · up to 66171

This change fixes a Swarm exit menu option, makes two documented settings take effect in compose deployments, and corrects test tooling. No concrete merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title clearly identifies deployment script and test tooling bug fixes, which are central changes in the pull request.
Description check Passed The description includes all required sections, explains the changes, identifies the change type, documents test scenarios, and provides a reference.
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.
Finishing Touches

Generate docstrings

  • Commit to this branch
  • Create a new PR
Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: c4ff8a84-31c3-4381-9b25-d6cb7754f6ba
Commits

Reviewing files that changed from the base of the PR and between 5bde8cd and 6617120.

Files selected for processing: 7

  • apps/api/plane/tests/conftest.py
  • apps/api/plane/tests/conftest_external.py
  • apps/api/plane/tests/unit/test_external_fixtures.py
  • apps/api/run_tests.sh
  • deployments/cli/community/docker-compose.yml
  • deployments/cli/community/variables.env
  • deployments/swarm/community/swarm.sh
Files with no reviewable changes: 2

  • apps/api/plane/tests/conftest_external.py
  • deployments/cli/community/variables.env

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.

sriramveeraghanta added a commit that referenced this pull request Nov 11, 2026
* docs: verify and refresh repo documentation against the code

Audit every Markdown doc in the repo against the current code and config
and fix what had drifted:

- README, CONTRIBUTING, AGENTS, SECURITY: versions, setup steps, PR flow,
  i18n structure, private vulnerability reporting, Forum instead of
  GitHub Discussions, broken links
- linting, copyright check, Copilot instructions: match oxlint/oxfmt
  config, the CI copyright check and the repo's TS settings
- apps/api docs: test runner, fixtures, routes, openapi and exporters
  module contents; mark the Django 5.2 plan as done
- deployments: CLI menu/backup/restore/env vars, AIO services, secrets,
  build and env precedence, Helm install steps
- packages: decorators, logger, editor, codemods and tailwind-config docs
  rewritten from the real exports and tokens; skill docs updated

* docs(api): describe mock_redis/mock_celery fixtures registered in #10264
@sriramveeraghanta
sriramveeraghanta merged commit 0b9ca51 into preview Nov 11, 2026
20 of 21 checks passed
@sriramveeraghanta
sriramveeraghanta deleted the fix/deploy-and-test-script-bugs branch November 11, 2026 20:16
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