Skip to content

Conversation

@Stivo182
Copy link
Owner

@Stivo182 Stivo182 commented Oct 8, 2025

Summary by CodeRabbit

  • New Features

    • Unified run command with host/port options and optional parent-PID monitoring.
    • Load custom endpoints from files or folders via CLI.
    • Asynchronous service start with health checks.
    • HTTP response compression (gzip, deflate, brotli, zstd).
  • Documentation

    • README rewritten (RU): clearer setup/usage, defaults (127.0.0.1:3333), Swagger UI guidance, compatibility matrix, and custom endpoints guide.
  • Chores

    • Version bumped to 2.0.0, repository info added, dependencies updated, packaging streamlined.

@coderabbitai
Copy link

coderabbitai bot commented Oct 8, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

Refactors CLI and core service startup, adds async launch/control APIs, introduces custom endpoints loading, parent-process watching, and service launcher internals. Updates README and tests accordingly. Adjusts packaging/dependencies and ignores. Renames internal helpers in the main controller. Bumps version to 2.0.0 and reworks metadata/config files.

Changes

Cohort / File(s) Summary
Repository config and packaging
\.gitignore, autumn-properties.json, lib.config, packagedef
Updates ignore patterns; removes cli block from autumn-properties; removes class export from lib.config; revises packagedef (v2.0.0, repo/description, deps added, public HttpBin class declared, files list adjusted).
Documentation
README.md
Rewrites and expands docs (Russian): new API/usage, defaults, Swagger URL, compatibility table, custom endpoints section, updated method names and behavior.
CLI entrypoints
src/cmd/main.os, src/cmd/Классы/КомандаЗапустить.os, src/cmd/Классы/ОписаниеПриложения.os, src/cmd/Классы/HttpBin_КомандаЗапустить.os
Replaces old run command with new "run" command, adds packageinfo-driven app metadata module, revises main to normalize path and integrate controller hookup; removes legacy HttpBin_КомандаЗапустить.
Core service API
src/core/Классы/HttpBin.os
Introduces async/sync start, process orchestration, readiness checks, timeout configuration, availability probing, controller path config, URL(resource) formation, utilities, and updated lifecycle methods. Removes old stop flow.
Internal service infrastructure
src/internal/Классы/ЗапускательСервиса.os, src/internal/Классы/КонтроллерРодительскогоПроцесса.os, src/internal/Классы/ПодключательКастомныхКонтроллеров.os
Adds service launcher, parent-process watcher, and custom controllers loader (files/dirs via --routes-handlers).
App controller internals
src/app/ОсновнойКонтроллер.os
Privatizes globals (Помощник→_Помощник, КаталогШаблонов→_КаталогШаблонов) and updates references/imports.
Response helper enhancements
src/internal/Классы/ПомощникПодготовкиОтветов.os
Adds compression (gzip/deflate/brotli/zstd), URL(resource), request/headers utilities, form-data parsing, binary/text representation helpers, and JSON helpers; updates exported procedures.
Tests and fixtures
tests/HttpBin_API_test.os, tests/HttpBin_test.os, tests/fixtures/КастомныеКонтроллеры/КастомныйКонтроллер.os
Updates to new APIs and env flag, renames tests, adjusts delays, adds helper function, introduces custom controller fixture.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor User as CLI User
  participant CLI as Команда "run"
  participant Watcher as КонтроллерРодительскогоПроцесса
  participant Launcher as ЗапускательСервиса
  participant Server as Веб-сервер

  User->>CLI: oscript app.os run --host --port [--parent-pid PID] [--routes-handlers ...]
  alt PID provided
    CLI->>Watcher: НачатьНаблюдение(PID)
    Note right of Watcher: Periodically checks parent process
  end
  CLI->>Launcher: Запустить(Хост, Порт)
  Launcher->>Server: Настроить и запустить
  Watcher-->>CLI: (async monitoring)
  Server-->>User: Сервис принимает запросы
Loading
sequenceDiagram
  autonumber
  actor Test as Tests
  participant HB as HttpBin
  participant OS as OScript Runtime
  participant Svc as Сервис (external process)
  participant Probe as HTTP Probe

  Test->>HB: УстановитьХост/Порт/РасположениеКонтроллеров
  Test->>HB: Запустить() / ЗапуститьАсинх()
  HB->>OS: ЗапуститьПроцесс(Синхронно/Асинхронно)
  OS->>Svc: Spawn with args [--routes-handlers ...]
  opt Синхронно
    HB->>Probe: НачатьОжиданиеЗапуска → HEAD URL
    Probe-->>HB: 200/готов
  end
  Test->>HB: URL("/path")
  Test->>Svc: HTTP запросы
  Test->>HB: ОжидатьЗавершения() / Активен() / Отвечает()
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

Poem

A whisk of ports, a hop of hosts, I run!
Routes I nibble, custom crumbs—such fun.
I watch my parent, ears alert,
Compress my bytes, no lag or hurt.
New paths await—bin to begin—
With 2.0 paws, let tests hop in! 🐇✨

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch v2.0.0

📜 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 0716069 and 9c2addf.

📒 Files selected for processing (18)
  • .gitignore (1 hunks)
  • README.md (3 hunks)
  • autumn-properties.json (0 hunks)
  • lib.config (0 hunks)
  • packagedef (1 hunks)
  • src/app/ОсновнойКонтроллер.os (28 hunks)
  • src/cmd/main.os (1 hunks)
  • src/cmd/Классы/HttpBin_КомандаЗапустить.os (0 hunks)
  • src/cmd/Классы/КомандаЗапустить.os (1 hunks)
  • src/cmd/Классы/ОписаниеПриложения.os (1 hunks)
  • src/core/Классы/HttpBin.os (2 hunks)
  • src/internal/Классы/ЗапускательСервиса.os (1 hunks)
  • src/internal/Классы/КонтроллерРодительскогоПроцесса.os (1 hunks)
  • src/internal/Классы/ПодключательКастомныхКонтроллеров.os (1 hunks)
  • src/internal/Классы/ПомощникПодготовкиОтветов.os (16 hunks)
  • tests/HttpBin_API_test.os (4 hunks)
  • tests/HttpBin_test.os (1 hunks)
  • tests/fixtures/КастомныеКонтроллеры/КастомныйКонтроллер.os (1 hunks)

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.

@Stivo182 Stivo182 merged commit e6ac8e4 into main Oct 8, 2025
15 of 16 checks passed
@Stivo182 Stivo182 deleted the v2.0.0 branch October 8, 2025 16:18
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