-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gitutil: strip SSH port from submodule URL when rendering for HTML link #7383
Conversation
@unknwon could you take a look at this, I want to make sure the changes effect the front end, is there a CICD workflow for me to test a build with my changes? |
I just approved the CI jobs for this PR. Will take a closer at the code this week if all checks passed, thank you! |
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #7383 +/- ##
=======================================
Coverage 14.63% 14.63%
=======================================
Files 108 108
Lines 13880 13880
=======================================
Hits 2032 2032
Misses 11575 11575
Partials 273 273 |
Looks like the lint failed, I formatted and commited the change. Ready for CI job to be run again. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
This doesn't fix when a host has a port. The change I made would fix this. Your simpler solution does not fix this. |
@unknwon Can we reopen this to properly address the bug? |
@TheDarkUndoing My bad, will take another look! |
@unknwon my original change should address the issue |
@TheDarkUndoing - what is an example of "a host has a port"? |
For an example the gogs server is hosted on port 8080. The url for the host is {gogs host}:8080. I dont think there is a way to retain the port when parsing an ssh url with the way submodule.go is written. I think the baseUrl host does not retain the port number if it isn't hosted on port 80. It is written assuming that port 80 is the only port that would be hosting gogs |
Yes, but how is your original version handles it? Here we are only dealing with ssh:// urls, there is no information to tell whether the http:// should have a port or not. 🤔 |
after reviewing my last change, I was wrong my changes dont effect that. I think we would need some kind of "global" variable or env that holds the proper host URL. That may already exist, I havent checked. |
Top off my head I think having a pre-defined "global" list is suboptimal, it is unpractical to know the host URL info ahead of time. I think extend the Since the new issue is unrelated to this thread, I'd recommend to file a new issue to address that (if we want to). |
…nk (gogs#7383) Co-authored-by: Joe Chen <jc@unknwon.io>
Describe the pull request
This is the bug fix for #4941
Link to the issue: fixes #4941 (comment)
Checklist
Test plan