Skip to content

port check migration fix#6905

Merged
benedettadavico merged 1 commit into
developfrom
ns/fix
Jun 23, 2026
Merged

port check migration fix#6905
benedettadavico merged 1 commit into
developfrom
ns/fix

Conversation

@benedettadavico

@benedettadavico benedettadavico commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • Bug Fixes
    • Improved error handling in gateway port check data processing to gracefully manage malformed or inconsistent data entries without interrupting the migration process.
    • Enhanced system robustness with targeted error recovery, ensuring gateway status monitoring continues operating smoothly even when encountering edge-case data scenarios.

@vercel

vercel Bot commented Jun 23, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
nym-explorer-v2 Error Error Jun 23, 2026 10:40am
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
docs-nextra Ignored Ignored Jun 23, 2026 10:40am
nym-node-status Ignored Ignored Jun 23, 2026 10:40am

Request Review

@coderabbitai

coderabbitai Bot commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 89c35537-9481-458c-b3e5-2ae49f13928f

📥 Commits

Reviewing files that changed from the base of the PR and between e6458c4 and 9231b6d.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (2)
  • nym-node-status-api/nym-node-status-api/migrations_pg/20260415000000_gateways_ports_check.sql
  • nym-node-status-api/nym-node-status-api/migrations_pg/20260519133000_gateways_ports_check_json_guard.sql

📝 Walkthrough

Walkthrough

Two PostgreSQL migration scripts are updated to replace bulk UPDATE statements that assumed all last_probe_result values were valid JSONB with per-row DO $$ procedural blocks. Each block filters candidate rows, attempts a per-row cast to jsonb, extracts and writes ports_check, removes it from last_probe_result, and catches invalid_text_representation to skip rows with malformed JSON.

Changes

Guarded ports_check extraction in gateway migrations

Layer / File(s) Summary
Row-by-row guarded ports_check extraction
migrations_pg/20260415000000_gateways_ports_check.sql, migrations_pg/20260519133000_gateways_ports_check_json_guard.sql
Both migrations replace bulk UPDATE … SET … WHERE last_probe_result IS NOT NULL with DO $$ blocks that iterate per row, attempt last_probe_result::jsonb, conditionally update ports_check and strip the key from last_probe_result, and suppress invalid_text_representation to skip rows with truncated or otherwise invalid JSON without aborting the migration.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐇 Hopping through each JSON row,
I cast with care, not all at once — oh no!
If the text is broken, I skip right past,
No migration crash, no error blast.
Per-row we go, steady and slow,
The database is safe, and now we know! ✨

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ns/fix

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.

@benedettadavico
benedettadavico merged commit 0dc2ebb into develop Jun 23, 2026
10 of 14 checks passed
@benedettadavico
benedettadavico deleted the ns/fix branch June 23, 2026 10:40
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