Skip to content

chore: extract common code - #59

Closed
vladopajic wants to merge 1 commit into
masterfrom
common-code
Closed

vladopajic wants to merge 1 commit into
masterfrom
common-code

Conversation

@vladopajic

Copy link
Copy Markdown
Contributor
  • created common directory to hold common/shared code between nim nodes.
    • moved some code to this directory, and reused it in nim nodes
  • updated docker files to copy shared source when building

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

Both gossipsub-queues Dockerfiles break the existing per-directory build context and require updated invocation or compatibility fixes.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 2 High severity

Open (2)
What changed in this PR

Extracts shared Nim utilities into nim-test-node/common and updates node builds to use them.

Changes:

  • Centralizes shutdown, health-server, and peer-ID helpers.
  • Updates imports, Docker contexts, paths, and Kaniko configuration.
  • Refreshes build documentation and dependencies.
File Reviewed change
shadow/​kaniko-build-test-node-job.yaml Updates Kaniko context and Dockerfile paths.
shadow/​Dockerfile Updates the regression image reference.
nim-test-node/​service-discovery/​run.sh Uses the parent build context.
nim-test-node/​service-discovery/​main.nim Uses shared health and shutdown helpers.
nim-test-node/​service-discovery/​helpers.nim Removes duplicated health-server code.
nim-test-node/​service-discovery/​Dockerfile Copies shared sources.
nim-test-node/​regression/​README.md Documents parent-context builds.
nim-test-node/​regression/​node/​main.nim Uses shared shutdown handling.
nim-test-node/​regression/​Dockerfile_shadow Updates source paths.
nim-test-node/​regression/​Dockerfile Updates source paths and workdir.
nim-test-node/​regression/​bootstrap/​main.nim Uses shared shutdown handling.
nim-test-node/​kad-dht/​README.md Documents parent-context builds.
nim-test-node/​kad-dht/​main.nim Uses shared helpers and RNG flow.
nim-test-node/​kad-dht/​helpers.nim Removes duplicated helpers.
nim-test-node/​kad-dht/​Dockerfile Copies shared sources.
nim-test-node/​kad-dht/​core.nim Uses shared peer-ID generation.
nim-test-node/​gossipsub-queues/​main.nim Uses shared shutdown handling.
nim-test-node/​gossipsub-queues/​Dockerfile_arm64 Adds shared-source copying; requires a parent build context.
nim-test-node/​gossipsub-queues/​Dockerfile_amd64 Adds shared-source copying; requires a parent build context.
nim-test-node/​connmanager/​test_node.nimble Updates dependencies.
nim-test-node/​connmanager/​README.md Documents parent-context builds.
nim-test-node/​connmanager/​main.nim Uses shared shutdown handling.
nim-test-node/​connmanager/​Dockerfile Copies shared sources.
nim-test-node/​common/​shutdown.nim Adds shared shutdown behavior.
nim-test-node/​common/​peer_ids.nim Adds shared peer-ID helpers.
nim-test-node/​common/​health_server.nim Adds the shared health server.
nim-test-node/​.dockerignore Adds build-context exclusions.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +5 to +6
COPY common /node/common
COPY gossipsub-queues/. .
Comment on lines +5 to +6
COPY common /node/common
COPY gossipsub-queues/. .
@vladopajic
vladopajic marked this pull request as draft September 24, 2026 17:15
@vladopajic vladopajic closed this Sep 24, 2026
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