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

Use provider ID instead of name when sending events #3093

Merged
merged 6 commits into from
Apr 19, 2024
Merged

Conversation

dmjb
Copy link
Contributor

@dmjb dmjb commented Apr 15, 2024

Relates to #3071

This PR changes any code which creates an EntityInfoWrapper to use Provider ID instead of name. The name is still left as a field in the event for backwards compatibility purposes, and the consumer can still use the name to create the provider instance. However, the name is no longer populated.

Some other refactoring was carried out, specifically moving code from the helper package to more appropriate packages.

Summary

Provide a brief overview of the changes and the issue being addressed.
Explain the rationale and any background necessary for understanding the changes.
List dependencies required by this change, if any.

Fixes #(related issue)

Change Type

Mark the type of change your PR introduces:

  • Bug fix (resolves an issue without affecting existing features)
  • Feature (adds new functionality without breaking changes)
  • Breaking change (may impact existing functionalities or require documentation updates)
  • Documentation (updates or additions to documentation)
  • Refactoring or test improvements (no bug fixes or new functionality)

Testing

Outline how the changes were tested, including steps to reproduce and any relevant configurations.
Attach screenshots if helpful.

Review Checklist:

  • Reviewed my own code for quality and clarity.
  • Added comments to complex or tricky code sections.
  • Updated any affected documentation.
  • Included tests that validate the fix or feature.
  • Checked that related changes are merged.

@dmjb dmjb requested a review from a team as a code owner April 15, 2024 14:23
if inf.ProviderID == uuid.Nil {
provider, err = e.providerStore.GetByName(ctx, inf.ProjectID, inf.Provider)
} else {
if inf.ProviderID != uuid.Nil {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Swapped this condition because it is now expected that the Provider ID path will the more commonly used one

@@ -0,0 +1,81 @@
// Copyright 2024 Stacklok, Inc
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Previously part of the helpers package

@@ -0,0 +1,47 @@
// Copyright 2024 Stacklok, Inc
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Previously part of the helpers package

@@ -0,0 +1,91 @@
// Copyright 2024 Stacklok, Inc
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Previously part of the helpers package. Moved under eea, because only the eea code uses these functions.

@coveralls
Copy link

coveralls commented Apr 15, 2024

Coverage Status

coverage: 48.133% (-0.01%) from 48.143%
when pulling 07078c5 on eiw-provider-id
into 0796ff8 on main.

Copy link
Member

@evankanderson evankanderson left a comment

Choose a reason for hiding this comment

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

What's the sequencing on this with the previous PR? Do we need one pushed in production and clearing all the previous messages which only had name before we start this one?

@dmjb
Copy link
Contributor Author

dmjb commented Apr 16, 2024

What's the sequencing on this with the previous PR? Do we need one pushed in production and clearing all the previous messages which only had name before we start this one?

My previous PR was part of yesterday evening's deploy to prod, so this PR is safe to merge.

@dmjb dmjb force-pushed the eiw-provider-id branch 2 times, most recently from e75757b to bf92ab0 Compare April 17, 2024 14:15
Relates to #3071

This PR changes any code which creates an EntityInfoWrapper to use
Provider ID instead of name. The name is still left as a field in the
event for backwards compatibility purposes, and the consumer can still
use the name to create the provider instance. However, the name is no
longer populated.

Some other refactoring was carried out, specifically moving code from
the helper package to more appropriate packages.
@dmjb
Copy link
Contributor Author

dmjb commented Apr 19, 2024

Did some local verification

@dmjb dmjb merged commit 5ed6788 into main Apr 19, 2024
19 checks passed
@dmjb dmjb deleted the eiw-provider-id branch April 19, 2024 15:02
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.

5 participants