Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 Fix for objects in config files #4688

Merged
merged 3 commits into from
Mar 25, 2025

Conversation

lelemm
Copy link
Contributor

@lelemm lelemm commented Mar 25, 2025

Fixes #4687

@actual-github-bot actual-github-bot bot changed the title 🐛 Fix for objects in config files [WIP] 🐛 Fix for objects in config files Mar 25, 2025
Copy link

netlify bot commented Mar 25, 2025

Deploy Preview for actualbudget ready!

Name Link
🔨 Latest commit 7403b9e
🔍 Latest deploy log https://app.netlify.com/sites/actualbudget/deploys/67e3045916ad9400081f561e
😎 Deploy Preview https://deploy-preview-4688.demo.actualbudget.org
📱 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 site configuration.

@lelemm lelemm changed the title [WIP] 🐛 Fix for objects in config files 🐛 Fix for objects in config files Mar 25, 2025
Copy link
Contributor

coderabbitai bot commented Mar 25, 2025

Walkthrough

The changes update the configuration schema for HTTPS and upload settings in the packages/sync-server/src/load-config.js file. In the HTTPS section, the format and default properties have been removed, and the key and cert properties now include an env attribute that explicitly references environment variables (ACTUAL_HTTPS_KEY and ACTUAL_HTTPS_CERT). Similarly, in the upload section, the outer object structure that included format and default properties has been simplified. The individual upload properties retain their documentation, validation format, and environment variable mappings, but the extra configuration object wrapper has been eliminated. These modifications shift the configuration model from hard-coded defaults to environment variable–driven settings.

Assessment against linked issues

Objective Addressed Explanation
Ensure proper HTTPS configuration via environment variables for Docker deployment (#4687)

Possibly related PRs

Suggested labels

:sparkles: Merged

Suggested reviewers

  • matt-fidd

📜 Recent review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 009a3df and 7403b9e.

⛔ Files ignored due to path filters (1)
  • upcoming-release-notes/4688.md is excluded by !**/*.md
📒 Files selected for processing (1)
  • packages/sync-server/src/load-config.js (1 hunks)
🔇 Additional comments (5)
packages/sync-server/src/load-config.js (5)

138-138: Good addition of environment variable support!

Adding the environment variable mapping for the HTTPS key makes the configuration more flexible and follows the 12-factor app methodology for configuration through environment variables. This change will make it easier to configure the application in containerized environments.


145-145: Great consistency with environment variable support!

Similar to the key property, adding environment variable support for the HTTPS certificate improves configuration flexibility and consistency across the application.


131-147: Configuration structure improved

The changes to the HTTPS configuration section simplify the structure by removing unnecessary object nesting while maintaining the same functionality. This makes the configuration more consistent with other sections in the file.


149-172: Upload configuration structure properly simplified

The upload configuration section has been restructured similarly to the HTTPS section, making the schema more consistent and easier to understand. The individual properties maintain their documentation, validation format, and environment variable mappings, while removing unnecessary object wrapping.


276-276:

❓ Verification inconclusive

Verify schema validation still works correctly

The changes to the configuration schema structure should be validated to ensure they don't affect the validation process, especially when loading from config files or environment variables.


🏁 Script executed:

#!/bin/bash
# Let's check if there are any tests that validate configuration loading
fd -t f -e js -e ts --exec grep -l "config\|configSchema" {} \; | grep -E "test|spec"

# Also check if there are sample config files that might need updating
fd -t f -e json -e yaml -e yml --exec grep -l "https\|upload" {} \;

Length of output: 882


Ensure schema validation remains robust post-changes

The call to configSchema.validate({ allowed: 'strict' }) at line 276 in packages/sync-server/src/load-config.js should be carefully verified. Although there are tests in other parts of the monorepo (e.g., the sync test in packages/loot-core and several e2e tests in packages/desktop-client) that exercise configuration loading, it isn’t explicit that they cover this new schema validation scenario. Please ensure that the schema’s behavior—with regard to config files and environment variable sources—remains correct. If the existing tests do not sufficiently validate the schema changes, consider adding or updating tests for a more thorough check.

✨ Finishing Touches
  • 📝 Generate Docstrings

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
🪧 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.
    • Generate unit testing code for this file.
    • 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 generate unit testing code for this file.
    • @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 generate unit testing code.
    • @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.

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 resolve resolve all the CodeRabbit review comments.
  • @coderabbitai plan to trigger planning for file edits and PR creation.
  • @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.

@MikesGlitch MikesGlitch added this to the v25.4.0 milestone Mar 25, 2025
@MikesGlitch MikesGlitch merged commit 161c062 into actualbudget:master Mar 25, 2025
22 checks passed
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.

[Bug]: ERR_CONNECTION_REFUSED / ERR_SSL_PROTOCOL_ERROR since #4049
2 participants