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

Force to use only one retriever at the time #49

Merged
merged 4 commits into from
Jan 13, 2021

Conversation

thomaspoignant
Copy link
Owner

@thomaspoignant thomaspoignant commented Jan 13, 2021

Description

⚠️ this PR include breaking changes.

In this PR I change the way to pass the Retriever in the config.
We don't have a property for each type of Retriever but only on Retriever which can manage all types of Retriever.

Why?

The main reason is to have the aws/aws-sdk-go as a dependency only if you are using the S3Retriever. With this new syntax, we don't force you to have the SDK if you are not using it.

How to migrate

If you were using HTTPRetriever, S3Retriever or GithubRetriever, the change consists only of changing the key in the config.

// Before v0.5.0
err := ffclient.Init(ffclient.Config{
    PollInterval: 3,
    HTTPRetriever: &ffClient.HTTPRetriever{
        URL:    "http://example.com/test.yaml",
    },
})

// Since v0.5.0
err := ffclient.Init(ffclient.Config{
    PollInterval: 3,
    Retriever: &ffclient.HTTPRetriever{
        URL:    "http://example.com/test.yaml",
    },
})

It is a bit different for the flag configuration, I have introduced a FileRetriever to keep the same format for all retrievers.

// Before v0.5.0
err := ffclient.Init(ffclient.Config{
    PollInterval: 3,
    LocalFile: "file-example.yaml",
})

// Since v0.5.0
err := ffclient.Init(ffclient.Config{
    PollInterval: 3,
    Retriever: &ffclient.FileRetriever{
        Path:    "file-example.yaml",
    },
})

Changes include

  • Bugfix (non-breaking change that solves an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking changes (change that is not backward-comptible and/or changes current functionality)

Closes issue(s)

Resolve #42

Checklist

  • I have tested this code
  • I have added unit test to cover this code
  • I have updated the Readme
  • I have followed the contributing guide

@thomaspoignant thomaspoignant added the enhancement New feature or request label Jan 13, 2021
@thomaspoignant thomaspoignant self-assigned this Jan 13, 2021
@thomaspoignant thomaspoignant changed the title Force to use only one retriever at the time Force to use only one retriever at the time Jan 13, 2021
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@thomaspoignant thomaspoignant marked this pull request as ready for review January 13, 2021 10:08
@thomaspoignant thomaspoignant merged commit 33e35be into main Jan 13, 2021
@thomaspoignant thomaspoignant deleted the change/change-config-retriever branch January 13, 2021 10:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

(change) not forcing all users to depend on aws/aws-sdk-go
1 participant