Skip to content

feat: search next available tcp port for port forward function call#2362

Merged
JeffreyDallas merged 58 commits intomainfrom
02300-D-tcp-port
Aug 12, 2025
Merged

feat: search next available tcp port for port forward function call#2362
JeffreyDallas merged 58 commits intomainfrom
02300-D-tcp-port

Conversation

@JeffreyDallas
Copy link
Copy Markdown
Contributor

@JeffreyDallas JeffreyDallas commented Jul 28, 2025

Description

This pull request changes the following:

  • update component scheme to save port forward information
  • refactor portForward function to support using next available port number or re-use pre-existing port number
  • refactor addNewComponent function to support replace pre-existing component
  • search next available tcp port for port forward function call
  • a utility function managePortForward to check pre-exising port number used for port forward, if not exist then use next available TCP port

Related Issues

Pull request (PR) checklist

  • This PR added tests (unit, integration, and/or end-to-end)
  • This PR updated documentation
  • This PR added no TODOs or commented out code
  • This PR has no breaking changes
  • Any technical debt has been documented as a separate issue and linked to this PR
  • Any package.json changes have been explained to and approved by a repository manager
  • All related issues have been linked to this PR
  • All changes in this PR are included in the description
  • When this PR merges the commits will be squashed and the title will be used as the commit message, the 'commit message guidelines' below have been followed

Testing

  • This PR added unit tests
  • This PR added integration/end-to-end tests
  • These changes required manual testing that is documented below
  • Anything not tested is documented

The following manual testing was done:

  • TBD

The following was not tested:

  • TBD
Commit message guidelines We use 'Conventional Commits' to ensure that our commit messages are easy to read, follow a consistent format, and for automated release note generation. Please follow the guidelines below when writing your commit messages:
  1. BREAKING CHANGE: a commit that has a footer BREAKING CHANGE:, or appends a ! after the type/scope, introduces a breaking API change (correlating with MAJOR in Semantic Versioning). A BREAKING CHANGE can be part of commits of any type. NOTE: currently breaking changes will only bump the MAJOR version.
  2. The title is prefixed with one of the following:
Prefix Description Semantic Version Update Captured in Release Notes
feat: a new feature MINOR Yes
fix: a bug fix PATCH Yes
perf: performance PATCH Yes
refactor: code change that isn't feature or fix none No
test: adding missing tests none No
docs: changes to documentation none Yes
build: changes to build process none No
ci: changes to CI configuration none No
style: formatting, missing semi-colons, etc none No
chore: updating grunt tasks etc; no production code change none No

Signed-off-by: Jeffrey Tang <jeffrey@swirldslabs.com>
Signed-off-by: Jeffrey Tang <jeffrey@swirldslabs.com>
@JeffreyDallas JeffreyDallas requested a review from a team as a code owner July 28, 2025 06:04
@JeffreyDallas JeffreyDallas self-assigned this Jul 28, 2025
@JeffreyDallas JeffreyDallas requested a review from Copilot July 28, 2025 06:04

This comment was marked as outdated.

Signed-off-by: Jeffrey Tang <jeffrey@swirldslabs.com>
@JeffreyDallas JeffreyDallas requested a review from Copilot July 28, 2025 06:10

This comment was marked as outdated.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Jul 28, 2025

Unit Test Results - Linux

32 tests  ±0   32 ✅ ±0   0s ⏱️ ±0s
16 suites ±0    0 💤 ±0 
 1 files   ±0    0 ❌ ±0 

Results for commit eadad52. ± Comparison against base commit 8d8292f.

♻️ This comment has been updated with latest results.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Jul 28, 2025

Unit Test Results - Windows

  1 files  ±0  177 suites  +2   4s ⏱️ -1s
494 tests +2  494 ✅ +2  0 💤 ±0  0 ❌ ±0 
498 runs  +2  498 ✅ +2  0 💤 ±0  0 ❌ ±0 

Results for commit eadad52. ± Comparison against base commit 8d8292f.

♻️ This comment has been updated with latest results.

JeffreyDallas and others added 4 commits July 28, 2025 01:15
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: JeffreyDallas <39912573+JeffreyDallas@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: JeffreyDallas <39912573+JeffreyDallas@users.noreply.github.com>
Signed-off-by: Jeffrey Tang <jeffrey@swirldslabs.com>
@JeffreyDallas JeffreyDallas requested a review from Copilot July 28, 2025 06:20

This comment was marked as outdated.

JeffreyDallas and others added 3 commits July 28, 2025 01:23
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: JeffreyDallas <39912573+JeffreyDallas@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: JeffreyDallas <39912573+JeffreyDallas@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: JeffreyDallas <39912573+JeffreyDallas@users.noreply.github.com>
@github-actions
Copy link
Copy Markdown
Contributor

E2E Test Report

 20 files  139 suites   2h 5m 51s ⏱️
379 tests 379 ✅ 0 💤 0 ❌
392 runs  392 ✅ 0 💤 0 ❌

Results for commit 6d07e40.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Jul 28, 2025

E2E Test Report

 20 files  ±0  139 suites  ±0   2h 9m 12s ⏱️ + 1m 9s
379 tests ±0  379 ✅ ±0  0 💤 ±0  0 ❌ ±0 
392 runs  ±0  392 ✅ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit eadad52. ± Comparison against base commit 8d8292f.

♻️ This comment has been updated with latest results.

@codacy-production
Copy link
Copy Markdown

codacy-production bot commented Jul 28, 2025

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
-0.09% (target: -1.00%) 78.25%
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (8d8292f) 41562 35728 85.96%
Head commit (eadad52) 41958 (+396) 36029 (+301) 85.87% (-0.09%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#2362) 469 367 78.25%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

Copy link
Copy Markdown
Contributor

@jeromy-cannon jeromy-cannon left a comment

Choose a reason for hiding this comment

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

all of the instances of

addMessageGroupMessage(key: string, message: string): void;
where it is adding a port message needs to be updated to use the port that was incremented from the default

@jeromy-cannon jeromy-cannon added the PR: Unresolved Comments A pull request where there are comments and they need to be resolved. label Jul 28, 2025
Signed-off-by: Jeffrey Tang <jeffrey@swirldslabs.com>
…tcp-port

Signed-off-by: Jeffrey Tang <jeffrey@swirldslabs.com>

# Conflicts:
#	src/integration/kube/k8-client/resources/pod/k8-client-pod.ts
@JeffreyDallas JeffreyDallas removed the PR: Unresolved Comments A pull request where there are comments and they need to be resolved. label Jul 28, 2025
@jeromy-cannon jeromy-cannon added the PR: Unresolved Comments A pull request where there are comments and they need to be resolved. label Aug 8, 2025
JeffreyDallas and others added 2 commits August 8, 2025 15:24
Co-authored-by: Jeromy Cannon <jeromy@swirldslabs.com>
Signed-off-by: JeffreyDallas <39912573+JeffreyDallas@users.noreply.github.com>
Co-authored-by: Jeromy Cannon <jeromy@swirldslabs.com>
Signed-off-by: JeffreyDallas <39912573+JeffreyDallas@users.noreply.github.com>
@jeromy-cannon jeromy-cannon added the PR: Merge Conflicts A pull request that has merge conflicts that need to be resolved. label Aug 8, 2025
Signed-off-by: Jeffrey Tang <jeffrey@swirldslabs.com>
Signed-off-by: Jeffrey Tang <jeffrey@swirldslabs.com>
Signed-off-by: Jeffrey Tang <jeffrey@swirldslabs.com>
@JeffreyDallas JeffreyDallas requested a review from a team as a code owner August 11, 2025 13:04
JeffreyDallas and others added 5 commits August 11, 2025 13:29
Signed-off-by: Jeffrey Tang <jeffrey@swirldslabs.com>
…tcp-port

Signed-off-by: Jeffrey Tang <jeffrey@swirldslabs.com>

# Conflicts:
#	package.json
Signed-off-by: Jeffrey Tang <jeffrey@swirldslabs.com>
Signed-off-by: Jeffrey Tang <jeffrey@swirldslabs.com>
@JeffreyDallas JeffreyDallas added PR: Needs Team Approval A pull request that needs review from a team member. and removed PR: Unresolved Comments A pull request where there are comments and they need to be resolved. PR: Merge Conflicts A pull request that has merge conflicts that need to be resolved. labels Aug 12, 2025
Signed-off-by: Jeffrey Tang <jeffrey@swirldslabs.com>
Signed-off-by: Jeffrey Tang <jeffrey@swirldslabs.com>
@jeromy-cannon jeromy-cannon added PR: Ready to Merge A pull request that is ready to merge. and removed PR: Needs Team Approval A pull request that needs review from a team member. labels Aug 12, 2025
@JeffreyDallas JeffreyDallas merged commit 22f5a04 into main Aug 12, 2025
44 of 45 checks passed
@JeffreyDallas JeffreyDallas deleted the 02300-D-tcp-port branch August 12, 2025 21:10
swirlds-automation added a commit that referenced this pull request Aug 15, 2025
## [0.43.0](v0.42.0...v0.43.0) (2025-08-15)

### Features

* Add kubectl dependency manager ([#2422](#2422)) ([a482302](a482302))
* control block node version as environment variable ([#2472](#2472)) ([c678d90](c678d90))
* Docker build section ([#2433](#2433)) ([2578351](2578351))
* search next available tcp port for port forward function call ([#2362](#2362)) ([22f5a04](22f5a04))

### Bug Fixes

* disable the setting of the gRPC web endpoint when running for apps that are not CN, bump MN to v0.136.0 ([#2463](#2463)) ([16b7cb2](16b7cb2))
* Migrate to using @hiero-ledger/sdk ([#2452](#2452)) ([b9a7018](b9a7018))
* Remove requirement for kind dependency ([#2451](#2451)) ([974303c](974303c))
* update markdown documentation generation script ([#2449](#2449)) ([328544a](328544a))
@swirlds-automation
Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 0.43.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@swirlds-automation
Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 0.43.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR: Ready to Merge A pull request that is ready to merge. released on @0.43.x released

Projects

None yet

4 participants