Skip to content

Conversation

yahyaelganyni1
Copy link
Contributor

Resolves #5251

Description

This change removes the Flipper feature flag for "enable packs" since the feature is now permanently enabled in production. The work involves:

  • Removing all Flipper checks for "enable_packs" throughout the codebase
  • Cleaning up related conditional code paths
  • Updating tests to remove mock Flipper enable_packs configurations
  • Ensuring the code works correctly without the feature flag
  • Removing any now-defunct code related to the packs feature flag

Type of change

  • Technical debt cleanup (removing feature flag for permanently enabled feature)

How Has This Been Tested?

  • All existing unit tests have been updated to remove Flipper enable_packs mocks
  • Manual testing of pack-related functionality:
    • Creating requests with packs
    • Managing distributions with packs
    • Organization pack management
    • Item pack configuration
  • Verified behavior works consistently without feature flag checks

Screenshots

N/A (backend changes only)

@yahyaelganyni1 yahyaelganyni1 marked this pull request as ready for review July 31, 2025 10:07
@cielf
Copy link
Collaborator

cielf commented Jul 31, 2025

This is going to take a couple of sessions to do the functional check -- we basically have to check every packs-related thing (and there are a lot of them)

@yahyaelganyni1
Copy link
Contributor Author

I understand, please let me know if I need to change anything.

@cielf
Copy link
Collaborator

cielf commented Aug 2, 2025

Looks good to me -- over to @dorner for technical insight.

else
item&.name || name
end
unit_text = request_unit.present? ? request_unit.pluralize(quantity_override || quantity.to_i) : "items"
Copy link
Collaborator

Choose a reason for hiding this comment

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

This changes the behavior in that it adds " - items" where it didn't do that before.

@cielf thoughts?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think you're right -- the "items" is unneeded.

row += Array.new(item_headers.size, 0)

request.item_requests.each do |item_request|
item_name = item_request.item.present? ? item_request.name_with_unit(0) : DELETED_ITEMS_COLUMN_HEADER
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why did this have to change?

["Item 2", 30, 100],
["Item 3", 50, ""],
["Item 4", 120, ""],
["Item 4", "120 packs", ""],
Copy link
Collaborator

Choose a reason for hiding this comment

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

What caused this change?

end

after do
Flipper.disable(:enable_packs)
Copy link
Collaborator

Choose a reason for hiding this comment

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

This block can be removed entirely now.

"2T Diapers -- UPDATED",
"3T Diapers",
"4T Diapers",
"4T Diapers - packs",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why did we have to add this?

let(:organization) { create(:organization) }
let(:fake_organization_items) { instance_double('organization.items') }
let(:fake_organization_item) { instance_double(Item, id: 99_999, save!: -> {}) }
let(:fake_organization_item) { instance_double(Item, id: 99_999, save!: -> {}, sync_request_units!: true) }
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same question - if all we're doing is removing the feature flag, then tests should be identical with the exception of any tests that had the flag off.

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.

We no longer need enable packs to be Flippered.
3 participants