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

fix: reinstate support for [setup.object_stores] #918

Merged
merged 7 commits into from
Apr 19, 2023

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.

@@ -1282,6 +1313,9 @@ func pingServiceURL(serviceURL string, httpClient api.HTTPClient, expectedStatus
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.

@@ -107,7 +108,7 @@ func (o *KVStores) Configure() error {
func (o *KVStores) Create() error {
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.

@@ -6,6 +6,7 @@ type Setup struct {
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.

2 participants