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

fix: check ip version if settings.useStaticServer #6936

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

khendrikse
Copy link
Contributor

🎉 Thanks for submitting a pull request! 🎉

Summary

This hopefully fixes this: https://answers.netlify.com/t/128792

I noticed, while running this on windows in a VM, that the proxy was trying to connect to an IPv4 server, while the static server was actually an IPv6 one.

With this logic, we explicitly check what version we are running within the settings.useStaticServer branch of logic as well.


For us to review and ship your PR efficiently, please perform the following steps:

  • Open a bug/issue before writing your code 🧑‍💻. This ensures we can discuss the changes and get feedback from everyone that should be involved. If you`re fixing a typo or something that`s on fire 🔥 (e.g. incident related), you can skip this step.
  • Read the contribution guidelines 📖. This ensures your code follows our style guide and
    passes our tests.
  • Update or add tests (if any source code was changed or added) 🧪
  • Update or add documentation (if features were changed or added) 📝
  • Make sure the status checks below are successful ✅

A picture of a cute animal (not mandatory, but encouraged)

@khendrikse khendrikse requested a review from a team as a code owner November 25, 2024 10:45
@khendrikse khendrikse requested review from eduardoboucas and removed request for a team November 25, 2024 10:45
Copy link
Member

@eduardoboucas eduardoboucas left a comment

Choose a reason for hiding this comment

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

Were you able to see the failure in the CI? Any chance we could add a test to verify it's fixed?

@@ -30,9 +31,11 @@ export const startFrameworkServer = async function ({
if (settings.command) {
runCommand(settings.command, { env: settings.env, cwd })
}
await startStaticServer({ settings })
const { address } = await startStaticServer({ settings })
Copy link
Member

Choose a reason for hiding this comment

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

Rather than getting address and then trying to figure out the IP family from the hostname, can you not use the family property directly?

https://nodejs.org/api/net.html#serveraddress

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm gonna find out!!! yes!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@khendrikse
Copy link
Contributor Author

Were you able to see the failure in the CI? Any chance we could add a test to verify it's fixed?

No we didn't see it, but I'm going to try out running tests on win + node 23 in the pipelines. Wish me luck lol.

@khendrikse khendrikse force-pushed the CPLA-2390/expose-ip-version-for-static-server branch from 2710330 to 8a56858 Compare November 25, 2024 15:11
DanielSLew
DanielSLew previously approved these changes Nov 25, 2024
@khendrikse khendrikse force-pushed the CPLA-2390/expose-ip-version-for-static-server branch from 5322732 to 98ea076 Compare November 25, 2024 15:38
@@ -682,7 +682,9 @@ describe.concurrent('command/dev', () => {
async (server) => {
const output = server.outputBuffer.map((buff) => buff.toString()).join('\n')
t.expect(output).toContain('Server now ready')
t.expect(server.errorBuffer).toHaveLength(0)
// With node 23 we might be getting some warnings, but no errors
Copy link
Member

Choose a reason for hiding this comment

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

What warnings? Isn't that what we're fixing with this PR? Also, we're not looking for any specific OS or Node.js version here, so we're suddenly saying that it's okay for any OS and any Node.js version to have warnings — is that intended?

runs-on: ${{ matrix.os }}
timeout-minutes: 40
strategy:
matrix:
Copy link
Member

Choose a reason for hiding this comment

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

nit: You don't need a matrix if you only want to use one OS and one Node.js version.

strategy:
matrix:
os: [windows-latest]
node-version: ['23']
Copy link
Member

Choose a reason for hiding this comment

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

Is this not latest?

@@ -123,3 +123,105 @@ jobs:
flags: ${{ steps.test-coverage-flags.outputs.os }},${{ steps.test-coverage-flags.outputs.node }}
token: ${{ secrets.CODECOV_TOKEN }}
if: '${{ !steps.release-check.outputs.IS_RELEASE }}'
integration-win-node-23:
Copy link
Member

Choose a reason for hiding this comment

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

What is the long-term plan for this action? I understand we're looking to test this specific version today, but what happens after this goes to LTS and beyond? Can this be removed? Just trying to make sure we're not left with this extra step forever without people understanding why. Perhaps adding a comment here would help?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants