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 Misc Bugs Introduced in Pack Generator Refactoring #1515

Merged
merged 2 commits into from
Jan 30, 2023

Conversation

pulkitkkr
Copy link
Contributor

@pulkitkkr pulkitkkr commented Jan 30, 2023

Summary

Refactoring in PR1509 introduced follwing bugs:

  • The refactor created semver_to_string method in ReactOnRails::Utils but they were referenced using ReactOnRails::WebpackerUtils

  • shackapacker_version_requirement_met? is checking minimum version >= installed version whereas we want to check installed_version > minimum_version. Further, the logic will fail when a required version is 6.5.3 and the installed is 6.6.1.

This PR addresses these critical bugs


This change is Reviewable

above to use the automated bundle generation feature. The currently installed version is \
#{ReactOnRails::WebpackerUtils.semver_to_string(ReactOnRails::WebpackerUtils.shakapacker_version_as_array)}.
#{ReactOnRails::Utils.semver_to_string(ReactOnRails::WebpackerUtils.shakapacker_version_as_array)}.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Judahmeek Should we move semver_to_string to WebpackerUtils instead?

@ahangarha
Copy link
Contributor

This is not good that our tests are getting passed despite what module to use!
Whatever the right solution is, we need to improve our tests to cover it.

@pulkitkkr pulkitkkr changed the title Fix Wrong Module Name while referencing semver_to_string method Fix Misc Bugs Introduced in Pack Generator Refactoring Jan 30, 2023
@pulkitkkr pulkitkkr force-pushed the pulkitkkr/bugfix-semver branch 5 times, most recently from 2378e03 to 33117d3 Compare January 30, 2023 13:39
Copy link
Contributor

@Judahmeek Judahmeek left a comment

Choose a reason for hiding this comment

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

Reviewable status: 0 of 3 files reviewed, 1 unresolved discussion

Copy link
Contributor

@Judahmeek Judahmeek left a comment

Choose a reason for hiding this comment

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

Reviewed 3 of 3 files at r2, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion

Copy link
Contributor

@Judahmeek Judahmeek left a comment

Choose a reason for hiding this comment

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

Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @pulkitkkr)


lib/react_on_rails/webpacker_utils.rb line 124 at r1 (raw file):

Previously, pulkitkkr (Pulkit) wrote…

@Judahmeek Should we move semver_to_string to WebpackerUtils instead?

yes

def self.shackapacker_version_requirement_met?(required_version)
req_ver = semver_to_string(required_version)

Gem::Version.new(shakapacker_version) >= Gem::Version.new(req_ver)
Copy link
Member

Choose a reason for hiding this comment

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

This is much better.

@justin808 justin808 merged commit b6a3e37 into master Jan 30, 2023
@justin808 justin808 deleted the pulkitkkr/bugfix-semver branch January 30, 2023 22:54
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.

4 participants