WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Conversation

@devin-ai-integration
Copy link
Contributor

Add Flipper feature flag to TransferFromStripeToWiseJob

Summary

Added a Flipper feature flag (:transfer_from_stripe_to_wise) to gate the execution of TransferFromStripeToWiseJob. When the flag is disabled, the job returns early without processing any consolidated payments. Created comprehensive specs testing both enabled and disabled states.

Changes:

  • Added Flipper.enabled?(:transfer_from_stripe_to_wise) check at the start of the perform method
  • Created new spec file backend/spec/sidekiq/transfer_from_stripe_to_wise_job_spec.rb with 5 test cases covering:
    • Processing eligible payments when enabled
    • Skipping ineligible payments when enabled
    • Error handling when enabled
    • No processing when disabled
    • No database queries when disabled

Review & Testing Checklist for Human

  • Verify feature flag scope: Confirm that a global feature flag (not per-company) is the intended behavior. The current implementation affects all companies system-wide.
  • Check specs pass in CI: I was unable to run the specs locally due to Redis not being available. Please verify they pass in CI.
  • Test flag behavior in staging: Enable/disable the flag and verify that payments are processed/skipped as expected without breaking existing workflows.
  • Confirm job schedule interaction: The job is scheduled via sidekiq_schedule.yml. Verify that having it run but do nothing when disabled is acceptable vs. disabling the schedule itself.

Test Plan

  1. In staging/production console, check current flag state: Flipper.enabled?(:transfer_from_stripe_to_wise)
  2. Enable the flag: Flipper.enable(:transfer_from_stripe_to_wise)
  3. Verify that eligible consolidated payments are being processed
  4. Disable the flag: Flipper.disable(:transfer_from_stripe_to_wise)
  5. Verify that no payments are processed while disabled
  6. Re-enable when ready for production use

Notes

  • The feature flag is disabled by default (Flipper's default behavior)
  • This follows the existing Flipper pattern used elsewhere in the codebase (e.g., share_certificates flag in ShareHolding)
  • The job will continue to be scheduled but will exit early when the flag is disabled

Link to Devin run: https://app.devin.ai/sessions/23264d6928a44b78b3189a510f065c6f
Requested by: Ershad Kunnakkadan ([email protected])

- Add feature flag check at the beginning of perform method
- Create comprehensive spec file with tests for enabled/disabled states
- Tests verify job processes eligible payments when enabled
- Tests verify job skips processing when disabled

Co-Authored-By: Ershad Kunnakkadan <[email protected]>
@devin-ai-integration
Copy link
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

devin-ai-integration bot and others added 2 commits November 12, 2025 16:22
- Replace expect_any_instance_of with explicit instance doubles
- Use instance_double for CreatePayoutForConsolidatedPayment mocking
- Add after hook to disable feature flag after tests
- Update 'does not query for eligible records' test to check job instance

Co-Authored-By: Ershad Kunnakkadan <[email protected]>
@ershad ershad merged commit 48be97e into main Nov 12, 2025
3 of 4 checks passed
@ershad ershad deleted the devin/1762963582-add-flipper-flag-transfer-stripe-wise branch November 12, 2025 17:20
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.

2 participants