Skip to content

Commit ab5ebba

Browse files
committed
renamed provider to provider-url
Signed-off-by: Michael Beemer <[email protected]>
1 parent 69a32f2 commit ab5ebba

File tree

6 files changed

+34
-34
lines changed

6 files changed

+34
-34
lines changed

docs/commands/openfeature_push.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,13 @@ openfeature push [flags]
4040

4141
```
4242
# Push flags to a remote HTTPS endpoint (smart push: creates and updates as needed)
43-
openfeature push --provider https://api.example.com --auth-token secret-token
43+
openfeature push --provider-url https://api.example.com --auth-token secret-token
4444
4545
# Push flags to an HTTP endpoint (development)
46-
openfeature push --provider http://localhost:8080
46+
openfeature push --provider-url http://localhost:8080
4747
4848
# Dry run to preview what would be sent
49-
openfeature push --provider https://api.example.com --dry-run
49+
openfeature push --provider-url https://api.example.com --dry-run
5050
```
5151

5252
### Options

internal/cmd/pull.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ Why pull from a remote source:
4848
noPrompt := config.GetNoPrompt(cmd)
4949

5050
if providerUrl == "" {
51-
return fmt.Errorf("provider URL not set in config. Please provide --provider or set 'provider' in .openfeature.yaml")
51+
return fmt.Errorf("provider URL not set in config. Please provide --provider-url or set 'provider' in .openfeature.yaml")
5252
}
5353

5454
// fetch the flags from the remote source

internal/cmd/pull_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ func TestPull(t *testing.T) {
7474
// Prepare command arguments - use base URL only
7575
args := []string{
7676
"pull",
77-
"--provider", "https://example.com",
77+
"--provider-url", "https://example.com",
7878
"--manifest", "manifest/path.json",
7979
}
8080

@@ -124,7 +124,7 @@ func TestPull(t *testing.T) {
124124
// Prepare command arguments - use base URL only
125125
args := []string{
126126
"pull",
127-
"--provider", "https://example.com",
127+
"--provider-url", "https://example.com",
128128
"--manifest", "manifest/path.json",
129129
}
130130

@@ -165,7 +165,7 @@ func TestPull(t *testing.T) {
165165
// Prepare command arguments - URL with .json extension
166166
args := []string{
167167
"pull",
168-
"--provider", "https://example.com/flags.json",
168+
"--provider-url", "https://example.com/flags.json",
169169
"--manifest", "manifest/path.json",
170170
}
171171

@@ -218,7 +218,7 @@ func TestPull(t *testing.T) {
218218
// Prepare command arguments - URL with .yaml extension
219219
args := []string{
220220
"pull",
221-
"--provider", "https://example.com/flags.yaml",
221+
"--provider-url", "https://example.com/flags.yaml",
222222
"--manifest", "manifest/path.json",
223223
}
224224

@@ -271,7 +271,7 @@ func TestPull(t *testing.T) {
271271
// Prepare command arguments - URL with .yml extension
272272
args := []string{
273273
"pull",
274-
"--provider", "https://example.com/config.yml",
274+
"--provider-url", "https://example.com/config.yml",
275275
"--manifest", "manifest/path.json",
276276
}
277277

@@ -325,7 +325,7 @@ func TestPull(t *testing.T) {
325325
// Prepare command arguments - base URL without file extension
326326
args := []string{
327327
"pull",
328-
"--provider", "https://api.example.com",
328+
"--provider-url", "https://api.example.com",
329329
"--manifest", "manifest/path.json",
330330
}
331331

internal/cmd/push.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,13 @@ specified by the OpenFeature flag manifest schema.
4343
Note: The file:// scheme is not supported for push operations.
4444
For local file operations, use standard shell commands like cp or mv.`,
4545
Example: ` # Push flags to a remote HTTPS endpoint (smart push: creates and updates as needed)
46-
openfeature push --provider https://api.example.com --auth-token secret-token
46+
openfeature push --provider-url https://api.example.com --auth-token secret-token
4747
4848
# Push flags to an HTTP endpoint (development)
49-
openfeature push --provider http://localhost:8080
49+
openfeature push --provider-url http://localhost:8080
5050
5151
# Dry run to preview what would be sent
52-
openfeature push --provider https://api.example.com --dry-run`,
52+
openfeature push --provider-url https://api.example.com --dry-run`,
5353
PreRunE: func(cmd *cobra.Command, args []string) error {
5454
return initializeConfig(cmd, "push")
5555
},
@@ -62,7 +62,7 @@ For local file operations, use standard shell commands like cp or mv.`,
6262

6363
// Validate destination URL is provided
6464
if providerUrl == "" {
65-
return fmt.Errorf("provider URL is required. Please provide --provider")
65+
return fmt.Errorf("provider URL is required. Please provide --provider-url")
6666
}
6767

6868
// Parse and validate URL

internal/cmd/push_test.go

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ func TestPush(t *testing.T) {
7070
cmd := GetPushCmd()
7171

7272
args := []string{
73-
"--provider", "http://localhost:8080/openfeature/v0/manifest",
73+
"--provider-url", "http://localhost:8080/openfeature/v0/manifest",
7474
"--manifest", "flags.json",
7575
}
7676
cmd.SetArgs(args)
@@ -121,7 +121,7 @@ func TestPush(t *testing.T) {
121121
cmd := GetPushCmd()
122122

123123
args := []string{
124-
"--provider", "https://api.example.com/openfeature/v0/manifest",
124+
"--provider-url", "https://api.example.com/openfeature/v0/manifest",
125125
"--manifest", "flags.json",
126126
}
127127
cmd.SetArgs(args)
@@ -188,7 +188,7 @@ func TestPush(t *testing.T) {
188188
cmd := GetPushCmd()
189189

190190
args := []string{
191-
"--provider", "https://api.example.com/openfeature/v0/manifest",
191+
"--provider-url", "https://api.example.com/openfeature/v0/manifest",
192192
"--manifest", "flags.json",
193193
}
194194
cmd.SetArgs(args)
@@ -232,7 +232,7 @@ func TestPush(t *testing.T) {
232232
cmd := GetPushCmd()
233233

234234
args := []string{
235-
"--provider", "https://api.example.com/openfeature/v0/manifest",
235+
"--provider-url", "https://api.example.com/openfeature/v0/manifest",
236236
"--auth-token", "secret-token",
237237
"--manifest", "flags.json",
238238
}
@@ -275,7 +275,7 @@ func TestPush(t *testing.T) {
275275
cmd := GetPushCmd()
276276

277277
args := []string{
278-
"--provider", "https://api.example.com",
278+
"--provider-url", "https://api.example.com",
279279
"--dry-run",
280280
"--manifest", "flags.json",
281281
}
@@ -295,7 +295,7 @@ func TestPush(t *testing.T) {
295295
cmd := GetPushCmd()
296296

297297
args := []string{
298-
"--provider", "file:///local/path/flags.json",
298+
"--provider-url", "file:///local/path/flags.json",
299299
"--manifest", "flags.json",
300300
}
301301
cmd.SetArgs(args)
@@ -312,7 +312,7 @@ func TestPush(t *testing.T) {
312312
cmd := GetPushCmd()
313313

314314
args := []string{
315-
"--provider", "ftp://example.com/flags",
315+
"--provider-url", "ftp://example.com/flags",
316316
"--manifest", "flags.json",
317317
}
318318
cmd.SetArgs(args)
@@ -341,7 +341,7 @@ func TestPush(t *testing.T) {
341341
cmd := GetPushCmd()
342342

343343
args := []string{
344-
"--provider", "https://api.example.com/openfeature/v0/manifest",
344+
"--provider-url", "https://api.example.com/openfeature/v0/manifest",
345345
"--manifest", "flags.json",
346346
}
347347
cmd.SetArgs(args)
@@ -379,7 +379,7 @@ func TestPush(t *testing.T) {
379379
cmd := GetPushCmd()
380380

381381
args := []string{
382-
"--provider", "https://api.example.com/openfeature/v0/manifest",
382+
"--provider-url", "https://api.example.com/openfeature/v0/manifest",
383383
"--manifest", "flags.json",
384384
}
385385
cmd.SetArgs(args)
@@ -418,7 +418,7 @@ func TestPush(t *testing.T) {
418418
cmd := GetPushCmd()
419419

420420
args := []string{
421-
"--provider", "https://api.example.com/openfeature/v0/manifest",
421+
"--provider-url", "https://api.example.com/openfeature/v0/manifest",
422422
"--manifest", "flags.json",
423423
}
424424
cmd.SetArgs(args)
@@ -481,7 +481,7 @@ func TestPush(t *testing.T) {
481481
cmd := GetPushCmd()
482482

483483
args := []string{
484-
"--provider", "https://api.example.com/openfeature/v0/manifest",
484+
"--provider-url", "https://api.example.com/openfeature/v0/manifest",
485485
"--manifest", "flags.json",
486486
}
487487
cmd.SetArgs(args)
@@ -497,7 +497,7 @@ func TestPush(t *testing.T) {
497497
cmd := GetPushCmd()
498498

499499
args := []string{
500-
"--provider", "https://api.example.com/flags",
500+
"--provider-url", "https://api.example.com/flags",
501501
"--manifest", "nonexistent.json",
502502
}
503503
cmd.SetArgs(args)
@@ -526,7 +526,7 @@ func TestPush(t *testing.T) {
526526
cmd := GetPushCmd()
527527

528528
args := []string{
529-
"--provider", "https://api.example.com/flags",
529+
"--provider-url", "https://api.example.com/flags",
530530
"--manifest", "invalid.json",
531531
}
532532
cmd.SetArgs(args)

internal/config/flags.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -68,24 +68,24 @@ func AddJavaGenerateFlags(cmd *cobra.Command) {
6868
func AddInitFlags(cmd *cobra.Command) {
6969
cmd.Flags().Bool(OverrideFlagName, false, "Override an existing configuration")
7070
cmd.Flags().String(ProviderFlagName, "", "The URL of the flag provider")
71-
cmd.Flags().String(FlagSourceUrlFlagName, "", "The URL of the flag source (deprecated: use --provider instead)")
72-
_ = cmd.Flags().MarkDeprecated(FlagSourceUrlFlagName, "use --provider instead")
71+
cmd.Flags().String(FlagSourceUrlFlagName, "", "The URL of the flag source (deprecated: use --provider-url instead)")
72+
_ = cmd.Flags().MarkDeprecated(FlagSourceUrlFlagName, "use --provider-url instead")
7373
}
7474

7575
// AddPullFlags adds the pull command specific flags
7676
func AddPullFlags(cmd *cobra.Command) {
7777
cmd.Flags().String(ProviderFlagName, "", "The URL of the flag provider")
78-
cmd.Flags().String(FlagSourceUrlFlagName, "", "The URL of the flag source (deprecated: use --provider instead)")
79-
_ = cmd.Flags().MarkDeprecated(FlagSourceUrlFlagName, "use --provider instead")
78+
cmd.Flags().String(FlagSourceUrlFlagName, "", "The URL of the flag source (deprecated: use --provider-url instead)")
79+
_ = cmd.Flags().MarkDeprecated(FlagSourceUrlFlagName, "use --provider-url instead")
8080
cmd.Flags().String(AuthTokenFlagName, "", "The auth token for the flag provider")
8181
cmd.Flags().Bool(NoPromptFlagName, false, "Disable interactive prompts for missing default values")
8282
}
8383

8484
// AddPushFlags adds the push command specific flags
8585
func AddPushFlags(cmd *cobra.Command) {
8686
cmd.Flags().String(ProviderFlagName, "", "The URL of the flag provider")
87-
cmd.Flags().String(FlagSourceUrlFlagName, "", "The URL of the flag destination (deprecated: use --provider instead)")
88-
_ = cmd.Flags().MarkDeprecated(FlagSourceUrlFlagName, "use --provider instead")
87+
cmd.Flags().String(FlagSourceUrlFlagName, "", "The URL of the flag destination (deprecated: use --provider-url instead)")
88+
_ = cmd.Flags().MarkDeprecated(FlagSourceUrlFlagName, "use --provider-url instead")
8989
cmd.Flags().String(AuthTokenFlagName, "", "The auth token for the flag provider")
9090
cmd.Flags().Bool(DryRunFlagName, false, "Preview changes without pushing")
9191
}
@@ -148,7 +148,7 @@ func getConfigValueWithFallback(value string, newConfigKey string, legacyConfigK
148148
}
149149

150150
// GetFlagSourceUrl gets the flag source URL from the given command
151-
// It checks the new --provider flag first, then falls back to the deprecated --flag-source-url flag
151+
// It checks the new --provider-url flag first, then falls back to the deprecated --flag-source-url flag
152152
// for backward compatibility. Finally, it checks the config file for both keys.
153153
func GetFlagSourceUrl(cmd *cobra.Command) string {
154154
// Check new flag first

0 commit comments

Comments
 (0)