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(flags): expose subscriptions api behind feature flag for test harness #110

Closed
wants to merge 2 commits into from
Closed

feat(flags): expose subscriptions api behind feature flag for test harness #110

wants to merge 2 commits into from

Conversation

guergabo
Copy link
Contributor

@guergabo guergabo commented Nov 13, 2023

Fixes #109

@guergabo guergabo self-assigned this Nov 13, 2023
@guergabo guergabo requested a review from dfarr November 13, 2023 13:24
Copy link

codecov bot commented Nov 13, 2023

Codecov Report

Attention: 141 lines in your changes are missing coverage. Please review.

Comparison is base (2c924b7) 67.16% compared to head (0c39669) 65.60%.

Files Patch % Lines
...nternal/app/subsystems/api/service/subscription.go 0.00% 74 Missing ⚠️
internal/app/subsystems/api/http/subscription.go 0.00% 62 Missing ⚠️
internal/app/subsystems/api/http/http.go 16.66% 4 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #110      +/-   ##
==========================================
- Coverage   67.16%   65.60%   -1.56%     
==========================================
  Files          57       59       +2     
  Lines        5944     6086     +142     
==========================================
+ Hits         3992     3993       +1     
- Misses       1667     1807     +140     
- Partials      285      286       +1     

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

@guergabo guergabo marked this pull request as draft November 13, 2023 13:28
@guergabo guergabo added the enhancement New feature or request label Nov 13, 2023
@guergabo
Copy link
Contributor Author

remove api

@@ -162,6 +163,7 @@ var serveCmd = &cobra.Command{

func init() {
// api
serveCmd.Flags().Var(&ExperimentalFeatures{}, "enable-feature", "enable features that are disabled by default since they are considered experimental")
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
serveCmd.Flags().Var(&ExperimentalFeatures{}, "enable-feature", "enable features that are disabled by default since they are considered experimental")
serveCmd.Flags().Var(&ExperimentalFeatures{}, "enable-feature", "enable experimental features that are disabled by default")

@@ -226,3 +229,28 @@ func init() {
serveCmd.Flags().SortFlags = false
rootCmd.AddCommand(serveCmd)
}

type ExperimentalFeatures []string
Copy link
Member

Choose a reason for hiding this comment

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

could this move to the flags.go file?

@@ -39,6 +42,13 @@ func New(api api.API, config *Config) api.Subsystem {
r.POST("/promises/:id/resolve", s.resolvePromise)
r.POST("/promises/:id/reject", s.rejectPromise)

// Subscription API (experimental)
if slices.Contains(config.Enable, "subscription") {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
if slices.Contains(config.Enable, "subscription") {
if slices.Contains(config.Enable, "subscriptions") {


// Subscription

type SearchSubscriptionsParams struct {
Copy link
Member

Choose a reason for hiding this comment

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

We probably won't have a search subscriptions API, just a list all subscriptions on a promise (which is also paginated),

}

type CreateSubscriptionHeader struct {
RequestId string `header:"request-id"` // qq: just for grpc?
Copy link
Member

Choose a reason for hiding this comment

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

This is an optional parameter for tracking requests cross-systems. If provided this field is used in corresponding logs, if not provided I believe we generate a uuid for each request.

Copy link
Member

Choose a reason for hiding this comment

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

you can set in both http/grpc

@guergabo guergabo closed this Dec 28, 2023
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.

add feature flagging
2 participants