Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Introduce Deprecation tracking #2056

Merged
merged 2 commits into from
May 23, 2024
Merged

feat: Introduce Deprecation tracking #2056

merged 2 commits into from
May 23, 2024

Conversation

julienbourdeau
Copy link
Contributor

Context

Some feature get deprecated or changed right after their released. For example, sending events without the external_subscription_id has been deprecated for a while and soon, we will stop accepting these events.

Description

In this PR, I'm adding a way to track the organization that still send events without external_subscription_id.

To get the report, we'd connect to the prod console, run the following snippet and paste it in a spreadsheet.

If necessary, we can improve this to upload CSV files regularly and such. I'd rather keep it simple for now.

Loading development environment (Rails 7.0.8.1)
irb(main):001:0> Deprecation.report(:dead_feature, "4761f46f-ab38-45bc-bae1-bcfdcbac5fbf")
=> 1
irb(main):002:0> Deprecation.report(:dead_feature, "4761f46f-ab38-45bc-bae1-bcfdcbac5fbf")
=> 2
irb(main):003:0> Deprecation.report(:dead_feature, "4761f46f-ab38-45bc-bae1-bcfdcbac5fbf")
=> 3
irb(main):005:0> puts Deprecation.get_all_as_csv(:dead_feature)
  Organization Pluck (0.3ms)  SELECT "organizations"."id" FROM "organizations"
organization_id,last_seen_at,count
4761f46f-ab38-45bc-bae1-bcfdcbac5fbf,2024-05-22 15:20:01 UTC,3
=> nil
irb(main):007:0> Deprecation.get_all(:dead_feature)
  Organization Pluck (3.1ms)  SELECT "organizations"."id" FROM "organizations"
=> [{:organization_id=>"4761f46f-ab38-45bc-bae1-bcfdcbac5fbf", :last_seen_at=>"2024-05-22T15:20:01.794Z", :count=>3}]

@julienbourdeau julienbourdeau self-assigned this May 22, 2024
app/models/deprecation.rb Outdated Show resolved Hide resolved
Base automatically changed from spec/cache-config to main May 23, 2024 08:15
@julienbourdeau julienbourdeau force-pushed the feat/deprecation branch 4 times, most recently from c9a83d8 to 690c466 Compare May 23, 2024 12:25
@julienbourdeau julienbourdeau merged commit 04082c0 into main May 23, 2024
6 checks passed
@julienbourdeau julienbourdeau deleted the feat/deprecation branch May 23, 2024 12:58
julienbourdeau added a commit that referenced this pull request Jul 10, 2024
…estimate_fees (#2271)

## Context

All events sent to Lago must include `external_subscription_id`.

## Description

Track event sent to `/api/v1/events/estimate_fees` without the
`external_subscription_id`

See #2056
abdussamadbello pushed a commit to abdussamadbello/lago-api that referenced this pull request Aug 8, 2024
…estimate_fees (getlago#2271)

## Context

All events sent to Lago must include `external_subscription_id`.

## Description

Track event sent to `/api/v1/events/estimate_fees` without the
`external_subscription_id`

See getlago#2056
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.

3 participants