Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@Integralist
Copy link
Collaborator

@Integralist Integralist commented Apr 19, 2023

We weren't quite ready to drop support for [setup.object_store].

Tested with...

authors = [""]
description = ""
language = "go"
manifest_version = 3
name = "testing-fastly-cli"
service_id = ""

[setup]

  [setup.object_stores]

    [setup.object_stores.testing-v9]
      description = "My first store"

Screenshot 2023-04-19 at 17 52 33

@Integralist Integralist added the bug Something isn't working label Apr 19, 2023
Copy link
Collaborator Author

@Integralist Integralist left a comment

Choose a reason for hiding this comment

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

Just some comments for anyone reviewing this PR...

NonInteractive: c.Globals.Flags.NonInteractive,
ServiceID: serviceID,
ServiceVersion: serviceVersion,
Setup: c.Manifest.File.Setup.ObjectStores,
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We're effectively aliasing [setup.object_stores] to the kv_stores implementation. Discussed internally, and it was decided this was OK to do as an interim solution.

if err != nil {
return false, 0, err
}
defer func() {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The gosec CI tool started complaining.

err := b.Spinner.StopFail()
if err != nil {
return err
spinErr := b.Spinner.StopFail()
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I discovered a bunch of these issues where the actual API error was being accidentally overridden by a separate error and so (as a user) you wouldn't see an error related to what had gone wrong.

if o.Spinner == nil {
return errors.RemediationError{
Inner: fmt.Errorf("internal logic error: no text.Progress configured for setup.KVStores"),
Inner: fmt.Errorf("internal logic error: no spinner configured for setup.KVStores"),
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This should have been fixed in an older PR but I think a bad rebase meant this old implementation detail was left in.

Backends map[string]*SetupBackend `toml:"backends,omitempty"`
ConfigStores map[string]*SetupConfigStore `toml:"config_stores,omitempty"`
Loggers map[string]*SetupLogger `toml:"log_endpoints,omitempty"`
ObjectStores map[string]*SetupKVStore `toml:"object_stores,omitempty"`
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Here is where we're again parsing [setup.object_stores].

@Integralist Integralist merged commit 0fa05ec into main Apr 19, 2023
@Integralist Integralist deleted the integralist/alias-object-store branch April 19, 2023 17:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants