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: reinstate har-validator #15

Merged
merged 1 commit into from
Nov 25, 2021

Conversation

grxy
Copy link

@grxy grxy commented Nov 24, 2021

PR Checklist:

  • I have run npm test locally and all tests are passing. [they are passing in CI]
  • I have added/updated tests for any new behavior. [N/A]
  • If this is a significant change, an issue has already been created where the problem / solution was discussed: [N/A]

PR Description

Reinstates har-validator

Fixes cypress-io/cypress#19097
Fixes #14

@grxy
Copy link
Author

grxy commented Nov 24, 2021

CC: @flotwig who approved the original dependency removal.

Copy link

@JJ JJ left a comment

Choose a reason for hiding this comment

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

I don't think it's a good idea to re-add deprecated code, even if it breaks installation in yarn. It breaks code that's not tested, so it's probably not needed anyway. This was part of the original request library, it's probably not needed now in cypress

Probably not needed no matter what, since I haven't seen similar code in axios or others.

As an alternative, remove the require as well as the check that uses this. Tests are going to continue green, this is not going to be needed. Please refer to this issue in har-validator for the reasons why it was abandoned (mainly too much work due to request... which was also abandoned and eventually adopted here)

Other alternatives: import relevant code. However, I don't see HTTP archive validation as a real requirement in this context. See also #9 (which probably should have been closed by #14)

@erwanriou
Copy link

erwanriou commented Nov 25, 2021

Just be aware that all cypress installations, builders, pipelines are stuck right now because of this (yes global failure) if they don't handle package.lock.json or yarn.lock and the temporary fix to manually install this library not idealistic.

Yes its not great to reinstall a useless package, but it's even less to have the whole cypress installation flow down.

We can fix it here OR in cypress yarn package.lock removing the ^ but that would generate a new version of cypress to install and older version would still be broken.

@jankanty
Copy link

It's not only yarn problem. Npm without locks also fails miserably. I'd suggest revert this change and fix it by removing usage after.

@JJ JJ mentioned this pull request Nov 25, 2021
3 tasks
@damikun
Copy link

damikun commented Nov 25, 2021

My CI/CD is broken since local dev has equal build pipeline I'm not able event build code locally now.. This is really big failure in repo..

@JJ
Copy link

JJ commented Nov 25, 2021

My CI/CD is broken since local dev has equal build pipeline I'm not able event build code locally now.. This is really big failure in repo..

As a temporal fix, you can install har-validator in the pipeline. Long term fix is #16

@meeroslav
Copy link

@JJ this trickles down to everyone who's solution contains cypress.

The number of users is large and not everyone will find their way here (or cypress-io/cypress#19097) so fix needs to be published as soon as possible. Installing har-validator might not be such a simple task (think E2E tests on CI that generate the workspace and run install without lock files).

@flotwig flotwig merged commit 7455973 into cypress-io:master Nov 25, 2021
@flotwig
Copy link

flotwig commented Nov 25, 2021

A PR to remove the usage of har-validator is welcome.

@flotwig
Copy link

flotwig commented Nov 25, 2021

🎉 This PR is included in version 2.88.9 🎉

The release is available on:

Your semantic-release bot 📦🚀

@JJ
Copy link

JJ commented Nov 25, 2021

A PR to remove the usage of har-validator is welcome.

Well, I can incorporate that into #16 if you want.

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

Successfully merging this pull request may close these issues.

Missing har-validator causing yarn installs to fail Cannot find module 'har-validator'