Skip to content

Conversation

@KambleSahil3
Copy link
Contributor

@KambleSahil3 KambleSahil3 commented Nov 28, 2025

  • update master-table.json path
  • add volume to store bulk issuance files

Summary by CodeRabbit

  • Chores
    • Updated service data storage paths for improved file organization.
    • Added dedicated export file storage configuration to support export functionality.

✏️ Tip: You can customize this high-level summary in your review settings.

- update master-table.json path
- add volume to store bulk issuance files

Signed-off-by: Sahil Kamble <[email protected]>
@coderabbitai
Copy link

coderabbitai bot commented Nov 28, 2025

Walkthrough

Updated docker-compose.yml to restructure the prisma seed data file path into a nested directory and added volume mounts for uploaded file exports in the issuance service and top-level service configuration.

Changes

Cohort / File(s) Summary
Docker Compose Configuration
docker-compose.yml
Updated prisma seed data volume path from credebl-master-table.json to credebl-master-table/credebl-master-table.json (nested directory); added volume mounts for uploadedFiles/exports in issuance service and top-level services to mount $PWD/apps/uploadedFiles/exports to /app/uploadedFiles/exports

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

  • Verify that the nested directory structure for credebl-master-table/credebl-master-table.json exists on the host and is correctly positioned in the codebase
  • Confirm that the new uploadedFiles/exports mount paths are intended and align with application expectations

Possibly related PRs

Suggested reviewers

  • GHkrishna

Poem

🐰 A nested path, a cleaner way,
Files tucked in folders—hip hooray!
Exports mount where they belong,
Docker dances to a better song! 📦✨

Pre-merge checks and finishing touches

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Title check ❓ Inconclusive The title is generic and overly broad, lacking specific detail about what aspect of docker-compose.yml is being updated. Consider a more specific title like 'Update docker-compose.yml paths and add volume mounts for bulk issuance' that conveys the primary changes being made.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Tip

📝 Customizable high-level summaries are now available in beta!

You can now customize how CodeRabbit generates the high-level summary in your pull requests — including its content, structure, tone, and formatting.

  • Provide your own instructions using the high_level_summary_instructions setting.
  • Format the summary however you like (bullet lists, tables, multi-section layouts, contributor stats, etc.).
  • Use high_level_summary_in_walkthrough to move the summary from the description to the walkthrough section.

Example instruction:

"Divide the high-level summary into five sections:

  1. 📝 Description — Summarize the main change in 50–60 words, explaining what was done.
  2. 📓 References — List relevant issues, discussions, documentation, or related PRs.
  3. 📦 Dependencies & Requirements — Mention any new/updated dependencies, environment variable changes, or configuration updates.
  4. 📊 Contributor Summary — Include a Markdown table showing contributions:
    | Contributor | Lines Added | Lines Removed | Files Changed |
  5. ✔️ Additional Notes — Add any extra reviewer context.
    Keep each section concise (under 200 words) and use bullet or numbered lists for clarity."

Note: This feature is currently in beta for Pro-tier users, and pricing will be announced later.


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

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

@sonarqubecloud
Copy link

Copy link

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

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3ab4ac6 and 4c033c0.

📒 Files selected for processing (1)
  • docker-compose.yml (3 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-11-17T08:03:16.180Z
Learnt from: KambleSahil3
Repo: credebl/platform PR: 1518
File: libs/prisma-service/prisma/data/credebl-master-table/credebl-master-table.json:11-20
Timestamp: 2025-11-17T08:03:16.180Z
Learning: In the credebl/platform repository, seed data files like libs/prisma-service/prisma/data/credebl-master-table/credebl-master-table.json intentionally contain empty strings for sensitive fields (email, username, passwords, API keys, etc.) because these values are populated from .env file at runtime, not hardcoded in the JSON.

Applied to files:

  • docker-compose.yml
🔇 Additional comments (1)
docker-compose.yml (1)

28-28: The docker-compose volume mount is misconfigured and will cause the seed service to fail at runtime.

The seed service code (libs/prisma-service/prisma/seed.ts) expects to read from prisma/data/credebl-master-table/credebl-master-table.json (nested directory structure), but the volume mount in docker-compose only mounts the flat file itself, not the directory containing it.

Current mount (broken):

- $PWD/libs/prisma-service/prisma/data/credebl-master-table.json:/app/libs/prisma-service/prisma/data/credebl-master-table.json

Required mount (to match seed.ts expectation):

- $PWD/libs/prisma-service/prisma/data/credebl-master-table:/app/libs/prisma-service/prisma/data/credebl-master-table

The mount must include the parent directory (credebl-master-table/) rather than just the JSON file, so the nested structure credebl-master-table/credebl-master-table.json is accessible to the seed service inside the container.

⛔ Skipped due to learnings
Learnt from: KambleSahil3
Repo: credebl/platform PR: 1518
File: libs/prisma-service/prisma/data/credebl-master-table/credebl-master-table.json:11-20
Timestamp: 2025-11-17T08:03:16.180Z
Learning: In the credebl/platform repository, seed data files like libs/prisma-service/prisma/data/credebl-master-table/credebl-master-table.json intentionally contain empty strings for sensitive fields (email, username, passwords, API keys, etc.) because these values are populated from .env file at runtime, not hardcoded in the JSON.

Comment on lines +71 to +72
volumes:
- $PWD/apps/uploadedFiles/exports:/app/uploadedFiles/exports
Copy link

@coderabbitai coderabbitai bot Nov 28, 2025

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Description: Verify issuance service configuration for the exports directory

# Check if the uploadedFiles/exports directory exists in the repo
if [ -d "apps/uploadedFiles/exports" ]; then
  echo "✓ Directory exists at apps/uploadedFiles/exports"
  ls -la apps/uploadedFiles/exports
else
  echo "ℹ Directory does not yet exist at apps/uploadedFiles/exports (may be created at runtime)"
fi

# Search for references to uploadedFiles/exports in issuance service code
echo -e "\n=== Checking for exports directory references in issuance service ==="
rg -i 'uploadedFiles.*exports|exports.*directory' apps/issuance --type=ts --type=js -C 2 2>/dev/null || echo "No matches found in issuance service"

# Search for related file upload/export handling patterns
echo -e "\n=== Checking for file export patterns in issuance service ==="
rg -i 'export.*file|bulk.*issuance' apps/issuance --type=ts --type=js -C 1 2>/dev/null | head -15

Repository: credebl/platform

Length of output: 1810


🏁 Script executed:

#!/bin/bash

# Find and examine the createFile function
echo "=== Looking for createFile function definition ==="
rg -n 'function createFile|export.*createFile|const createFile' apps/issuance --type=ts --type=js -A 10 | head -30

# Check for any mkdir or directory creation in issuance service
echo -e "\n=== Checking for directory creation logic in issuance service ==="
rg -n 'mkdir|createDir|ensureDir|existsSync|makedirs' apps/issuance --type=ts --type=js -B 2 -A 2

# Look at the full docker-compose.yml context
echo -e "\n=== Checking docker-compose.yml for issuance service context ==="
cat -n docker-compose.yml | sed -n '60,85p'

# Check if there's a Dockerfile or entrypoint script for issuance
echo -e "\n=== Looking for Dockerfile or initialization scripts ==="
find apps/issuance -name "Dockerfile*" -o -name "entrypoint*" -o -name "*.sh" | head -10

Repository: credebl/platform

Length of output: 1038


🏁 Script executed:

#!/bin/bash

# Get the full issuance service configuration from docker-compose
echo "=== Full issuance service in docker-compose.yml ==="
rg -n 'issuance:' docker-compose.yml -A 20

# Search for createFile across entire repository
echo -e "\n=== Searching for createFile function across repo ==="
rg -n 'export.*createFile|function createFile|const createFile' . --type=ts --type=js | head -20

# Search more broadly for file creation utilities
echo -e "\n=== Searching for file utility functions ==="
rg -n 'createFile|writeFile|ensureFile' . --type=ts --type=js --glob='**/util*' --glob='**/lib*' --glob='**/helper*' -l

# Check docker-compose structure - get lines around the volume mount mentioned
echo -e "\n=== Checking docker-compose.yml structure around uploads/exports ==="
rg -n 'uploadedFiles.*exports|/app/uploadedFiles/exports' docker-compose.yml -B 5 -A 2

Repository: credebl/platform

Length of output: 1054


🏁 Script executed:

#!/bin/bash

# Read the createFile function implementation
echo "=== Reading createFile function from file-operation.helper.ts ==="
cat -n apps/api-gateway/src/helper-files/file-operation.helper.ts

# Also check if there are any imports or usages related to mkdir
echo -e "\n=== Checking for mkdir or fs-extra usage in file-operation.helper.ts ==="
rg -n 'mkdir|ensureDir|mkdirSync|promises\.mkdir' apps/api-gateway/src/helper-files/file-operation.helper.ts -B 2 -A 2

Repository: credebl/platform

Length of output: 1614


🏁 Script executed:

#!/bin/bash

# Search for any .gitkeep or placeholder files
echo "=== Looking for uploadedFiles directory structure ==="
find . -path "*/uploadedFiles*" -type f -o -path "*/uploadedFiles*" -type d 2>/dev/null | head -20

# Check if there's a Dockerfile for issuance service that sets working directory
echo -e "\n=== Searching for Dockerfile or build configuration ==="
find . -name "Dockerfile*" -o -name ".dockerignore" | xargs grep -l "issuance\|WORKDIR" 2>/dev/null | head -10

# Verify the actual paths used in issuance service
echo -e "\n=== Checking all uploadedFiles references in issuance service ==="
rg -n 'uploadedFiles' apps/issuance --type=ts --type=js -B 2 -A 2

# Check if process.cwd() is being used elsewhere to understand container context
echo -e "\n=== Checking process.cwd() usage ==="
rg -n 'process\.cwd()' apps/issuance --type=ts --type=js -C 1 | head -20

Repository: credebl/platform

Length of output: 1906


🏁 Script executed:

#!/bin/bash

# Read the Dockerfile for issuance service
echo "=== Dockerfile.issuance ==="
cat -n Dockerfiles/Dockerfile.issuance

# Also check for any docker-compose overrides or additional config
echo -e "\n=== Checking if there are docker-compose overrides or extended configs ==="
find . -name "docker-compose*.yml" -o -name "docker-compose*.yaml" | head -10

Repository: credebl/platform

Length of output: 1964


🏁 Script executed:

#!/bin/bash

# Get the full docker-compose.yml to see actual structure
echo "=== Full docker-compose.yml issuance service section ==="
rg -n 'issuance:' docker-compose.yml -A 30

# Check for any volume definitions at service or compose level
echo -e "\n=== Checking volumes section in docker-compose.yml ==="
rg -n 'volumes:' docker-compose.yml -A 10

# Double-check current line 71-72 context from the file
echo -e "\n=== Exact lines 71-72 from docker-compose.yml ==="
sed -n '69,75p' docker-compose.yml

Repository: credebl/platform

Length of output: 2883


🏁 Script executed:

#!/bin/bash

# Check Node.js version to confirm mkdirSync behavior
echo "=== Confirming mkdirSync recursive flag requirement ==="
grep -i "node:" Dockerfiles/Dockerfile.issuance | head -1

# Search for any recent updates to the file-operation helper (in case recursive flag was added)
echo -e "\n=== Double-checking current createFile implementation ==="
rg -n 'mkdirSync' apps/api-gateway/src/helper-files/file-operation.helper.ts

# Check if there's a .gitkeep in uploadedFiles or any placeholder
echo -e "\n=== Looking for any gitkeep or init files ==="
find . -name ".gitkeep" -path "*uploadedFiles*" -o -name "README*" -path "*uploadedFiles*" 2>/dev/null

Repository: credebl/platform

Length of output: 279


Based on my comprehensive verification, I've identified several critical issues with the proposed volume mount configuration. Here's the rewritten review comment:


Fix critical directory creation bug and ensure host directory exists before deployment.

The proposed volume mount ($PWD/apps/uploadedFiles/exports:/app/uploadedFiles/exports) references a path that will fail at runtime due to a bug in the createFile utility. The function at apps/api-gateway/src/helper-files/file-operation.helper.ts:13 uses fs.mkdirSync(path) without the { recursive: true } flag, which will fail when creating nested directories like uploadedFiles/exports.

Additionally:

  • The host directory apps/uploadedFiles/exports does not exist in the repository (no .gitkeep or placeholder), and Docker volume mounts do not auto-create host directories
  • The Dockerfile does not initialize this directory (line 42 that would copy it is commented out)
  • File permissions and ownership are not specified in the volume mount configuration

Required fixes:

  1. Update createFile in apps/api-gateway/src/helper-files/file-operation.helper.ts to use fs.mkdirSync(path, { recursive: true })
  2. Add .gitkeep to apps/uploadedFiles/exports or ensure directory creation during deployment
  3. Consider specifying permissions via uid:gid in the docker-compose volume mount if needed
🤖 Prompt for AI Agents
In docker-compose.yml around lines 71-72, the volume mount
$PWD/apps/uploadedFiles/exports:/app/uploadedFiles/exports will fail because the
host path may not exist and your createFile utility in
apps/api-gateway/src/helper-files/file-operation.helper.ts (around line 13) uses
fs.mkdirSync(path) without recursive=true; update that function to call
fs.mkdirSync(path, { recursive: true }) so nested dirs are created, add a
placeholder (e.g., .gitkeep) or ensure the directory apps/uploadedFiles/exports
is created prior to Docker up (CI/build script or repo) so the host path exists,
and if needed adjust the docker-compose volume to include explicit uid:gid
permissions or set proper chown in the container startup to avoid permission
issues.

Copy link
Contributor

Choose a reason for hiding this comment

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

@KambleSahil3 Please add the folder

Copy link

Choose a reason for hiding this comment

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

Seems like the humans are having a chat. I'll hop back into my burrow for now. If you need me again, just tag @coderabbitai in a new comment, and I'll come hopping out!

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