Skip to content

feat(postgresql): add service plugin#5

Merged
lukyrys merged 1 commit intomainfrom
feature/postgresql-plugin
May 4, 2026
Merged

feat(postgresql): add service plugin#5
lukyrys merged 1 commit intomainfrom
feature/postgresql-plugin

Conversation

@lukyrys
Copy link
Copy Markdown
Contributor

@lukyrys lukyrys commented May 4, 2026

Adds a PostgreSQL service plugin with WDC-managed binary detection, initdb data directory initialization, pg_ctl start/stop/reload, pg_isready readiness checks, service status/logs, manifest, README, and icon.\n\nLocal verification:\n- dotnet restore NKS.WebDevConsole.Plugin.PostgreSQL/NKS.WebDevConsole.Plugin.PostgreSQL.csproj\n- dotnet build NKS.WebDevConsole.Plugin.PostgreSQL/NKS.WebDevConsole.Plugin.PostgreSQL.csproj -c Debug --no-restore\n- dotnet build NKS.WebDevConsole.Plugin.PostgreSQL/NKS.WebDevConsole.Plugin.PostgreSQL.csproj -c Release --no-restore --nologo\n- Debug build loop over all NKS.WebDevConsole.Plugin.* projects\n- git diff --check

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 4, 2026

Warning

Rate limit exceeded

@lukyrys has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 25 minutes and 7 seconds before requesting another review.

To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: d860e106-6090-4b49-8a05-4673ff23abe3

📥 Commits

Reviewing files that changed from the base of the PR and between 970694c and 39dad49.

⛔ Files ignored due to path filters (1)
  • NKS.WebDevConsole.Plugin.PostgreSQL/Resources/icon.svg is excluded by !**/*.svg
📒 Files selected for processing (5)
  • NKS.WebDevConsole.Plugin.PostgreSQL/NKS.WebDevConsole.Plugin.PostgreSQL.csproj
  • NKS.WebDevConsole.Plugin.PostgreSQL/PostgreSqlModule.cs
  • NKS.WebDevConsole.Plugin.PostgreSQL/PostgreSqlPlugin.cs
  • NKS.WebDevConsole.Plugin.PostgreSQL/README.md
  • NKS.WebDevConsole.Plugin.PostgreSQL/plugin.json
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/postgresql-plugin

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
Review rate limit: 0/1 reviews remaining, refill in 25 minutes and 7 seconds.

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

@lukyrys lukyrys merged commit 397bde4 into main May 4, 2026
4 checks passed
@lukyrys lukyrys deleted the feature/postgresql-plugin branch May 4, 2026 10:08
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 39dad49fb4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +144 to +149
using var cts = CancellationTokenSource.CreateLinkedTokenSource(ct);
cts.CancelAfter(TimeSpan.FromSeconds(_config.GracefulTimeoutSecs));
var result = await Cli.Wrap(_config.PgCtlPath)
.WithArguments(new[] { "-D", _config.DataDir, "stop", "-m", "fast" })
.WithValidation(CommandResultValidation.None)
.ExecuteBufferedAsync(cts.Token);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Ensure stop cleanup runs when pg_ctl times out

If pg_ctl stop takes longer than GracefulTimeoutSecs, ExecuteBufferedAsync(cts.Token) throws OperationCanceledException and this method exits before disposing _process and restoring _state from Stopping. That leaves the module in a stuck transitional state (and can block future starts because StartAsync only allows Stopped/Crashed). Wrap the pg_ctl call in try/finally (or catch timeout explicitly) so state reconciliation and handle cleanup always run.

Useful? React with 👍 / 👎.

Comment on lines +146 to +150
var result = await Cli.Wrap(_config.PgCtlPath)
.WithArguments(new[] { "-D", _config.DataDir, "stop", "-m", "fast" })
.WithValidation(CommandResultValidation.None)
.ExecuteBufferedAsync(cts.Token);
PublishBuffered(result);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Fail stop when pg_ctl returns a non-zero exit code

The stop path captures pg_ctl output but never checks result.ExitCode, then unconditionally sets the service to Stopped. When pg_ctl stop fails (bad datadir, permissions, stale PID state), the daemon will report PostgreSQL as stopped even though the server may still be running. Mirror StartAsync/ReloadAsync behavior by validating the exit code before transitioning state.

Useful? React with 👍 / 👎.

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