-
Notifications
You must be signed in to change notification settings - Fork 406
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
feat: Allow setting of the port number when using the --serve flag by adding a new --port (String) flag #1557
Conversation
1.Added a global variable servePort with a default value of "8000" 2.Added a new CLI flag --port that allows users to customize the port number used when serving the HTML report 3. Removed the hardcoded port number from the ServeHTML function, using the global servePort variable instead 4. The flag's Action function updates the global servePort variable when a custom port is specified These changes allow users to specify a custom port using the --port flag when using the --serve option, while maintaining the default port 8000 if no custom port is specified.
…xed_issue_#1555 fixed issue google#1555
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
@jtt @abhisek @calebbrown @iurisilvio Can anyone of you review my PR? I have also just signed the Google CLA. Excited to begin contributing to this repository. |
Hi @Riddhimaan-Senapati thanks for contributing! I like having a separate string flag to specify the port number instead of converting Can you follow https://github.com/google/osv-scanner/pull/1557/checks?check_run_id=36491080803 and Github commit name convention to resolve failed tasks |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1557 +/- ##
==========================================
- Coverage 69.31% 69.30% -0.02%
==========================================
Files 200 200
Lines 19038 19041 +3
==========================================
Hits 13196 13196
- Misses 5135 5138 +3
Partials 707 707 ☔ View full report in Codecov by Sentry. |
feature: add a new string flag to help the user specify a server port instead of just using a hard coded value
@hogo6002 Done, I have changed the PR title and fixed some linting issues in the code and created an appropriately named commit for that. |
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.
LGTM, thank you!
changes are in file osv-scanner/cmd/osv-scanner/internal/helper/helper.go
1.Added a global variable servePort with a default value of "8000"
2.Added a new CLI flag --port that allows users to customize the port number used when serving the HTML report
3.Removed the hardcoded port number from the ServeHTML function, using the global servePort variable instead
These changes allow users to specify a custom port using the --port flag when using the --serve option, while maintaining the default port 8000 if no custom port is specified.