Skip to content

Fix env path - #110

Merged
necessarylion merged 8 commits into
developfrom
dox-migration-in-cli
Jul 11, 2025
Merged

Fix env path#110
necessarylion merged 8 commits into
developfrom
dox-migration-in-cli

Conversation

@necessarylion

@necessarylion necessarylion commented Jul 10, 2025

Copy link
Copy Markdown
Member

Summary by CodeRabbit

  • Chores

    • Updated test workflow to set up environment variables and configuration files for database tests.
    • Modified configuration files to improve clarity and flexibility in test package filtering.
    • Added .env to .gitignore to prevent sensitive configuration from being tracked.
    • Removed the .env file from the application package.
    • Expanded and updated the environment variable example file with new values and variables.
  • Documentation

    • Added a badge to the README linking to CodeRabbit Pull Request Reviews.
  • Bug Fixes

    • Improved database test configuration to use environment variables for connection settings, enhancing flexibility and reliability.

@coderabbitai

coderabbitai Bot commented Jul 10, 2025

Copy link
Copy Markdown

Walkthrough

The updates introduce improved environment variable management by updating example files, removing sensitive .env files, and enhancing test workflows to explicitly set environment variables. Configuration files for scripts and database connections are refactored to use environment-driven values, and a new badge is added to the README for CodeRabbit PR reviews.

Changes

File(s) Change Summary
.github/workflows/test.yaml Added steps to copy .env.example to .env and set DB-related environment variables for tests.
.gitignore Added .env to ignored files.
README.md Inserted CodeRabbit Pull Request Reviews badge.
melos.yaml Changed ignore to a list and added noSelect: true in test script package filters.
packages/dox-app/.env Removed the .env file containing sensitive environment variables.
packages/dox-app/.env.example Expanded and updated example environment variables, changed defaults, added Redis variables, and reordered entries.
packages/dox-query-builder/test/connection.dart Database configs now use env vars for ports and user; reduced Postgres max connection age to 500ms.

Sequence Diagram(s)

sequenceDiagram
    participant Workflow
    participant FileSystem
    participant TestRunner

    Workflow->>FileSystem: Copy .env.example to .env (in dox-app)
    Workflow->>TestRunner: Run tests with DB_PORT/DB_USER env vars set
    TestRunner->>FileSystem: Read .env for configuration
    TestRunner->>Database: Connect using env-driven parameters
Loading

Poem

🐇
A hop and a skip, the configs align,
No secrets in Git, just examples to sign.
Badges now shimmer, workflows are neat,
Ports from the env, connections complete!
With CodeRabbit’s cheer,
Our code’s crystal clear—
Onward we bound, with changes so sweet!

✨ Finishing Touches
  • 📝 Generate Docstrings

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@necessarylion
necessarylion marked this pull request as draft July 10, 2025 14:49
@necessarylion necessarylion changed the title Dox migration in cli Fix env path Jul 10, 2025
@necessarylion
necessarylion marked this pull request as ready for review July 10, 2025 15:02

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🧹 Nitpick comments (1)
README.md (1)

4-6: Badge lacks an explicit anchor; users can’t click through reliably

The link= query param in the shields-io URL sometimes fails on GitHub’s markdown renderer.
Wrap the badge in a normal markdown link so the target is always reachable and screen-reader friendly.

-![CodeRabbit Pull Request Reviews](https://img.shields.io/coderabbit/prs/github/dartondox/dox?utm_source=oss&utm_medium=github&utm_campaign=dartondox%2Fdox&labelColor=171717&color=FF570A&link=https%3A%2F%2Fcoderabbit.ai&label=CodeRabbit+Reviews)
+[![CodeRabbit Pull Request Reviews](https://img.shields.io/coderabbit/prs/github/dartondox/dox?labelColor=171717&color=FF570A&label=CodeRabbit+Reviews)](https://coderabbit.ai)
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8524d9d and 95afbdb.

📒 Files selected for processing (7)
  • .github/workflows/test.yaml (1 hunks)
  • .gitignore (1 hunks)
  • README.md (1 hunks)
  • melos.yaml (1 hunks)
  • packages/dox-app/.env (0 hunks)
  • packages/dox-app/.env.example (1 hunks)
  • packages/dox-query-builder/test/connection.dart (2 hunks)
💤 Files with no reviewable changes (1)
  • packages/dox-app/.env
🧰 Additional context used
🪛 Gitleaks (8.26.0)
packages/dox-app/.env.example

4-4: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)

🔇 Additional comments (6)
.gitignore (1)

10-11: .env pattern ignores all nested .env files – is that intentional?

A bare .env entry matches every file named .env anywhere in the tree, not just the repo root.
If package-level .env files are created locally (e.g. during tests) they’ll be un-tracked too, which might hide accidental commits of secrets.

Confirm that this broad ignore is desired; otherwise scope it:

-.env
+/packages/*/.env
+/.env
packages/dox-app/.env.example (1)

13-14: Nice addition of Redis defaults

The new REDIS_HOST / REDIS_PORT variables complete the sample config and remove a common gotcha for first-time setup. 👍

.github/workflows/test.yaml (1)

62-70: MySQL test step lacks DB_PASSWORD; may fail when auth is enforced

packages/dox-query-builder/test/connection.dart now reads DB_PASSWORD (falls back to 'password' only if env var absent?).
Because the MariaDB service is started with MYSQL_PASSWORD: password, propagate the same value to ensure deterministic CI:

-      run: DB_USER=dox DB_PORT=3306 melos test_query_builder_mysql
+      run: DB_USER=dox DB_PASSWORD=password DB_PORT=3306 melos test_query_builder_mysql

Please verify the test still passes locally.

melos.yaml (1)

11-13: Config tweak looks correct

Switching ignore to a list and setting noSelect: true matches the melos schema and avoids interactive prompts during CI. No further action required.

packages/dox-query-builder/test/connection.dart (2)

27-27: Verify the dramatic reduction in maxConnectionAge.

The maxConnectionAge was reduced from 1 hour to 500 milliseconds, which is a significant change that could impact performance by causing frequent connection recycling.

Please confirm this change is intentional and verify that it doesn't negatively impact test performance or connection stability.


39-39: Good improvement for configurability.

Making the MySQL user configurable via environment variable is a good improvement for flexibility and security.

Comment thread packages/dox-app/.env.example
Comment thread packages/dox-query-builder/test/connection.dart
Comment thread packages/dox-query-builder/test/connection.dart
@necessarylion
necessarylion merged commit 771f24d into develop Jul 11, 2025
2 checks passed
@necessarylion
necessarylion deleted the dox-migration-in-cli branch July 11, 2025 02:38
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.

1 participant