nhumrich / toggle-meister

Apache License 2.0
3 stars 1 forks source link

[feature request] get all toggles endpoint #82

Closed frehner closed 5 years ago

frehner commented 5 years ago

Let's say

  1. I don't really care about tracking which toggles are used (I can just do a code search for them), and
  2. I don't want to have to create a toggle in both TM and ALSO my codebase, and
  3. I want toggles to be resolved upfront and before any application code runs, so I want it to be a single request / response for speed's sake

Those three issues could be resolved for me if there was a single endpoint that I could hit to get all toggles for an environment. As it stands, there are various workarounds but they all appear to have one or multiple of the above drawbacks.

Would there be any interest in allowing this API to exist?

joeldenning commented 5 years ago

From docs: https://github.com/CanopyTax/toggle-meister#list-of-all-current-endpoints

http :8445/api/envs/production/toggles

I think this will give you all of them? I know that canopy uses this API to populate the canopy-inspector's list of features.

frehner commented 5 years ago

I may be reading this wrong, but I believe that that endpoint falls under issue 2 in my list. It appears that I have to send the list of toggles I think? See line 23:

https://github.com/CanopyTax/toggle-meister/blob/master/tmeister/toggles.py

joeldenning commented 5 years ago

Ah you're right. I just checked in Canopy's app and they make two requests to populate the devtools:

GET /api/features

GET /api/toggles?feature=test_transcripts_extension&feature=tp_client_return_refactor&feature=tp_licenses&feature=irs_eservices_enabled&feature=sme_branching&feature=pastepocalypse&feature=new_transcripts&feature=canopy_letter_templates&feature=global_letter_generator&feature=lmgtfy&feature=client_transcripts&feature=zapier_integration&feature=task_on_time_entry&feature=self_serve_licenses&feature=access_levels_pm&feature=conversions&feature=efin&feature=notes_ui&feature=first_time_login&feature=source_form_search&feature=esign_pdf&feature=share_reminder&feature=mobile_upload_file&feature=custom_fields_multi_select_dropdown&feature=import_contacts_milestone_2&feature=import_contacts_milestone_3&feature=workspace_notes&feature=import_contacts_parcel&feature=credits_dashboard&feature=tasks_draggable&feature=redesign_efin_settings&feature=save_to_canopy_files&feature=php_to_python_endpoints&feature=payment_deposits&feature=amex_id&feature=tp_block_display&enrollment_id=584830&metrics=false

So yeah there is no API that does what you're asking for and the original issue stands.