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

Update Flipper #4489

Open
wants to merge 12 commits into
base: develop
Choose a base branch
from
Open

Update Flipper #4489

wants to merge 12 commits into from

Conversation

StephenHulme
Copy link
Contributor

Flipper was causing dependency lock with Sinatra (see Depfu).

Changes proposed in this pull request

  • Update Flipper to v1 branch
  • Add usage details to readme

Instructions for Reviewers

[All PRs] - Confirm PR template filled
[Feature Branches] - Review code
[Production Merges to main]
    - Check story numbers included
    - Check for debug code
    - Check version

@StephenHulme StephenHulme self-assigned this Nov 6, 2024
Gemfile Outdated
gem 'flipper-ui', '~> 0.25.0'
gem 'flipper'
gem 'flipper-active_record'
gem 'flipper-ui'
Copy link
Contributor

Choose a reason for hiding this comment

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

Would it be preferable to lock the versions again to the newly identified ones during dependency resolution? i.e. 1.3.1 for each of these.

I know this can cause dependency lockout in the future, but it stops these randomly upgrading in the future and causing issues because of a regression or because of breaking changes in a version update.

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 inclined to leave it unlocked, but can see the value of preventing breaking upgrades from happening automatically. I can lock it to the major version now that we are in 1.x land?

Copy link
Contributor

Choose a reason for hiding this comment

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

Locking to the major version would make me more comfortable than leaving it free to upgrade itself whenever it feels like it.

README.md Outdated Show resolved Hide resolved
class ChangeFlipperGatesValueToText < ActiveRecord::Migration[6.1]
def up
# Ensure this incremental update migration is idempotent
return unless connection.column_exists? :flipper_gates, :value, :string
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this really needed? What would happen if the column were not already containing a string value, other than spending a bit longer than strictly needed doing the migration? If you do think it's needed, should it also be used in the down method?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Both this and the comment in the down method are very good points.
In this case the migration was automatically created by running bundle exec rails g flipper:active_record --force as requested by the upgraded version of the package, so I cannot take credit for this code.
But since it is making changes to our codebase I think you're right that it should meet some quality standards - such as being truely reversable.
Since I haven't suceeded in getting the cucumber tests to pass due to the migration - I'll give it a good once over.

Copy link
Contributor

Choose a reason for hiding this comment

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

Another alternative is to mark it as non-reversible as we've done in some previous migrations (I think I've seen it here anyway)

end

def down
change_column :flipper_gates, :value, :string
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this also need to do the index modifications to be a true reversal of the above?

@StephenHulme
Copy link
Contributor Author

I can't get the cucumber tests to pass, putting on hold for now.
For more details about the migration see: flippercloud/flipper#789 and ualbertalib/jupiter#3348
For limited pool threads see: flippercloud/flipper#883
My current thinking is it is related to flipper-ui, routing, or the Rails app in some way as the problem doesn't occur in unit tests.

@StephenHulme StephenHulme added depfu Automatically created by Depfu Help wanted Help wanted for this issue dependencies Pull requests that update a dependency file Size: S Small - low effort & risk labels Nov 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file depfu Automatically created by Depfu Help wanted Help wanted for this issue Size: S Small - low effort & risk
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants