Skip to content

Feature/logging#139

Merged
Aleksandergreg merged 4 commits into
devfrom
feature/logging
Apr 16, 2025
Merged

Feature/logging#139
Aleksandergreg merged 4 commits into
devfrom
feature/logging

Conversation

@Aleksandergreg
Copy link
Copy Markdown
Member

@Aleksandergreg Aleksandergreg commented Apr 16, 2025

Description

Added loggin for search, and made so that this gets saved in a Docker volume. Added the log files to gitignore, so these doesn't get shared to the public. Critical business information hihi
Related Issue:
If applicable, please reference the issue number that this pull request fixes:
Fixes #124

Type of Change

Please check the type(s) of changes your code introduces:

  • Bug fix: Non-breaking change which fixes an issue.
  • New feature: Non-breaking change which adds functionality.
  • Breaking change: Fix or feature that would cause existing functionality to change.
  • Documentation update: Changes to documentation only.

Checklist

Before creating this pull request, please ensure that your code meets the following requirements:

  • My code follows the style guidelines of this project.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have made corresponding changes to the documentation.
  • My changes generate no new warnings.
  • Any dependent changes have been merged and published in downstream modules.

Summary by CodeRabbit

  • Chores
    • Updated workflow to trigger continuous delivery only on pushes to "main" and "dev" branches.
    • Expanded .gitignore to ignore additional log file patterns.
    • Added a persistent log volume for the Sinatra app in production Docker Compose configuration.
    • Improved container startup script to ensure log directory exists and has correct permissions.

@deepsource-io
Copy link
Copy Markdown

deepsource-io Bot commented Apr 16, 2025

Here's the code health analysis summary for commits daf9fba..4cf4993. View details on DeepSource ↗.

Analysis Summary

AnalyzerStatusSummaryLink
DeepSource Ruby LogoRuby✅ SuccessView Check ↗
DeepSource Docker LogoDocker✅ SuccessView Check ↗

💡 If you’re a repository administrator, you can configure the quality gates from the settings.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 16, 2025

Walkthrough

This set of changes updates the project’s continuous delivery workflow to trigger only on pushes to the "main" and "dev" branches, removing the "feature/refactor" branch from the trigger list. The .gitignore is enhanced to ignore files matching the *.log.* pattern, broadening log file exclusion. The production Docker Compose configuration for the Sinatra application now includes a persistent log volume (sinatra_logs) mounted at /app/log, and the entrypoint script ensures this directory exists and is owned by the correct user.

Changes

File(s) Change Summary
.github/workflows/continuous_delivery.yml Removed "feature/refactor" from workflow trigger branches; now triggers only on "main" and "dev".
.gitignore Added *.log.* pattern to ignore additional log files.
sinatra/docker-compose.prod.yml Added sinatra_logs named volume, mounted at /app/log in the app container.
sinatra/docker-entrypoint.sh Ensures /app/log directory exists and is owned by appuser:appuser before starting the app.

Sequence Diagram(s)

sequenceDiagram
    participant DevOps as DevOps Engineer
    participant GitHub as GitHub Actions
    participant Docker as Docker Compose
    participant Container as Sinatra App Container

    DevOps->>GitHub: Push to main/dev branch
    GitHub->>GitHub: Trigger continuous_delivery workflow
    GitHub->>Docker: Deploy Sinatra app (using docker-compose.prod.yml)
    Docker->>Container: Start app with /app/log mounted (sinatra_logs)
    Container->>Container: docker-entrypoint.sh ensures /app/log exists and is owned by appuser
Loading

Assessment against linked issues

Objective Addressed Explanation
Log User Search Queries, lightweight logging, timestamp, persistent storage, accessible logs (#124) No direct code for logging search queries is included in this PR. Only log directory setup is present.
Logging method/format decision, logging configuration, documentation (#124) No evidence of logging method or documentation changes in this PR.

Possibly related PRs

  • Dev #118: Both PRs modify the continuous delivery workflow file, though this one changes triggers and Dev #118 updates the Docker build-push action.
  • Feature/docker update #119: Both PRs adjust the workflow trigger branches in opposite ways, making their changes directly related.
  • Feature/cd #136: Both PRs alter the workflow trigger branches, one narrowing and the other expanding the list.

Poem

A log for the bunny, a log for the team,
Now stored in a volume, persistent as a dream.
Ignore those old log bits, with patterns anew,
Entrypoint ensures the folder’s in view.
Only main and dev will make the workflow hop—
This rabbit’s delighted, the changes won’t stop!
🐇✨

Tip

⚡💬 Agentic Chat (Pro Plan, General Availability)
  • We're introducing multi-step agentic chat in review comments and issue comments, within and outside of PR's. This feature enhances review and issue discussions with the CodeRabbit agentic chat by enabling advanced interactions, including the ability to create pull requests directly from comments and add commits to existing pull requests.
✨ 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.
    • 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 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.

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.

Copy link
Copy Markdown

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

🧹 Nitpick comments (1)
.gitignore (1)

58-61: Remove duplicate log ignore pattern for tidiness.

The pattern *.log.* appears twice. Keeping only one instance is sufficient and makes the file cleaner.

-*.log.*
-*.log
-*.log.*
+*.log.*
+*.log
📜 Review details

Configuration used: .coderabbit.yml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between daf9fba and 4cf4993.

📒 Files selected for processing (4)
  • .github/workflows/continuous_delivery.yml (1 hunks)
  • .gitignore (1 hunks)
  • sinatra/docker-compose.prod.yml (2 hunks)
  • sinatra/docker-entrypoint.sh (1 hunks)
🔇 Additional comments (3)
.github/workflows/continuous_delivery.yml (1)

5-5: Workflow trigger update is correct.

Limiting workflow triggers to "main" and "dev" branches is a safe and standard practice. No issues found.

sinatra/docker-entrypoint.sh (1)

9-10: Log directory setup is correct and follows best practices.

Ensuring /app/log exists and is owned by the application user is necessary for reliable logging in containers.

sinatra/docker-compose.prod.yml (1)

8-8: Log volume addition is correct and supports persistent logging.

Mounting a named volume for logs is the right approach for containerized applications.

Also applies to: 37-37

@Aleksandergreg Aleksandergreg merged commit f056200 into dev Apr 16, 2025
4 checks passed
@Aleksandergreg Aleksandergreg deleted the feature/logging branch April 16, 2025 05:37
@coderabbitai coderabbitai Bot mentioned this pull request Apr 16, 2025
Merged
10 tasks
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