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

Remove ProviderBuilder #3282

Merged
merged 2 commits into from
May 8, 2024
Merged

Remove ProviderBuilder #3282

merged 2 commits into from
May 8, 2024

Conversation

dmjb
Copy link
Contributor

@dmjb dmjb commented May 8, 2024

Fixes #2845

Remove final usages of provider builder in CLI and delete code.

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.

Fixes #2845

Remove final usages of provider builder in CLI and delete code.
@dmjb dmjb requested a review from a team as a code owner May 8, 2024 12:28
Copy link
Contributor

@stacklokbot stacklokbot left a comment

Choose a reason for hiding this comment

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

✅ No Invisible Unicode Characters Detected.

@coveralls
Copy link

Coverage Status

coverage: 50.089% (+0.4%) from 49.648%
when pulling b90f49f on delete-provider-builder
into ef6ad0d on main.

return manager.NewProviderManager(providerStore, githubProviderManager)
}

func wireUpDB(ctx context.Context, cfg *serverconfig.Config) (db.Store, error) {
Copy link
Contributor Author

@dmjb dmjb May 8, 2024

Choose a reason for hiding this comment

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

I refactored some of this code into separate functions out to reduce cyclomatic complexity of the runCmdWebhookUpdate (the new code I added exceeded the cyclomatic complexity limit)

continue
}

whSecret, err := cfg.WebhookConfig.GetWebhookSecret()
Copy link
Contributor Author

Choose a reason for hiding this comment

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

As far as I can tell, this is constant across all iterations of the loop, so I moved it outside of the loop

continue
}

if whSecret == "" {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

If this is empty, no webhooks are updated, so I converted to an error condition (see line 263)

Copy link
Contributor

@stacklokbot stacklokbot left a comment

Choose a reason for hiding this comment

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

✅ No Invisible Unicode Characters Detected.

Copy link
Contributor

@stacklokbot stacklokbot left a comment

Choose a reason for hiding this comment

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

✅ No Mixed Scripts Detected.

@dmjb dmjb merged commit e379a4a into main May 8, 2024
20 checks passed
@dmjb dmjb deleted the delete-provider-builder branch May 8, 2024 15:05
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.

Create interfaces for Provider instantiation
4 participants