Skip to content

Conversation

@RayyanSeliya
Copy link
Contributor

@RayyanSeliya RayyanSeliya commented Jul 26, 2025

Changes

fixes #2900

  • Updated the non-JSON console output in cmd/run.go to use net.JoinHostPort for better host:port formatting
  • The console output now shows both host and port in a more reliable format

Why

The previous implementation only showed the port number in the console output, which could be confusing when running in different environments. The new implementation:

  • Uses the standard library's net.JoinHostPort for consistent host:port formatting

Testing

The changes were tested by:

  1. Running the function locally and verifying the new output format
    see the output of testing
rayyan@rayyan-seliya:/mnt/c/Users/RAYYAN/Desktop/func/myfunction$ ../func run --address=127.0.0.1:8081
{"level":"debug","time":1753544409,"message":"func runtime creating function instance"}
{"level":"debug","address":"127.0.0.1:8081","time":1753544409,"message":"function starting"}
{"level":"debug","time":1753544409,"message":"function does not implement Start. Skipping"}
{"level":"debug","time":1753544409,"message":"waiting for stop signals or errors"}
Function running on 127.0.0.1:8081

Release Note

Improved function run output to show both host and port when running locally

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Jul 26, 2025

CLA Signed

The committers listed above are authorized under a signed CLA.

@knative-prow knative-prow bot requested review from dsimansk and vyasgun July 26, 2025 16:50
@knative-prow
Copy link

knative-prow bot commented Jul 26, 2025

Welcome @RayyanSeliya! It looks like this is your first PR to knative/func 🎉

@knative-prow knative-prow bot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jul 26, 2025
@knative-prow
Copy link

knative-prow bot commented Jul 26, 2025

Hi @RayyanSeliya. Thanks for your PR.

I'm waiting for a knative member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@gauron99
Copy link
Contributor

/ok-to-test

@knative-prow knative-prow bot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jul 26, 2025
@RayyanSeliya
Copy link
Contributor Author

RayyanSeliya commented Jul 26, 2025

hey @gauron99 i was getting fail on e2e test specifying a mismatch on the text display like before we have like Running on host port... and now we have Function running on ... so the test was failing can retrigger the test ! thx ! Sorry still failing I think more logic is required separate extraction of host and port coz it is getting stuck on url thing as I can see on the test any suggestions?

@matejvasek
Copy link
Contributor

matejvasek commented Jul 29, 2025

@RayyanSeliya
Copy link
Contributor Author

@RayyanSeliya you also need to update test, https://github.com/knative/func/blob/3641bfe5d03af71fcbfaa3065b90198da13646c3/test/e2e/scenario_extended_flow_test.go#L70-L69. You need to update the regex there.

Thx @matejvasek for helping me out i will update the regex in that test file you mentioned

@knative-prow knative-prow bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Jul 29, 2025
@matejvasek
Copy link
Contributor

/ok-to-test

@codecov
Copy link

codecov bot commented Jul 29, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 60.03%. Comparing base (d04ff0a) to head (65b9754).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2953      +/-   ##
==========================================
+ Coverage   57.55%   60.03%   +2.47%     
==========================================
  Files         132      132              
  Lines       16836    16836              
==========================================
+ Hits         9690    10107     +417     
+ Misses       6237     5771     -466     
- Partials      909      958      +49     
Flag Coverage Δ
e2e-tests 41.24% <100.00%> (+1.35%) ⬆️
integration-tests 54.76% <100.00%> (?)
unit-tests 46.89% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@matejvasek
Copy link
Contributor

/approve
/lgtm

@knative-prow knative-prow bot added the lgtm Indicates that a PR is ready to be merged. label Jul 29, 2025
@knative-prow
Copy link

knative-prow bot commented Jul 29, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: matejvasek, RayyanSeliya

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@knative-prow knative-prow bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 29, 2025
@knative-prow knative-prow bot merged commit 5ec715f into knative:main Jul 30, 2025
51 of 54 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

func run --address does not work

3 participants