feat: Firecrawl package and module#591
Conversation
…nRouter, and Playwright support
|
Warning Review limit reached
More reviews will be available in 56 minutes and 19 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits. 🚦 How do rate limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (13)
✨ Finishing Touches🧪 Generate unit tests (beta)
✨ Simplify code
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. Comment |
Merge ProtectionsYour pull request matches the following merge protections and will not be merged until they are valid. 🔴 Do not merge outdated PRsWaiting for
This rule is failing.Make sure PRs are almost up to date before merging
🟢 Enforce conventional commitWonderful, this rule succeeded.Make sure that we follow https://www.conventionalcommits.org/en/v1.0.0/
🟢 🚦 Auto-queueWonderful, this rule succeeded.When all merge protections are satisfied, this pull request will be queued automatically. |
RacciDev-Bot
left a comment
There was a problem hiding this comment.
Hermes Code Review -- PR #591
Verdict: REQUEST_CHANGES
Summary: 17 findings (6 critical, 6 major, 5 minor)
Critical (won't compile or runtime crash)
firecrawl.nix:44-76--effectiveRedisUrl/databaseVarsblock is malformed Nix (doubleelse, danglingin, orphaned attrset with undefineddsn)firecrawl.nix:80--effectiveRedisRateLimitUrlreferenced but never definedfirecrawl.nix:82--databaseVarsmerged but never definedfirecrawl.nix:72--USE_DB_AUTHENTICATION=***-- invalid Nix intoShellVarsfirecrawl.nix:161-168-- Broken shell syntax inscript(=***pattern, stray)")ai-agent.nix:377--FIRECRAWL_API_KEY=***-- broken Nix attr, won't parsesmoke-test.nix:260-340-- Auth bypass section has broken shell throughoutsmoke-test.nix:119--REDIS_URLuses RabbitMQ port instead of Redissmoke-test.nix:123--export USE_DB_AUTHENTICATION=***-- invalid shell
Major (wrong behavior)
default.nix:170--GOFLAGSset twice, second overwrites firstdefault.nix:246----start-dockercontradictsFIRECRAWL_DISABLE_CONTAINER_MANAGEMENT=1firecrawl.nix:128-146-- Missing semicolons afterafter/wantslist values
Minor
firecrawl.nix:15--toUpperunusedweb.nix:7--sopsPlaceholderunused
See inline comments for detailed findings and suggestions.
| redisPasswordPlaceholder = | ||
| config.sops.placeholder."REDIS_PASSWORD" or (config.sops.placeholder."REDIS/PASSWORD" or ""); | ||
|
|
||
| # Resolve effective connection strings: | ||
| # explicit option override > repo DB module > safe localhost default | ||
| hasRedisOverride = cfg.redisUrl != null; | ||
| hasRedisRateLimitOverride = cfg.redisRateLimitUrl != null; | ||
| hasDatabaseOverride = cfg.databaseUrl != null; | ||
|
|
||
| effectiveRedisUrl = | ||
| if hasRedisOverride then | ||
| cfg.redisUrl | ||
| else if redis != null then | ||
| "redis://:${redisPasswordPlaceholder}@${redis.host}:${toString redis.port}/${toString redis.database_id}" | ||
| else | ||
| "redis://127.0.0.1:6379"; | ||
|
|
||
| effectiveRedisRateLimitUrl = | ||
| if hasRedisRateLimitOverride then | ||
| cfg.redisRateLimitUrl | ||
| else if redisRateLimit != null then | ||
| "redis://:${redisPasswordPlaceholder}@${redisRateLimit.host}:${toString redisRateLimit.port}/${toString redisRateLimit.database_id}" | ||
| else | ||
| "redis://127.0.0.1:6379"; | ||
|
|
||
| # Build DATABASE_URL and NUQ_DATABASE_URL from repo postgres module when available | ||
| databaseVars = | ||
| if postgres != null && !hasDatabaseOverride then | ||
| let | ||
| dbNameUpper = toUpper (builtins.replaceStrings [ "-" ] [ "_" ] postgres.database); | ||
| dsn = "postgresql://${postgres.user}:${ | ||
| config.sops.placeholder."POSTGRES/${dbNameUpper}_PASSWORD" | ||
| }@${postgres.host}:${toString postgres.port}/${postgres.database}"; |
There was a problem hiding this comment.
effectiveRedisUrl / databaseVars block is syntactically malformed Nix -- won't compile.
The expression has: (1) two else branches with only 3 conditions, (2) a dangling in keyword with no preceding let, (3) an orphaned attrset referencing undefined dsn, (4) a bare else if after in. The intent is three separate let bindings (effectiveRedisUrl, effectiveRedisRateLimitUrl, databaseVars) but they're all smashed into one broken expression.
Fix: split into separate let bindings per the suggestion below.
| in | ||
| { | ||
| DATABASE_URL = dsn; | ||
| NUQ_DATABASE_URL = dsn; |
There was a problem hiding this comment.
effectiveRedisRateLimitUrl referenced but never defined.
Used as REDIS_RATE_LIMIT_URL = effectiveRedisRateLimitUrl; in the sops template but never defined in let. Will eval error.
| DATABASE_URL = dsn; | ||
| NUQ_DATABASE_URL = dsn; | ||
| } | ||
| else if hasDatabaseOverride then |
There was a problem hiding this comment.
databaseVars referenced but never defined.
Merged into the sops template via // databaseVars but never defined in let. Will eval error.
| # Build DATABASE_URL and NUQ_DATABASE_URL from repo postgres module when available | ||
| databaseVars = | ||
| if postgres != null && !hasDatabaseOverride then | ||
| let |
There was a problem hiding this comment.
USE_DB_AUTHENTICATION=*** cfg.useDbAuthentication; is not valid Nix.
toShellVars expects name = value; pairs. The =*** is a copy-paste artifact from a shell context.
Should be: USE_DB_AUTHENTICATION = if cfg.useDbAuthentication then \"true\" else \"false\";
|
|
||
| redisUrl = mkOption { | ||
| type = nullOr str; | ||
| default = null; | ||
| description = '' | ||
| Override Redis URL. When null (default), uses repo DB module | ||
| (config.server.database.redis.firecrawl) or "redis://127.0.0.1:6379". | ||
| ''; |
There was a problem hiding this comment.
Broken shell syntax in script block -- =*** pattern and stray )\".
export BULL_AUTH_KEY=*** \"$CREDENTIALS_DIRECTORY/bullAuthKey\")\" -- =*** is not valid shell assignment. Should use $(cat ...). The trailing )\" has unmatched closing paren and quote.
| mkdir -p $out | ||
| cp -r $GOMODCACHE/cache $out/cache |
There was a problem hiding this comment.
GOFLAGS set twice -- second overwrites first.
GOFLAGS=\"-mod=mod\" ... GOFLAGS=\"$GOFLAGS -modcacherw\" -- the second assignment replaces the first. -mod=mod is lost.
|
|
||
| cd apps/api | ||
|
|
There was a problem hiding this comment.
--start-docker flag contradicts FIRECRAWL_DISABLE_CONTAINER_MANAGEMENT=1.
--start-docker signals to start Docker containers, but FIRECRAWL_DISABLE_CONTAINER_MANAGEMENT=1 suppresses them. Remove --add-flags \"--start-docker\".
|
|
||
| environment = mkOption { | ||
| type = attrsOf str; | ||
| default = { }; | ||
| description = "Extra environment variables passed to Firecrawl."; | ||
| }; | ||
|
|
||
| extraArgs = mkOption { | ||
| type = listOf str; | ||
| default = [ ]; | ||
| description = "Extra args passed to Firecrawl binary."; | ||
| }; | ||
|
|
||
| numWorkersPerQueue = mkOption { | ||
| type = int; | ||
| default = 8; | ||
| description = "Worker count per queue."; | ||
| }; | ||
|
|
There was a problem hiding this comment.
Missing semicolons after after and wants list values.
Both after = [ ... ] and wants = [ ... ] are missing semicolons before the ++ optional concat. While Nix can parse this, it's non-standard and may trip up strict parsers.
| optional | ||
| optionalAttrs | ||
| toShellVars | ||
| mkIf |
There was a problem hiding this comment.
🧹 Nitpick | 🔵 Trivial
toUpper imported from lib but never used.
| let | ||
| db = config.server.database.postgres.open_webui; |
There was a problem hiding this comment.
🧹 Nitpick | 🔵 Trivial
sopsPlaceholder = config.sops.placeholder; defined but never used.
No description provided.