Skip to content
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

Add "strictPort" configuration property #699

Closed
peter-at-work opened this issue Jun 13, 2024 · 3 comments
Closed

Add "strictPort" configuration property #699

peter-at-work opened this issue Jun 13, 2024 · 3 comments
Labels
cli Concerns the piral-cli application. enhancement New feature or request
Milestone

Comments

@peter-at-work
Copy link
Contributor

New Feature Proposal

For more information, see the CONTRIBUTING guide.

Description

Occasionally, and from external factors, the desired port number for the local server is in-use. Through the get-port npm package, piral-cli deals with this by having the local server listen on another random port.

The feature request is a configuration option that would change the server behavior to immediately exit if the desired port is not available. This is similar to the "strictPort" option introduced in vitejs https://v3.vitejs.dev/config/server-options.html#server-strictport

Background

When running automated tests, the switch to another random port cannot be readily detected, aside from some indeterminate time limit waiting on the server being available on the desired port number. An immediate exit on the server with some error code would make this situation immediately detectable and the automated tests can be aborted.

@peter-at-work peter-at-work added the enhancement New feature or request label Jun 13, 2024
@FlorianRappl FlorianRappl added cli Concerns the piral-cli application. in-review The item is currently being reviewed. labels Jun 13, 2024
@FlorianRappl FlorianRappl added this to the 1.6.0 milestone Jun 13, 2024
@FlorianRappl
Copy link
Contributor

Yes we can add this. I'd propose to call this --strict-port with default being false (i.e., --no-strict-port is the default); besides the CLI it can be configured via the .piralrc, too.

Sounds good?

@peter-at-work
Copy link
Contributor Author

Yes we can add this. I'd propose to call this --strict-port with default being false (i.e., --no-strict-port is the default); besides the CLI it can be configured via the .piralrc, too.

Sounds good?

🙏
That is totally fine. Any which way that the gist of the requested feature can be provided will be helpful to our dev/test workflow. I really wish I could spare the time writing the PR for this... just too much other dev work on the table. We're okay if this gets bumped lower in implementation priority.

@FlorianRappl FlorianRappl added in-implementation The item is currently being implemented. and removed in-review The item is currently being reviewed. labels Jun 18, 2024
FlorianRappl added a commit that referenced this issue Jun 18, 2024
@FlorianRappl FlorianRappl added in-testing The item is already out in preview and can be tested. and removed in-implementation The item is currently being implemented. labels Jun 18, 2024
@FlorianRappl
Copy link
Contributor

Part of the preview for the 1.6.0.

Tested and works.

@FlorianRappl FlorianRappl removed the in-testing The item is already out in preview and can be tested. label Jun 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cli Concerns the piral-cli application. enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants