department-of-veterans-affairs / va.gov-team

Public resources for building on and in support of VA.gov. Visit complete Knowledge Hub:
https://depo-platform-documentation.scrollhelp.site/index.html
283 stars 204 forks source link

Add information on feature toggles audit log #88094

Open acrollet opened 3 months ago

acrollet commented 3 months ago

Description

Could we add the following information to the Feature Toggles Guide? I'd suggest that it go between the "Enabling and disabling features using the Flipper UI" and "Removing old/unused feature toggles" sections.


Feature Toggle Activity Logs

Feature Toggle activity/audit logs are stored in the feature_toggle_events database table in each environment. They may be searched with ActiveRecord expressions in the Rails Console. For example, to search for enable/disable history for the profile_show_privacy_policy feature toggle, run the following expression:

FeatureToggleEvent.where(feature_name: "profile_show_privacy_policy")

A list of events similar to the following will be returned:

<FeatureToggleEvent:0x00007f8dbf8912d8
  id: 65550,
  feature_name: "profile_show_privacy_policy",
  operation: "enable",
  gate_name: "actor",
  value: "vets.gov.user+226@gmail.com",
  user: "some.person@va.gov",
  created_at: Tue, 18 Jun 2024 17:32:27.776528000 UTC +00:00,
  updated_at: Tue, 18 Jun 2024 17:32:27.776528000 UTC +00:00>

Note that the user who changed the toggle value will only be available if they used the Flipper UI. If it was changed in the Rails Console or via an initializer, nil will be shown.


Relevant URLs

Which type of team are you on? (Platform team, VFS team, or Leadership)

OCTO

jknipes commented 3 months ago

Hi @acrollet, thanks for your content suggestions. The Platform Content team will review your request and put it in our backlog to refine for next steps.