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: Add Bitbucket retriever #2611

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

CollinsC1O
Copy link

No description provided.

Copy link

netlify bot commented Nov 3, 2024

Deploy Preview for go-feature-flag-doc-preview canceled.

Name Link
🔨 Latest commit af2d590
🔍 Latest deploy log https://app.netlify.com/sites/go-feature-flag-doc-preview/deploys/672c89fd3de80a000829a292

Copy link
Owner

@thomaspoignant thomaspoignant left a comment

Choose a reason for hiding this comment

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

Hey @CollinsC1O thanks a lot for this pull request.
We are going to the right direction, I have made a few suggestion and pin point some issue.

I let you review them, and let me know if you need any help.

README.md Outdated
@@ -19,9 +19,9 @@
<a href="https://github.com/sponsors/thomaspoignant"><img src="https://img.shields.io/github/sponsors/thomaspoignant?logo=GitHub%20Sponsors" alt="Sponsords"></a>
</p>

> :pray: If you are using **GO Feature Flag** please consider to add yourself in the [adopters](./ADOPTERS.md) list.
Copy link
Owner

Choose a reason for hiding this comment

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

issue (markdown formatting): Removing the end of line whitespaces in the README.md file is causing a change on how the document will look like. Those are used to have a line break, and removing them is not ideal.

suggestion (markdown formatting): Restore those double whitespace in the end of the lines to avoid changing how the readme looks.

README.md Show resolved Hide resolved
RedisOptions *redis.Options `mapstructure:"redisOptions" koanf:"redisOptions"`
RedisPrefix string `mapstructure:"redisPrefix" koanf:"redisPrefix"`
Workspace string `mapstructure:"bitbucketWorkspace" koanf:"bitbucketWorkspace"`
BitbucketToken string `mapstructure:"bitbucketToken" koanf:"bitbucketToken"`
Copy link
Owner

Choose a reason for hiding this comment

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

suggestion: Instead of adding a new specific field for bitbucket, I suggest that we are using the already existing field AuthToken to set the configuration.

cmd/relayproxy/service/gofeatureflag.go Outdated Show resolved Hide resolved
retriever/bitbucketretriever/retriever.go Outdated Show resolved Hide resolved
retriever/bitbucketretriever/retriever.go Outdated Show resolved Hide resolved
retriever/bitbucketretriever/retriever.go Outdated Show resolved Hide resolved
retriever/bitbucketretriever/retriever.go Show resolved Hide resolved
Collection string `mapstructure:"collection" koanf:"collection"`
RedisOptions *redis.Options `mapstructure:"redisOptions" koanf:"redisOptions"`
RedisPrefix string `mapstructure:"redisPrefix" koanf:"redisPrefix"`
Workspace string `mapstructure:"bitbucketWorkspace" koanf:"bitbucketWorkspace"`
Copy link
Owner

Choose a reason for hiding this comment

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

suggestion: ✂️ After applying this suggestion, we can remove this configuration from the relay proxy.

Copy link

codecov bot commented Nov 5, 2024

Codecov Report

Attention: Patch coverage is 71.42857% with 24 lines in your changes missing coverage. Please review.

Please upload report for BASE (main@1a08593). Learn more about missing BASE report.

Files with missing lines Patch % Lines
retriever/bitbucketretriever/retriever.go 83.05% 7 Missing and 3 partials ⚠️
cmd/relayproxy/service/gofeatureflag.go 11.11% 8 Missing ⚠️
cmd/relayproxy/api/server.go 14.28% 5 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2611   +/-   ##
=======================================
  Coverage        ?   84.94%           
=======================================
  Files           ?      102           
  Lines           ?     4649           
  Branches        ?        0           
=======================================
  Hits            ?     3949           
  Misses          ?      559           
  Partials        ?      141           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@CollinsC1O
Copy link
Author

Hello @thomaspoignant so I just made some changes.

Copy link
Owner

@thomaspoignant thomaspoignant left a comment

Choose a reason for hiding this comment

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

Hey @CollinsC1O thanks for your update but it seems that your commit 92818f3 has removed all recent new features that we have introduce recently.

Can you try to check what happened?
My guess is that the resynchronisation of your repo did not work properly.

I also so that you did not addressed the comments about the README.md file #2611 (comment) and about the change in the relay proxy configuration #2611 (comment) and #2611 (comment).

Comment on lines 148 to 153
Branch: func() string {
if c.Branch == "" {
return config.DefaultRetriever.GitBranch
}
return c.Branch
}(),
Copy link
Owner

Choose a reason for hiding this comment

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

suggestion: we can simplify that part because the default value is already handled in the retriever here.

Suggested change
Branch: func() string {
if c.Branch == "" {
return config.DefaultRetriever.GitBranch
}
return c.Branch
}(),
Branch: c.Branch,

Copy link
Owner

@thomaspoignant thomaspoignant left a comment

Choose a reason for hiding this comment

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

There are still some issues, you have removed some existing feature in this PR.

cNotif.WebhookURL = cNotif.SlackWebhookURL // nolint
}
notifiers = append(notifiers, &slacknotifier.Notifier{SlackWebhookURL: cNotif.WebhookURL})
notifiers = append(notifiers, &slacknotifier.Notifier{SlackWebhookURL: cNotif.SlackWebhookURL})
Copy link
Owner

Choose a reason for hiding this comment

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

🔨 issue: ‏Why did you removed the change on the slack notifier here?

Copy link
Author

Choose a reason for hiding this comment

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

soo sorry that was a mistake

@@ -332,8 +336,7 @@ func initNotifier(c []config.NotifierConf) ([]notifier.Notifier, error) {
Headers: cNotif.Headers,
},
)
case config.DiscordNotifier:
notifiers = append(notifiers, &discordnotifier.Notifier{DiscordWebhookURL: cNotif.WebhookURL})

Copy link
Owner

Choose a reason for hiding this comment

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

🔨 issue: ‏Why did you removed the discord integration? Is this on purpose?

Copy link
Author

Choose a reason for hiding this comment

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

it wasn't on purpose. I must have made this mistakes in a bit of resolving conflict

Copy link

sonarcloud bot commented Nov 7, 2024

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.

2 participants