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: support classic ingest keys #238

Merged
merged 4 commits into from
Mar 7, 2024
Merged

Conversation

robbkidd
Copy link
Member

@robbkidd robbkidd commented Mar 6, 2024

Which problem is this PR solving?

  • Supporting ingest keys in classic environments

Short description of the changes

  • Consolidated the beeline's classic logic to the Configuration object.
  • Spec'd the classic logic directly for the configuration.classic? method and updated other specs to use a stub for classic/not-classic
  • Spec'd the new ingest key behavior (which fails)
  • Update minimum version of libhoney dependency to the release that contains the new public Libhoney.classic_api_key? method and use that method for key checking

@robbkidd robbkidd self-assigned this Mar 6, 2024
@robbkidd robbkidd added status: blocked version: bump minor A PR that adds behavior, but is backwards-compatible. labels Mar 6, 2024
@@ -128,9 +128,5 @@ def add_exception_data(span, exception)
span.add_field("error_backtrace_limit", error_backtrace_limit)
span.add_field("error_backtrace_total_length", exception.backtrace.length)
end

def classic_write_key?(write_key)
Copy link
Member Author

@robbkidd robbkidd Mar 6, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was a private method and its only use was to set the classic instance variable on @context.

@context.classic is set now by asking the configuration object directly about its classicness.

@@ -43,8 +43,41 @@
expect(configuration.write_key).to eq write_key
end

describe "#classic?" do
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spec the classicness of the various key formats once here.

@@ -61,10 +94,12 @@

context "with a classic write key" do
before do
configuration.write_key = "c1a551c000d68f9ed1e96432ac1a3380"
allow(configuration).to receive(:classic?).and_return(true)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stub the classic check within "classic" test scopes instead of repeating the matrix of key types all over again.

@robbkidd robbkidd added the type: enhancement New feature or request label Mar 6, 2024
@robbkidd robbkidd force-pushed the robb.support-classic-ingest-keys branch from 92fd533 to 0021bac Compare March 7, 2024 17:06
@robbkidd robbkidd marked this pull request as ready for review March 7, 2024 18:00
@robbkidd robbkidd requested a review from a team as a code owner March 7, 2024 18:00
@robbkidd robbkidd requested a review from a team March 7, 2024 18:00
Copy link
Contributor

@jharley jharley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💎

@robbkidd robbkidd merged commit 51cf905 into main Mar 7, 2024
4 checks passed
@robbkidd robbkidd deleted the robb.support-classic-ingest-keys branch March 7, 2024 18:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement New feature or request version: bump minor A PR that adds behavior, but is backwards-compatible.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants