Skip to content

Onebase to rule them all!

Compare
Choose a tag to compare
@edwinthinks edwinthinks released this 21 Feb 15:41
· 3176 commits to main since this release

https://media.giphy.com/media/TbYgHMnICI1A4/source.gif

✍️ Description

Alright friends... this is a very exciting release! This release includes the foundations necessary to merge the two applications Diaperbase & Partnerbase together. We've wanted this for some time to simplify development greatly.

Note - this is only adds the foundations and isn't fully released to production yet (using a feature flag). Work still needs to be done to transition partners to using this.

Here are some reasons why we are merging the two applications together:

  • Managing an API between partner & diaper has been difficult. As a result, features that have been in demand but require changes in both applications do not get completed.
  • New volunteers often encounter issues trying to get their development setup which requires two applications to run.
  • The overhead of running two separate applications is too high and makes using hosting services like Heroku too costly.
  • It is too difficult to manage two separate repositories. We've found that Diaperbase gets prioritized over partnerbase.

How does this work?

The Partnerbase application is being transplanted into the Diaperbase application. This transplanted version uses Rails 6's multiple DB feature to connect with the existing partnerbase database.

What is next?

  • We'll need to move over more functionality from partnerbase into diaperbase whilst replacing API calls into service objects that communicate between databases. Issues will be created!
  • Migrate the files/documents stored in the partnerbase's VM into a storage service like Azure Blob.
  • Recruit partner testers to utilize the new partnerbase application hosted hosted within diaperbase.
  • Once it is all done, redirect all old partnerbase traffic to the new application.

✨ What's New?

  • You can now access partner data directly via active records in diaperbase. For example, the code below access the partner table in the Partnerbase database. We can likely use to avoid having to make a GET request.
2.7.2 :006 > Partners::Partner.last
  Partners::Partner Load (1.3ms)  SELECT "partners".* FROM "partners" ORDER BY "partners"."id" DESC LIMIT $1  [["LIMIT", 1]]
 => #<Partners::Partner id: 6, diaper_bank_id: 1, executive_director_name: nil, program_contact_name: nil, pick_up_name: nil, application_data: nil, diaper_partner_id: 5, partner_status: "pending", name: nil, distributor_type: nil, agency_type: nil, agency_mission: nil, address1: nil, address2: nil, city: nil, state: nil, zip_code: nil, website: nil, facebook: nil, twitter: nil, founded: nil, form_990: nil, program_name: nil, program_description: nil, program_age: nil, case_management: nil, evidence_based: nil, evidence_based_description: nil, program_client_improvement: nil, diaper_use: nil, other_diaper_use: nil, currently_provide_diapers: nil, turn_away_child_care: nil, program_address1: nil, program_address2: nil, program_city: nil, program_state: nil, program_zip_code: nil, max_serve: nil, incorporate_plan: nil, responsible_staff_position: nil, storage_space: nil, describe_storage_space: nil, trusted_pickup: nil, income_requirement_desc: nil, serve_income_circumstances: nil, income_verification: nil, internal_db: nil, maac: nil, population_black: nil, population_white: nil, population_hispanic: nil, population_asian: nil, population_american_indian: nil, population_island: nil, population_multi_racial: nil, population_other: nil, zips_served: nil, at_fpl_or_below: nil, above_1_2_times_fpl: nil, greater_2_times_fpl: nil, poverty_unknown: nil, ages_served: nil, executive_director_phone: nil, executive_director_email: nil, program_contact_phone: nil, program_contact_mobile: nil, program_contact_email: nil, pick_up_method: nil, pick_up_phone: nil, pick_up_email: nil, distribution_times: nil, new_client_times: nil, more_docs_required: nil, sources_of_funding: nil, sources_of_diapers: nil, diaper_budget: nil, diaper_funding_source: nil, created_at: "2020-03-15 18:46:26", updated_at: "2020-03-15 18:46:26", other_agency_type: nil, status_in_diaper_base: nil>
  • You can login as a partnerbase user (see README for login credentials) and make a request. Only available when Flipper.enabled?(:onebase) == true

Screen Shot 2021-02-21 at 10 33 28 AM

Screen Shot 2021-02-21 at 10 33 35 AM

Screen Shot 2021-02-21 at 10 34 03 AM

🐞 Bug Fixes

N/A

💖 Other Changes

  • I've updated Partnerbase to utilize a Azure Postgres instance instead of relying on the VM's postgres