Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

### Breaking:

- breaking(ngwaf/workspace): change flag name to match API spec ((#1768)[https://github.com/fastly/cli/pull/1768])

### Bug Fixes:

- fix(compute/deploy): remove compute trial activation code because trials no longer exist ([#1730](https://github.com/fastly/cli/pull/1730))
Expand Down Expand Up @@ -208,13 +210,13 @@ both the old and new forms are:
- feat(compute/hashfiles): remove hashsum subcommand ([#1608](https://github.com/fastly/cli/pull/1608))
- feat(ngwaf/rules): add support for CRUD operations for NGWAF rules ([#1605](https://github.com/fastly/cli/pull/1605))
- feat(compute/deploy): added the `--no-default-domain` flag to allow for the skipping of automatic domain creation when deploying a Compute service([#1610](https://github.com/fastly/cli/pull/1610))
- refactor(argparser/flags.go): add flag conversion utilities for converting string flags to bools and checking ascending and desecnding flags ([#1611](https://github.com/fastly/cli/pull/1611))
- refactor(argparser/flags.go): add flag conversion utilities for converting string flags to bools and checking ascending and descending flags ([#1611](https://github.com/fastly/cli/pull/1611))
- feat(service/purge): Add 'service purge' command as replacement for 'purge', with an unlisted and deprecated alias of 'purge'. ([#1612](https://github.com/fastly/cli/pull/1612))
- feat(service/version): Add 'service version ...' commands as replacements for 'service-version ...', with unlisted and deprecated aliases of 'service-version ...'. ([#1614](https://github.com/fastly/cli/pull/1614))
- feat(service/vcl): moved the `vcl` command under the `service` command, with an unlisted and deprecated alias of `vcl` ([#1616](https://github.com/fastly/cli/pull/1616))
- feat(service/healthcheck): moved the `healthcheck` command under the `service` command, with an unlisted and deprecated alias of `healthcheck` ([#1619](https://github.com/fastly/cli/pull/1619))
- feat(service/backend): moved the `backend` command under the `service` command, with an unlisted and deprecated alias of `backend` ([#1621](https://github.com/fastly/cli/pull/1621))
- feat(service/acl): moved the `acl` and `aclentry` commands under the `service` command, with a unlisted and deprecated aliases of `acl` and `aclentry` ([#1621](https://github.com/fastly/cli/pull/1624))
- feat(service/acl): moved the `acl` and `aclentry` commands under the `service` command, with unlisted and deprecated aliases of `acl` and `aclentry` ([#1621](https://github.com/fastly/cli/pull/1624))
- feat(version): If the latest version is at least one major version higher than the current version, provide links to the release notes for the major version(s) so the user can review them before upgrading. ([#1623](https://github.com/fastly/cli/pull/1623))
- feat(service/imageoptimizerdefaults): moved the `imageoptimizerdefaults` commands under the `service` command, with an unlisted and deprecated alias of `imageoptimizerdefaults` ([#1627](https://github.com/fastly/cli/pull/1627))
- feat(service/alert): moved the `alerts` command to the `service alert` command, with an unlisted and deprecated alias of `alerts` ([#1616](https://github.com/fastly/cli/pull/1626))
Expand Down
2 changes: 1 addition & 1 deletion DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ The resulting configuration is then saved to disk at `./pkg/config/config.toml`

When a user installs the CLI for the first time, they'll have no existing config and so the embedded config will be used. In the future, when the user updates their CLI, the existing config they have will be used.

If the config has changed in any way, then you (the CLI developer) should ensure the `config_version` number is bumped before publishing a new CLI release. This is because when the user updates to that new CLI version and the invoke the CLI, the CLI will identify a mismatch between the user's local config version and the embedded config version. This will cause the embedded config to be merged with the local config and consequently the user's config will be updated to include the new fields.
If the config has changed in any way, then you (the CLI developer) should ensure the `config_version` number is bumped before publishing a new CLI release. This is because when the user updates to that new CLI version and they invoke the CLI, the CLI will identify a mismatch between the user's local config version and the embedded config version. This will cause the embedded config to be merged with the local config and consequently the user's config will be updated to include the new fields.

> **NOTE:** The CLI does provide a `fastly config --reset` option that resets the config to a version compatible with the user's current CLI version. This is fallback for users who run into issues for whatever reason.

Expand Down
2 changes: 1 addition & 1 deletion TESTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ When running the tests locally, if you don't have the relevant language ecosyste

> **NOTE**: you might notice a discrepancy between CI and your local environment which is caused by the difference in Rust toolchain versions as defined in .github/workflows/pr_test.yml which specifies the version required to be tested for in CI. Running `rustup toolchain install <version>` and `rustup target add wasm32-wasip1 --toolchain <version>` will resolve any failing integration tests you may be running locally.

To the run the full test suite:
To run the full test suite:

```sh
TEST_COMPUTE_INIT=1 TEST_COMPUTE_BUILD=1 TEST_COMPUTE_DEPLOY=1 TEST_COMMAND=gotest make all
Expand Down
2 changes: 1 addition & 1 deletion pkg/app/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ func Exec(data *global.Data) error {
}

// User can set env.DebugMode env var or the --debug-mode boolean flag.
// This will prioritise the flag over the env var.
// This will prioritize the flag over the env var.
if data.Flags.Debug {
data.Env.DebugMode = "true"
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/commands/compute/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -672,7 +672,7 @@ func updateWasmtools(

// identifyToolchain determines the programming language.
//
// It prioritises the --language flag over the manifest field.
// It prioritizes the --language flag over the manifest field.
// Will error if neither are provided.
// Lastly, it will normalise with a trim and lowercase.
func identifyToolchain(c *BuildCommand) (string, error) {
Expand Down
6 changes: 3 additions & 3 deletions pkg/commands/compute/init_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,7 @@ func TestInit_ExistingService(t *testing.T) {
expectInManifest []string
expectNoManifest bool
expectInError string
suppresBeacon bool
suppressBeacon bool
}{
{
name: "when the service exists",
Expand Down Expand Up @@ -624,7 +624,7 @@ func TestInit_ExistingService(t *testing.T) {
args: testutil.SplitArgs("compute init --from LsyQ2UXDGk6d4EN"),
expectInError: "--from url seems invalid",
// Not a valid URL OR Service ID
suppresBeacon: true,
suppressBeacon: true,
},
{
name: "service has a cloned_from value",
Expand Down Expand Up @@ -778,7 +778,7 @@ func TestInit_ExistingService(t *testing.T) {

t.Log(stdout.String())

if testcase.suppresBeacon {
if testcase.suppressBeacon {
testutil.AssertLength(t, 0, httpClient.Requests)
} else {
testutil.AssertLength(t, 1, httpClient.Requests)
Expand Down
4 changes: 2 additions & 2 deletions pkg/commands/compute/publish.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,10 +178,10 @@ func (c *PublishCommand) Deploy(in io.Reader, out io.Writer) error {
c.deploy.PackagePath = c.pkg.Value
}
if c.serviceName.WasSet {
c.deploy.ServiceName = c.serviceName // deploy's field is a argparser.OptionalServiceNameID
c.deploy.ServiceName = c.serviceName // deploy's field is an argparser.OptionalServiceNameID
}
if c.serviceVersion.WasSet {
c.deploy.ServiceVersion = c.serviceVersion // deploy's field is a argparser.OptionalServiceVersion
c.deploy.ServiceVersion = c.serviceVersion // deploy's field is an argparser.OptionalServiceVersion
}
if c.domain.WasSet {
c.deploy.Domain = c.domain.Value
Expand Down
4 changes: 2 additions & 2 deletions pkg/commands/compute/serve.go
Original file line number Diff line number Diff line change
Expand Up @@ -928,7 +928,7 @@ func (c *ServeCommand) startPushpin(spinner text.Spinner, out io.Writer) (pushpi
// - path to the routes file to use
// - A routes file that sets up the routes. In our case, we:
// - wires up a backend name (id) to the server host
// - if the backend sets an override host, then we set thatt
// - if the backend sets an override host, then we set that
// - if the backend enables HTTPS, then we enable that
// - if the backend has a path prefix, then we set that up
// - enables WebSocket-over-HTTP
Expand Down Expand Up @@ -1253,7 +1253,7 @@ func watchFiles(root string, gi *ignore.GitIgnore, verbose bool, s *fstexec.Stre
// We do this because if we didn't, then we'd get an error after one
// restart of the viceroy executable: "os: process already finished".
//
// This error happens happens because the compute.watchFiles() function is
// This error happens because the compute.watchFiles() function is
// run in a goroutine and so it will keep running with a copy of the
// fstexec.Streaming command instance that wraps a process which has
// already been terminated.
Expand Down
2 changes: 1 addition & 1 deletion pkg/commands/kvstore/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"github.com/fastly/cli/pkg/text"
)

// CreateCommand calls the Fastly API to create an kv store.
// CreateCommand calls the Fastly API to create a kv store.
type CreateCommand struct {
argparser.Base
argparser.JSONOutput
Expand Down
2 changes: 1 addition & 1 deletion pkg/commands/kvstore/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
"github.com/fastly/cli/pkg/text"
)

// DeleteCommand calls the Fastly API to delete an kv store.
// DeleteCommand calls the Fastly API to delete a kv store.
type DeleteCommand struct {
argparser.Base
argparser.JSONOutput
Expand Down
2 changes: 1 addition & 1 deletion pkg/commands/kvstore/describe.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"github.com/fastly/cli/pkg/text"
)

// DescribeCommand calls the Fastly API to fetch the value of a key from an kv store.
// DescribeCommand calls the Fastly API to fetch the value of a key from a kv store.
type DescribeCommand struct {
argparser.Base
argparser.JSONOutput
Expand Down
2 changes: 1 addition & 1 deletion pkg/commands/kvstoreentry/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func NewCreateCommand(parent argparser.Registerer, g *global.Data) *CreateComman
return &c
}

// CreateCommand calls the Fastly API to insert a key into an kv store.
// CreateCommand calls the Fastly API to insert a key into a kv store.
type CreateCommand struct {
argparser.Base
argparser.JSONOutput
Expand Down
2 changes: 1 addition & 1 deletion pkg/commands/kvstoreentry/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const DeleteKeysPoolSize int = 100
// stopping the goroutines from executing.
const DeleteKeysMaxErrors int = 100

// DeleteCommand calls the Fastly API to delete an kv store.
// DeleteCommand calls the Fastly API to delete a kv store.
type DeleteCommand struct {
argparser.Base
argparser.JSONOutput
Expand Down
2 changes: 1 addition & 1 deletion pkg/commands/kvstoreentry/describe.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"github.com/fastly/cli/pkg/global"
)

// DescribeCommand calls the Fastly API to fetch the value of a key from an kv store.
// DescribeCommand calls the Fastly API to fetch the value of a key from a kv store.
type DescribeCommand struct {
argparser.Base
argparser.JSONOutput
Expand Down
2 changes: 1 addition & 1 deletion pkg/commands/kvstoreentry/get.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
"github.com/fastly/cli/pkg/text"
)

// GetCommand calls the Fastly API to fetch the value of a key from an kv store.
// GetCommand calls the Fastly API to fetch the value of a key from a kv store.
type GetCommand struct {
argparser.Base
argparser.JSONOutput
Expand Down
8 changes: 4 additions & 4 deletions pkg/commands/ngwaf/workspace/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ type CreateCommand struct {
defaultBlockingCode argparser.OptionalInt
defaultRedirectURL argparser.OptionalString
clientIPHeaders argparser.OptionalString
ipAnonimization argparser.OptionalString
ipAnonymization argparser.OptionalString
}

// NewCreateCommand returns a usable command registered under the parent.
Expand All @@ -53,7 +53,7 @@ func NewCreateCommand(parent argparser.Registerer, g *global.Data) *CreateComman
c.CmdClause.Flag("clientIPHeaders", "Specify the request header containing the client IP address. Input accepted as colon separated string.").Action(c.clientIPHeaders.Set).StringVar(&c.clientIPHeaders.Value)
c.CmdClause.Flag("defaultBlockingCode", "Default status code that is returned when a request to your web application is blocked.").Action(c.defaultBlockingCode.Set).IntVar(&c.defaultBlockingCode.Value)
c.CmdClause.Flag("defaultRedirectURL", "Redirect url to be used if code 301 or 302 is used.").Action(c.defaultRedirectURL.Set).StringVar(&c.defaultRedirectURL.Value)
c.CmdClause.Flag("ipAnonimization", "Agents will anonymize IP addresses according to the option selected.").Action(c.ipAnonimization.Set).StringVar(&c.ipAnonimization.Value)
c.CmdClause.Flag("IPAnonymization", "Agents will anonymize IP addresses according to the option selected.").Action(c.ipAnonymization.Set).StringVar(&c.ipAnonymization.Value)
c.RegisterFlagBool(c.JSONFlag())

return &c
Expand Down Expand Up @@ -85,8 +85,8 @@ func (c *CreateCommand) Exec(_ io.Reader, out io.Writer) error {
if c.defaultRedirectURL.WasSet {
input.DefaultRedirectURL = &c.defaultRedirectURL.Value
}
if c.ipAnonimization.WasSet {
input.IPAnonymization = &c.ipAnonimization.Value
if c.ipAnonymization.WasSet {
input.IPAnonymization = &c.ipAnonymization.Value
}

fc, ok := c.Globals.APIClient.(*fastly.Client)
Expand Down
8 changes: 4 additions & 4 deletions pkg/commands/ngwaf/workspace/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ type UpdateCommand struct {
defaultBlockingCode argparser.OptionalInt
defaultRedirectURL argparser.OptionalString
clientIPHeaders argparser.OptionalString
ipAnonimization argparser.OptionalString
IPAnonymization argparser.OptionalString
Comment thread
anthony-gomez-fastly marked this conversation as resolved.
}

// NewUpdateCommand returns a usable command registered under the parent.
Expand All @@ -55,7 +55,7 @@ func NewUpdateCommand(parent argparser.Registerer, g *global.Data) *UpdateComman
c.CmdClause.Flag("clientIPHeaders", "Specify the request header containing the client IP address. Input accepted as colon separated string.").Action(c.clientIPHeaders.Set).StringVar(&c.clientIPHeaders.Value)
c.CmdClause.Flag("defaultBlockingCode", "Default status code that is returned when a request to your web application is blocked.").Action(c.defaultBlockingCode.Set).IntVar(&c.defaultBlockingCode.Value)
c.CmdClause.Flag("defaultRedirectURL", "Redirect url to be used if code 301 or 302 is used.").Action(c.defaultRedirectURL.Set).StringVar(&c.defaultRedirectURL.Value)
c.CmdClause.Flag("ipAnonimization", "Agents will anonymize IP addresses according to the option selected.").Action(c.ipAnonimization.Set).StringVar(&c.ipAnonimization.Value)
c.CmdClause.Flag("ipAnonymization", "Agents will anonymize IP addresses according to the option selected.").Action(c.IPAnonymization.Set).StringVar(&c.IPAnonymization.Value)
c.RegisterFlagBool(c.JSONFlag())

return &c
Expand Down Expand Up @@ -96,8 +96,8 @@ func (c *UpdateCommand) Exec(_ io.Reader, out io.Writer) error {
if c.defaultRedirectURL.WasSet {
input.DefaultRedirectURL = &c.defaultRedirectURL.Value
}
if c.ipAnonimization.WasSet {
input.IPAnonymization = &c.ipAnonimization.Value
if c.IPAnonymization.WasSet {
input.IPAnonymization = &c.IPAnonymization.Value
}

fc, ok := c.Globals.APIClient.(*fastly.Client)
Expand Down
8 changes: 4 additions & 4 deletions pkg/commands/objectstorage/accesskeys/accesskeys_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ func TestAccessKeysDelete(t *testing.T) {
Status: http.StatusText(http.StatusBadRequest),
Body: io.NopCloser(bytes.NewReader(testutil.GenJSON(`
{
"title": "invalid Acess Key ID",
"title": "invalid Access Key ID",
"status": 400
}
`))),
Expand Down Expand Up @@ -167,7 +167,7 @@ func TestAccessKeysGet(t *testing.T) {
Status: http.StatusText(http.StatusBadRequest),
Body: io.NopCloser(bytes.NewReader(testutil.GenJSON(`
{
"title": "invalid Acess Key ID",
"title": "invalid Access Key ID",
"status": 400
}
`))),
Expand Down Expand Up @@ -303,11 +303,11 @@ Created (UTC): 2021-06-15 23:00
`) + "\n"

var listAccessKeysString = strings.TrimSpace(`
ID Secret Description Permssion Buckets Created At
ID Secret Description Permission Buckets Created At
foo bar bat read-only-objects all 0001-01-01 00:00:00 +0000 UTC
foobar baz bizz read-only-objects [b1 b2] 0001-01-01 00:00:00 +0000 UTC
`) + "\n"

var zeroListAccessKeysString = strings.TrimSpace(`
ID Secret Description Permssion Buckets Created At
ID Secret Description Permission Buckets Created At
`) + "\n"
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func TestImageOptimizerDefaultsUpdate(t *testing.T) {
WantError: "problem with field 'ResizeFilter, Webp, WebpQuality, JpegType, JpegQuality, Upscale, AllowVideo': at least one of the available optional fields is required",
},
{
Name: "valudate successful boolean updates of webp, upscale and allow-video",
Name: "validate successful boolean updates of webp, upscale and allow-video",
Args: "--service-id 123 --version 1 --webp=true --upscale=false --allow-video=true",
API: &mock.API{
ListVersionsFn: testutil.ListVersions,
Expand All @@ -45,7 +45,7 @@ func TestImageOptimizerDefaultsUpdate(t *testing.T) {
WantOutput: "Updated Image Optimizer default settings for service 123 (version 1)\n\nAllow Video: true\nJPEG Quality: 85\nJPEG Type: auto\nResize Filter: lanczos3\nUpscale: false\nWebP: true\nWebP Quality: 85\n",
},
{
Name: "validate successful upate of the --resize, --webp-quality and --jpeg-quality flags",
Name: "validate successful update of the --resize, --webp-quality and --jpeg-quality flags",
Args: "--service-id 123 --version 1 --resize-filter bicubic --webp-quality 90 --jpeg-quality 80",
API: &mock.API{
ListVersionsFn: testutil.ListVersions,
Expand Down
2 changes: 1 addition & 1 deletion pkg/commands/service/logging/grafanacloudlogs/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ func NewUpdateCommand(parent argparser.Registerer, g *global.Data) *UpdateComman
Dst: &c.ServiceName.Value,
})
c.CmdClause.Flag("user", "Your Grafana Cloud Logs User ID.").Action(c.User.Set).StringVar(&c.User.Value)
c.CmdClause.Flag("auth-token", "Your Granana Access Policy Token").Action(c.Token.Set).StringVar(&c.Token.Value)
c.CmdClause.Flag("auth-token", "Your Grafana Access Policy Token").Action(c.Token.Set).StringVar(&c.Token.Value)
c.CmdClause.Flag("url", "URL of your Grafana Instance").Action(c.URL.Set).StringVar(&c.URL.Value)
c.CmdClause.Flag("index", "Stream identifier").Action(c.Index.Set).StringVar(&c.Index.Value)
return &c
Expand Down
2 changes: 1 addition & 1 deletion pkg/commands/service/ratelimit/ratelimit_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ func TestRateLimitList(t *testing.T) {
testutil.RunCLIScenarios(t, []string{root.CommandName, sub.CommandName, "list"}, scenarios)
}

func TesRateLimittUpdate(t *testing.T) {
func TesRateLimitUpdate(t *testing.T) {
scenarios := []testutil.CLIScenario{
{
Name: "validate UpdateERL API error",
Expand Down
2 changes: 1 addition & 1 deletion pkg/commands/service/service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ func TestServiceDelete(t *testing.T) {
for testcaseIdx := range scenarios {
testcase := &scenarios[testcaseIdx]
t.Run(strings.Join(testcase.args, " "), func(t *testing.T) {
// We're going to chdir to an temp environment,
// We're going to chdir to a temp environment,
// so save the PWD to return to, afterwards.
pwd, err := os.Getwd()
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion pkg/commands/version/version_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func TestVersion(t *testing.T) {
t.Skip("skipping test due to unix specific mock shell script")
}

// We're going to chdir to an temp environment,
// We're going to chdir to a temp environment,
// so save the PWD to return to, afterwards.
pwd, err := os.Getwd()
if err != nil {
Expand Down
6 changes: 3 additions & 3 deletions pkg/config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ func TestConfigRead(t *testing.T) {

for _, testcase := range scenarios {
t.Run(testcase.name, func(t *testing.T) {
// We're going to chdir to an temp environment,
// We're going to chdir to a temp environment,
// so save the PWD to return to, afterwards.
pwd, err := os.Getwd()
if err != nil {
Expand Down Expand Up @@ -167,7 +167,7 @@ func TestConfigRead(t *testing.T) {

// TestUseStatic validates legacy user data is migrated successfully.
func TestUseStatic(t *testing.T) {
// We're going to chdir to an temp environment,
// We're going to chdir to a temp environment,
// so save the PWD to return to, afterwards.
pwd, err := os.Getwd()
if err != nil {
Expand Down Expand Up @@ -294,7 +294,7 @@ func TestInvalidConfig(t *testing.T) {
for testcaseIdx := range scenarios {
testcase := &scenarios[testcaseIdx]
t.Run(testcase.Name, func(t *testing.T) {
// We're going to chdir to an temp environment,
// We're going to chdir to a temp environment,
// so save the PWD to return to, afterwards.
pwd, err := os.Getwd()
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion pkg/errors/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ var ErrInvalidKVCombo = RemediationError{
}

// ErrInvalidStdinFileDirCombo means the user provided more than one of --stdin,
// --file or --dir flags, which are mutally exclusive behaviours.
// --file or --dir flags, which are mutually exclusive behaviours.
var ErrInvalidStdinFileDirCombo = RemediationError{
Inner: fmt.Errorf("invalid flag combination"),
Remediation: "Use only one of --stdin, --file or --dir.",
Expand Down
Loading
Loading