diff --git a/.codespellrc b/.codespellrc new file mode 100644 index 0000000000..969a434004 --- /dev/null +++ b/.codespellrc @@ -0,0 +1,7 @@ +[codespell] +# Ref: https://github.com/codespell-project/codespell#using-a-config-file +skip = .git*,go.sum,.codespellrc +check-hidden = true +# all lines with latin +ignore-regex = .* tincidunt .*|\bMany Withs\b +# ignore-words-list = diff --git a/.github/workflows/codespell.yml b/.github/workflows/codespell.yml new file mode 100644 index 0000000000..7bab9fd690 --- /dev/null +++ b/.github/workflows/codespell.yml @@ -0,0 +1,25 @@ +# Codespell configuration is within .codespellrc +--- +name: Codespell + +on: + push: + branches: [develop] + pull_request: + branches: [develop] + +permissions: + contents: read + +jobs: + codespell: + name: Check for spelling errors + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Annotate locations with typos + uses: codespell-project/codespell-problem-matcher@v1 + - name: Codespell + uses: codespell-project/actions-codespell@v2 diff --git a/CHANGELOG.md b/CHANGELOG.md index 4af85df1cd..93cdad5f92 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -360,10 +360,10 @@ _Bug fixes_ #### Connection Management - Optimise connection initialisation for high connection count ([#3394](https://github.com/turbot/steampipe/issues/3394),[#3267](https://github.com/turbot/steampipe/issues/3267),[#3236](https://github.com/turbot/steampipe/issues/3236),[#3229](https://github.com/turbot/steampipe/issues/3229),[#3413](https://github.com/turbot/steampipe/issues/3413)) - - Execute RefreshConnections asyncronously in service startup + - Execute RefreshConnections asynchronously in service startup - Start executing queries without waiting for connections to load, add smart error handling to wait for required connection - Optimise autocomplete for high connection count - - Autocomplete and inspect data available before all conections are refreshed + - Autocomplete and inspect data available before all connections are refreshed - Add `steampipe_connection_state` table to indicate the loading state of connections - Add support for `import_schema` property in connection config, controlling whether to create a postgres schema for a steampipe connection. Closes #3407 - Optimise schema creation by cloning connection schemas @@ -375,7 +375,7 @@ _Bug fixes_ - Schema names starting with steampipe_ are to be reserved for steampipe. #### Mod Dependency Management -- Support mods requiring different versions of the same depdency mod. ([#3302](https://github.com/turbot/steampipe/issues/3302)) +- Support mods requiring different versions of the same dependency mod. ([#3302](https://github.com/turbot/steampipe/issues/3302)) - Support transitive dependencies referencing variables from different versions of same mod.([#3337](https://github.com/turbot/steampipe/issues/3337)) - Resource references in dependency mods must be fully qualified. ([#3335](https://github.com/turbot/steampipe/issues/3335)) - Locals in dependency mods cannot be referenced. ([#3336](https://github.com/turbot/steampipe/issues/3336)) @@ -724,7 +724,7 @@ _Bug fixes_ ## v0.15.0 [2022-06-23] _What's new?_ * Add support for Open Telemetry. ([#1193](https://github.com/turbot/steampipe/issues/1193)) -* Update `.timing` output to return additional query metadata such as the number of hydrate functions called andd the cache status. ([#2192](https://github.com/turbot/steampipe/issues/2192)) +* Update `.timing` output to return additional query metadata such as the number of hydrate functions called and the cache status. ([#2192](https://github.com/turbot/steampipe/issues/2192)) * Add `steampipe_command.scan_metadata` table to support returning additional data from `.timing` command. ([#203](https://github.com/turbot/steampipe-postgres-fdw/issues/203)) * Update postgres config to enable auto-vacuum. ([#2083](https://github.com/turbot/steampipe/issues/2083)) * Add `--show-password` CLI arg to reveal the db user password. Disables password visibility by default. ([#2033](https://github.com/turbot/steampipe/issues/2033)) @@ -853,7 +853,7 @@ _What's new?_ * Add feedback during workspace load in `dashboard` command. ([#1567](https://github.com/turbot/steampipe/issues/1567)) _Bug fixes_ -* Fix excessive memory usage intialising a high number of connections. ([#1656](https://github.com/turbot/steampipe/issues/1656)) +* Fix excessive memory usage initialising a high number of connections. ([#1656](https://github.com/turbot/steampipe/issues/1656)) * Fix issue where service was not shut down if command is cancelled during initialisation. ([#1288](https://github.com/turbot/steampipe/issues/1288)) * Fix issue where installing a plugin from any `stream` other than `latest` did not install the default `config` file. ([#1660](https://github.com/turbot/steampipe/issues/1660)) * Fix query argument resolution not working correctly when some args are provided by HCL and some from runtime args. ([#1661](https://github.com/turbot/steampipe/issues/1661)) @@ -950,7 +950,7 @@ _What's new?_ * Do not show plugin error messages in JSON/CSV output. ([#1110](https://github.com/turbot/steampipe/issues/1110)) * Provider more responsive feedback for control runs. ([#1101](https://github.com/turbot/steampipe/issues/1101)) * Create prepared statements one by one to allow accurate error reporting and reduce memory burden. ([#1148](https://github.com/turbot/steampipe/issues/1148)) -* Improve display of asyncronous error in interactive prompt. ([#1085](https://github.com/turbot/steampipe/issues/1085)) +* Improve display of asynchronous error in interactive prompt. ([#1085](https://github.com/turbot/steampipe/issues/1085)) * Deprecate `workspace` argument, replace with `workspace-chdir` _Bug fixes_ @@ -1039,9 +1039,9 @@ _What's new?_ * Various minor UI tweaks. ([#786](https://github.com/turbot/steampipe/issues/786)) _Bug fixes_ -* Fix issue where the `>` prompt disappears when messages are shown from file watcher or asyncronous initialisation. ([#713](https://github.com/turbot/steampipe/issues/713)) +* Fix issue where the `>` prompt disappears when messages are shown from file watcher or asynchronous initialisation. ([#713](https://github.com/turbot/steampipe/issues/713)) * Fix errors during async interactive startup leaving the prompt in a bad state. ([#728](https://github.com/turbot/steampipe/issues/728)) -* Fix for delay in `loading results` spinner showing, caused by asyncronous initialisation. ([#671](https://github.com/turbot/steampipe/issues/671)) +* Fix for delay in `loading results` spinner showing, caused by asynchronous initialisation. ([#671](https://github.com/turbot/steampipe/issues/671)) * Fix for missing `control_description`, `control_title` in `csv` output of `check` command. ([#739](https://github.com/turbot/steampipe/issues/739)) * Fix for `0` exit code even if `service start` fails. ([#762](https://github.com/turbot/steampipe/issues/762)) * Fix issue where configs referring to unavailable plugin will display incorrect error message. ([#796](https://github.com/turbot/steampipe/issues/796)) @@ -1095,7 +1095,7 @@ _Bug fixes_ * Fixes issue where `STEAMPIPE_INSTALL_DIR` was not being respected. ([#613](https://github.com/turbot/steampipe/issues/613)) * Fix multiple ctrl+C presses causing a crash on control runs. ([#630](https://github.com/turbot/steampipe/issues/630)) * Ensure multiline control errors are rendered in full ([#672](https://github.com/turbot/steampipe/issues/672)) -* Fix crash when benchmark has duplicate children. Instead, raise a validaiton failure. ([#667](https://github.com/turbot/steampipe/issues/667)) +* Fix crash when benchmark has duplicate children. Instead, raise a validation failure. ([#667](https://github.com/turbot/steampipe/issues/667)) * Fixes issue where `service stop` does not work on `Linux` systems. ([#653](https://github.com/turbot/steampipe/issues/653)) * Plugin schema validation errors should be displayed as warning, and not cause Steampipe to exit. ([#644](https://github.com/turbot/steampipe/issues/644)) diff --git a/cmd/service.go b/cmd/service.go index c7bea5f340..cbc979aafe 100644 --- a/cmd/service.go +++ b/cmd/service.go @@ -233,7 +233,7 @@ func startServiceAndRefreshConnections(ctx context.Context, listenAddresses []st if startResult.Status == db_local.ServiceStarted { // ask the plugin manager to refresh connections - // this is executed asyncronously by the plugin manager + // this is executed asynchronously by the plugin manager // we ignore this error, since RefreshConnections is async and all errors will flow through // the notification system // we do not expect any I/O errors on this since the PluginManager is running in the same box diff --git a/design/adding_to_workspace_profile.md b/design/adding_to_workspace_profile.md index afd7537752..544a58a2f3 100644 --- a/design/adding_to_workspace_profile.md +++ b/design/adding_to_workspace_profile.md @@ -5,7 +5,7 @@ ### Adding simple properties to `Workspace Profile` * Add properties to the `WorkspaceProfile` struct in `pkg/steampipeconfig/modconfig/workspace_profile.go`. -* Add `hcl` and `cty` tags to the properties. (eample: `hcl:"search_path" cty:"search_path"`). +* Add `hcl` and `cty` tags to the properties. (example: `hcl:"search_path" cty:"search_path"`). * Add to `(p *WorkspaceProfile) setBaseProperties()`. This enables `base` profile inheritance. **Remember to check for `nil`**. * Add to `(p *WorkspaceProfile) ConfigMap(commandName string)`. diff --git a/design/connection_status_table.md b/design/connection_status_table.md index 5b0c83e1c8..74a9600a18 100644 --- a/design/connection_status_table.md +++ b/design/connection_status_table.md @@ -23,7 +23,7 @@ Current behaviour: Currently this loads the connections.json file However instead it should load the connections table, joined with the foreign schema list, and identify 'ready' connections. -This is more up to date (the state file is onl written at the end) +This is more up to date (the state file is only written at the end) ## Connection state table diff --git a/design/internal_introspection_tables.md b/design/internal_introspection_tables.md index 77b4815014..f51d79d9ea 100644 --- a/design/internal_introspection_tables.md +++ b/design/internal_introspection_tables.md @@ -33,7 +33,7 @@ to either `ready` or `error` ### Connection config file changed The when a connection file is changed the ConnectionWatcher calls `pluginManager.OnConnectionConfigChanged`, and then calls -`RefreshConnections` asyncronously +`RefreshConnections` asynchronously `OnConnectionConfigChanged`calls: - `handleConnectionConfigChanges` @@ -69,7 +69,7 @@ with updated rate limiters. ### Plugin config file changed The when a connection file is changed the ConnectionWatcher calls `pluginManager.OnConnectionConfigChanged`, and then calls -`RefreshConnections` asyncronously +`RefreshConnections` asynchronously `OnConnectionConfigChanged` determines which connections have been added, removed and deleted. It then builds a set of SetConnectionConfigRequest, one for each plugin instance with changed connections diff --git a/design/internal_introspection_tables_tests.md b/design/internal_introspection_tables_tests.md index c5c67ed8aa..6398149eee 100644 --- a/design/internal_introspection_tables_tests.md +++ b/design/internal_introspection_tables_tests.md @@ -89,12 +89,12 @@ connection "aws" { #### On interactive startup: ``` -Warning: counld not resolve plugin +Warning: could not resolve plugin ``` #### On file watcher event startup: ``` -Warning: counld not resolve plugin +Warning: could not resolve plugin ``` ### Actual diff --git a/design/search_path.md b/design/search_path.md index 0497378c96..13a0afa48d 100644 --- a/design/search_path.md +++ b/design/search_path.md @@ -9,7 +9,7 @@ Server side search path (the 'steampipe' user search path) is determined accordi It is set as follows: - When service is started the user search path is cleared (to avoid a race condition if the config has changed, and a query is executed before the user searhc path is update) -- Post-service-start, RefreshConnections is called asyncronously. +- Post-service-start, RefreshConnections is called asynchronously. - RefreshConnections sets the required user search path, (determined using the precedence above.) - It then adds new schemas in the order of the search path @@ -21,7 +21,7 @@ Client side search path (the session search path) is determined according to fol 4) The compiled default (public, then alphabetical by connection name) -When a DB session is created, if viper has a setting for either `search_path` ot `search_path_prefix`, the session search path is set (determined using the precedence above.) +When a DB session is created, if viper has a setting for either `search_path` or `search_path_prefix`, the session search path is set (determined using the precedence above.) @@ -77,7 +77,7 @@ the updated search path will be reflected in any _new_ Steampipe interactive ses If an interactive session (or third paty client session) is running, changes to the search path options _will not_ be reflected in the current session. -### Dasboard Service +### Dashboard Service If the dashboard service is running, changes to the search path options _will not_ be reflected until the dashboard service is restarted diff --git a/design/sperr.md b/design/sperr.md index ff65194430..b440e823e9 100644 --- a/design/sperr.md +++ b/design/sperr.md @@ -107,7 +107,7 @@ showCaseErr := sperr.Wrap( ``` -Outputs of the `showCaseErr` in preceeding program would be: +Outputs of the `showCaseErr` in preceding program would be: #### `%q` diff --git a/design/steampipe_data_files.md b/design/steampipe_data_files.md index c028977ea4..56517bf303 100644 --- a/design/steampipe_data_files.md +++ b/design/steampipe_data_files.md @@ -10,7 +10,7 @@ - `pipes.turbot.com.sptt` - Stores the [Turbot Pipes](https://pipes.turbot.com) token. Deleting the file would require you to run steampipe login again. -- `connection.json` - Stores the connection config information. This file gets re-generated everytime RefreshConnections is called. +- `connection.json` - Stores the connection config information. This file gets re-generated every time RefreshConnections is called. - `history.json` - Stores the last used queries. Deleting this file would result in losing your history of queries. This file gets re-generated. diff --git a/pkg/connection/connection_state_table_updater.go b/pkg/connection/connection_state_table_updater.go index afa1bcd4c5..354a35a954 100644 --- a/pkg/connection/connection_state_table_updater.go +++ b/pkg/connection/connection_state_table_updater.go @@ -35,7 +35,7 @@ func (u *connectionStateTableUpdater) start(ctx context.Context) error { var queries []db_common.QueryWithArgs - // update the conection state table to set appropriate state for all connections + // update the connection state table to set appropriate state for all connections // set updates to "updating" for name, connectionState := range u.updates.FinalConnectionState { // set the connection data state based on whether this connection is being created or deleted diff --git a/pkg/connection/connection_watcher.go b/pkg/connection/connection_watcher.go index 2880ac9589..5b0126a5a9 100644 --- a/pkg/connection/connection_watcher.go +++ b/pkg/connection/connection_watcher.go @@ -101,9 +101,9 @@ func (w *ConnectionWatcher) handleFileWatcherEvent([]fsnotify.Event) { // to use the GlobalConfig here and ignore Workspace Profile in general cmdconfig.SetDefaultsFromConfig(steampipeconfig.GlobalConfig.ConfigMap()) - log.Printf("[INFO] calling RefreshConnections asyncronously") + log.Printf("[INFO] calling RefreshConnections asynchronously") - // call RefreshConnections asyncronously + // call RefreshConnections asynchronously // the RefreshConnections implements its own locking to ensure only a single execution and a single queues execution go RefreshConnections(ctx, w.pluginManager) diff --git a/pkg/connection/refresh_connections_state.go b/pkg/connection/refresh_connections_state.go index dfa39af565..844c86cb5c 100644 --- a/pkg/connection/refresh_connections_state.go +++ b/pkg/connection/refresh_connections_state.go @@ -425,7 +425,7 @@ func (s *refreshConnectionState) executeUpdateQueries(ctx context.Context) { // this gives any attached interactive clients a chance to update their inspect data and autocomplete if err := s.pluginManager.SendPostgresSchemaNotification(ctx); err != nil { // just log - log.Printf("[WARN] failed to send schem update Postgres notification: %s", err.Error()) + log.Printf("[WARN] failed to send scheme update Postgres notification: %s", err.Error()) } if len(remainingUpdates) > 0 { @@ -568,7 +568,7 @@ func (s *refreshConnectionState) executeUpdateSetsInParallel(ctx context.Context return errors } -// syncronously execute the update queries for one or more connections +// synchronously execute the update queries for one or more connections func (s *refreshConnectionState) executeUpdateForConnections(ctx context.Context, errChan chan *connectionError, cloneSchemaEnabled bool, connectionStates ...*steampipeconfig.ConnectionState) { log.Println("[DEBUG] refreshConnectionState.executeUpdateForConnections start") defer log.Println("[DEBUG] refreshConnectionState.executeUpdateForConnections end") @@ -699,7 +699,7 @@ func (s *refreshConnectionState) UpdateCommentsInParallel(ctx context.Context, u return errors } -// syncronously execute the comments queries for one or more connections +// synchronously execute the comments queries for one or more connections func (s *refreshConnectionState) updateCommentsForConnection(ctx context.Context, errChan chan *connectionError, connectionPluginMap map[string]*steampipeconfig.ConnectionPlugin, connectionState *steampipeconfig.ConnectionState) { log.Printf("[DEBUG] refreshConnectionState.updateCommentsForConnection start for connection '%s'", connectionState.ConnectionName) diff --git a/pkg/connection_sync/wait_for_search_path.go b/pkg/connection_sync/wait_for_search_path.go index 38d3cd52fa..2e344f9484 100644 --- a/pkg/connection_sync/wait_for_search_path.go +++ b/pkg/connection_sync/wait_for_search_path.go @@ -20,7 +20,7 @@ func WaitForSearchPathSchemas(ctx context.Context, client db_common.Client, sear _, err = steampipeconfig.LoadConnectionState(ctx, conn.Conn(), steampipeconfig.WithWaitForSearchPath(searchPath)) - // NOTE: if we failed to load conection state, this must be because we are connected to an older version of the CLI + // NOTE: if we failed to load connection state, this must be because we are connected to an older version of the CLI // just return nil error if db_common.IsRelationNotFoundError(err) { return nil diff --git a/pkg/db/db_client/db_client_execute.go b/pkg/db/db_client/db_client_execute.go index a9b5748389..fc9f43350d 100644 --- a/pkg/db/db_client/db_client_execute.go +++ b/pkg/db/db_client/db_client_execute.go @@ -189,7 +189,7 @@ func (c *DbClient) getQueryTiming(ctx context.Context, startTime time.Time, sess // disable fetching timing information to avoid recursion c.disableTiming = true - // whatever happens, we need to reenable timing, and send the result back with at least the duration + // whatever happens, we need to re-enable timing, and send the result back with at least the duration defer func() { c.disableTiming = false resultChannel.SetTiming(timingResult) diff --git a/pkg/db/db_client/db_client_session.go b/pkg/db/db_client/db_client_session.go index e9ba8647db..d752d15163 100644 --- a/pkg/db/db_client/db_client_session.go +++ b/pkg/db/db_client/db_client_session.go @@ -43,7 +43,7 @@ func (c *DbClient) AcquireSession(ctx context.Context) (sessionResult *db_common session = db_common.NewDBSession(backendPid) c.sessions[backendPid] = session } - // we get a new *sql.Conn everytime. USE IT! + // we get a new *sql.Conn every time. USE IT! session.Connection = databaseConnection sessionResult.Session = session c.sessionsMutex.Unlock() diff --git a/pkg/db/db_common/db_session.go b/pkg/db/db_common/db_session.go index 57ab6e55f3..3b75658f4c 100644 --- a/pkg/db/db_common/db_session.go +++ b/pkg/db/db_common/db_session.go @@ -15,7 +15,7 @@ type DatabaseSession struct { BackendPid uint32 `json:"backend_pid"` SearchPath []string `json:"-"` - // this gets rewritten, since the database/sql gives back a new instance everytime + // this gets rewritten, since the database/sql gives back a new instance every time Connection *pgxpool.Conn `json:"-"` } diff --git a/pkg/db/db_local/backup.go b/pkg/db/db_local/backup.go index 7c9240e408..c4c9547439 100644 --- a/pkg/db/db_local/backup.go +++ b/pkg/db/db_local/backup.go @@ -431,7 +431,7 @@ func retainBackup(ctx context.Context) error { ) if output, err := txtConvertCmd.CombinedOutput(); err != nil { - log.Println("[TRACE] pg_restore convertion process output:", string(output)) + log.Println("[TRACE] pg_restore conversion process output:", string(output)) return err } diff --git a/pkg/db/db_local/install.go b/pkg/db/db_local/install.go index 7ba3f19d87..dd6e980ece 100644 --- a/pkg/db/db_local/install.go +++ b/pkg/db/db_local/install.go @@ -155,7 +155,7 @@ func IsDBInstalled() bool { return true } -// IsFDWInstalled chceks whether all files required for the Steampipe FDW are available +// IsFDWInstalled checks whether all files required for the Steampipe FDW are available func IsFDWInstalled() bool { fdwSQLFile, fdwControlFile := filepaths.GetFDWSQLAndControlLocation() if _, err := os.Stat(fdwSQLFile); os.IsNotExist(err) { diff --git a/pkg/db/db_local/local_db_client.go b/pkg/db/db_local/local_db_client.go index 3497b09f96..c9d1e068ee 100644 --- a/pkg/db/db_local/local_db_client.go +++ b/pkg/db/db_local/local_db_client.go @@ -56,7 +56,7 @@ func GetLocalClient(ctx context.Context, invoker constants.Invoker, opts ...db_c // NOTE: we cannot do this until after creating the client to ensure we do not miss notifications if startResult.Status == ServiceStarted { // ask the plugin manager to refresh connections - // this is executed asyncronously by the plugin manager + // this is executed asynchronously by the plugin manager // we ignore this error, since RefreshConnections is async and all errors will flow through // the notification system // we do not expect any I/O errors on this since the PluginManager is running in the same box diff --git a/pkg/db/db_local/notify.go b/pkg/db/db_local/notify.go index 39d3afdc6d..eef58a0bcb 100644 --- a/pkg/db/db_local/notify.go +++ b/pkg/db/db_local/notify.go @@ -11,7 +11,7 @@ import ( "github.com/turbot/steampipe/pkg/constants" ) -// SendPostgresNotification send a postgres notification that the schema has chganged +// SendPostgresNotification send a postgres notification that the schema has changed func SendPostgresNotification(_ context.Context, conn *pgx.Conn, notification any) error { notificationBytes, err := json.Marshal(notification) if err != nil { diff --git a/pkg/db/db_local/start_services.go b/pkg/db/db_local/start_services.go index 844387aa27..eb429ae9f8 100644 --- a/pkg/db/db_local/start_services.go +++ b/pkg/db/db_local/start_services.go @@ -453,7 +453,7 @@ func createCmd(ctx context.Context, port int, listenAddresses []string) *exec.Cm // log directory "-c", fmt.Sprintf("log_directory=%s", filepaths.EnsureLogDir()), - // If ssl is off it doesnot matter what we pass in the ssl_cert_file and ssl_key_file + // If ssl is off it doesn't matter what we pass in the ssl_cert_file and ssl_key_file // SSL will only get validated if ssl is on "-c", fmt.Sprintf("ssl=%s", sslStatus()), "-c", fmt.Sprintf("ssl_cert_file=%s", filepaths.GetServerCertLocation()), diff --git a/pkg/db/db_local/stop_services.go b/pkg/db/db_local/stop_services.go index 21e8db4883..e6aa6c3486 100644 --- a/pkg/db/db_local/stop_services.go +++ b/pkg/db/db_local/stop_services.go @@ -228,7 +228,7 @@ Postgres has three levels of shutdown: - SIGTERM - Smart Shutdown : Wait for children to end normally - exit self - SIGINT - Fast Shutdown : SIGTERM children, causing them to abort current - transations and exit - wait for children to exit - + transactions and exit - wait for children to exit - exit self - SIGQUIT - Immediate Shutdown : SIGQUIT children - wait at most 5 seconds, send SIGKILL to children - exit self immediately diff --git a/pkg/interactive/interactive_client.go b/pkg/interactive/interactive_client.go index cada54ad7d..ebe3248553 100644 --- a/pkg/interactive/interactive_client.go +++ b/pkg/interactive/interactive_client.go @@ -510,7 +510,7 @@ func (c *InteractiveClient) getQuery(ctx context.Context, line string) *modconfi func (c *InteractiveClient) executeMetaquery(ctx context.Context, query string) error { // the client must be initialised to get here if !c.isInitialised() { - panic("client is not initalised") + panic("client is not initialised") } // validate the metaquery arguments validateResult := metaquery.Validate(query) diff --git a/pkg/interactive/interactive_client_init.go b/pkg/interactive/interactive_client_init.go index ba3136435a..8c976c3d32 100644 --- a/pkg/interactive/interactive_client_init.go +++ b/pkg/interactive/interactive_client_init.go @@ -102,9 +102,9 @@ func (c *InteractiveClient) readInitDataStream(ctx context.Context) { statushooks.SetStatus(ctx, "Load plugin schemas…") // fetch the schema // TODO make this async https://github.com/turbot/steampipe/issues/3400 - // NOTE: we would like to do this asyncronously, but we are currently limited to a single Db connection in our + // NOTE: we would like to do this asynchronously, but we are currently limited to a single Db connection in our // as the client cache settings are set per connection so we rely on only having a single connection - // This means that the schema load would block other queries anyway so there is no benefit right not in making asyncronous + // This means that the schema load would block other queries anyway so there is no benefit right not in making asynchronous if err := c.loadSchema(); err != nil { c.initData.Result.Error = err diff --git a/pkg/ociinstaller/db.go b/pkg/ociinstaller/db.go index 7f8610b8fc..ecd87cd102 100644 --- a/pkg/ociinstaller/db.go +++ b/pkg/ociinstaller/db.go @@ -12,7 +12,7 @@ import ( versionfile "github.com/turbot/steampipe/pkg/ociinstaller/versionfile" ) -// InstallDB :: Install Postgres files fom OCI image +// InstallDB :: Install Postgres files from OCI image func InstallDB(ctx context.Context, dblocation string) (string, error) { tempDir := ociinstaller.NewTempDir(dblocation) defer func() { diff --git a/pkg/pluginmanager/lifecycle.go b/pkg/pluginmanager/lifecycle.go index 46fcac0565..6d9a9b1f00 100644 --- a/pkg/pluginmanager/lifecycle.go +++ b/pkg/pluginmanager/lifecycle.go @@ -145,7 +145,7 @@ func getPluginManager(startIfNeeded bool) (pluginshared.PluginManager, error) { } // if we did not load it and there was no error, it means the plugin manager is not running // we cannot start it as we do not know the correct steampipe exe path - which is stored in the state - // this is not expected - we would expect the plugin manager to have been started with the datatbase + // this is not expected - we would expect the plugin manager to have been started with the database if state.Executable == "" { return nil, fmt.Errorf("plugin manager is not running and there is no state file") } diff --git a/pkg/pluginmanager/plugin_manager_client.go b/pkg/pluginmanager/plugin_manager_client.go index 1100ec69a0..c9fa8e0122 100644 --- a/pkg/pluginmanager/plugin_manager_client.go +++ b/pkg/pluginmanager/plugin_manager_client.go @@ -56,7 +56,7 @@ func (c *PluginManagerClient) attachToPluginManager() error { // request the plugin raw, err := rpcClient.Dispense(pluginshared.PluginName) if err != nil { - log.Printf("[TRACE] failed to retreive to plugin manager from running plugin process: %s", err.Error()) + log.Printf("[TRACE] failed to retrieve to plugin manager from running plugin process: %s", err.Error()) return err } diff --git a/pkg/pluginmanager_service/grpc/start_failure.go b/pkg/pluginmanager_service/grpc/start_failure.go index c91f2bb859..cd7c0d0f8f 100644 --- a/pkg/pluginmanager_service/grpc/start_failure.go +++ b/pkg/pluginmanager_service/grpc/start_failure.go @@ -6,7 +6,7 @@ import ( "strings" ) -// HandleStartFailure is used to handle errors when starting both Steampipe plugins an dthe plugin manage +// HandleStartFailure is used to handle errors when starting both Steampipe plugins an the plugin manage // (which is itself a GRPC plugin) // // When starting a GRPC plugin, a specific handshake sequence is expected on stdout. diff --git a/pkg/pluginmanager_service/plugin_manager.go b/pkg/pluginmanager_service/plugin_manager.go index c6a6721ef4..a68b601b17 100644 --- a/pkg/pluginmanager_service/plugin_manager.go +++ b/pkg/pluginmanager_service/plugin_manager.go @@ -215,7 +215,7 @@ func (m *PluginManager) RefreshConnections(*pb.RefreshConnectionsRequest) (*pb.R resp := &pb.RefreshConnectionsResponse{} - log.Printf("[INFO] calling RefreshConnections asyncronously") + log.Printf("[INFO] calling RefreshConnections asynchronously") go m.doRefresh() return resp, nil diff --git a/pkg/pluginmanager_service/plugin_manager_rate_limiters.go b/pkg/pluginmanager_service/plugin_manager_rate_limiters.go index 7823c44dcc..8cbdee5ca0 100644 --- a/pkg/pluginmanager_service/plugin_manager_rate_limiters.go +++ b/pkg/pluginmanager_service/plugin_manager_rate_limiters.go @@ -50,7 +50,7 @@ func (m *PluginManager) refreshRateLimiterTable(ctx context.Context) error { return nil } - // update the status of the plugin rate limiters (determine which are overriden and set state accordingly) + // update the status of the plugin rate limiters (determine which are overridden and set state accordingly) m.updateRateLimiterStatus() queries := []db_common.QueryWithArgs{ @@ -160,7 +160,7 @@ func (m *PluginManager) updateRateLimiterStatus() { // get user limiters for this plugin userDefinedLimiters := m.getUserDefinedLimitersForPlugin(p) - // is there a user override? - if so set status to overriden + // is there a user override? - if so set status to overridden for name, pluginLimiter := range pluginDefinedLimiters { _, isOverriden := userDefinedLimiters[name] if isOverriden { diff --git a/pkg/query/init_data.go b/pkg/query/init_data.go index b7ff833731..ce3ae323cc 100644 --- a/pkg/query/init_data.go +++ b/pkg/query/init_data.go @@ -58,7 +58,7 @@ func (i *InitData) Cancel() { i.cancelInitialisation = nil } -// Cleanup overrides the initialisation.InitData.Cleanup to provide syncronisation with the loaded channel +// Cleanup overrides the initialisation.InitData.Cleanup to provide synchronisation with the loaded channel func (i *InitData) Cleanup(ctx context.Context) { // cancel any ongoing operation i.Cancel() diff --git a/pkg/snapshot/snapshot.go b/pkg/snapshot/snapshot.go index 6c876b77d1..3ab59ec4e8 100644 --- a/pkg/snapshot/snapshot.go +++ b/pkg/snapshot/snapshot.go @@ -191,7 +191,7 @@ func SnapshotToQueryResult[T queryresult.TimingContainer](snap *steampipeconfig. // start a goroutine to stream the results as rows go func() { for _, d := range chartRun.Data.Rows { - // we need to allocate a new slice everytime, since this gets read + // we need to allocate a new slice every time, since this gets read // asynchronously on the other end and we need to make sure that we don't overwrite // data already sent rowVals := make([]interface{}, len(chartRun.Data.Columns)) diff --git a/pkg/steampipeconfig/connection_updates.go b/pkg/steampipeconfig/connection_updates.go index b8c9242bf8..255c4b5354 100644 --- a/pkg/steampipeconfig/connection_updates.go +++ b/pkg/steampipeconfig/connection_updates.go @@ -257,7 +257,7 @@ func connectionRequiresUpdate(forceUpdateConnectionNames []string, name string, return res } - // determine whethe the plugin mod time has changed + // determine whether the plugin mod time has changed if currentConnectionState.pluginModTimeChanged(requiredConnectionState) { res.requiresUpdate = true res.pluginBinaryChanged = true @@ -326,7 +326,7 @@ func (u *ConnectionUpdates) populateConnectionPlugins(alreadyCreatedConnectionPl // - add connections which will be updated or have the comments updated // - exclude connections already created // - for any aggregator connections, instantiate the first child connection instead - // - if FetchRateLimitersForAllPlugins, start ALL plugins, using an abitrary exemplar connection if necessary + // - if FetchRateLimitersForAllPlugins, start ALL plugins, using an arbitrary exemplar connection if necessary connectionsToCreate := u.getConnectionsToCreate(alreadyCreatedConnectionPlugins) // now create them @@ -456,8 +456,7 @@ func (u *ConnectionUpdates) populateAggregators() { log.Printf("[INFO] found %d %s with aggregators", len(pluginAggregatorMap), utils.Pluralize("plugin", len(pluginAggregatorMap))) // for all updates/deletes, if there any aggregators of the same plugin type, update those as well - // build a map of all plugins with connecti - //ons being updated/deleted + // build a map of all plugins with connections being updated/deleted modifiedPluginLookup := make(map[string]struct{}) for _, c := range u.Update { modifiedPluginLookup[c.Plugin] = struct{}{} diff --git a/pkg/steampipeconfig/dependency_path.go b/pkg/steampipeconfig/dependency_path.go index c37bdc0efd..d3c3e957f1 100644 --- a/pkg/steampipeconfig/dependency_path.go +++ b/pkg/steampipeconfig/dependency_path.go @@ -22,7 +22,7 @@ func (k DependencyPathKey) GetParent() DependencyPathKey { return newDependencyPathKey(elements[:len(elements)-2]...) } -// how long is the depdency path +// how long is the dependency path func (k DependencyPathKey) PathLength() int { return len(strings.Split(string(k), pathSeparator)) } diff --git a/pkg/versionhelpers/constraints.go b/pkg/versionhelpers/constraints.go index aa33cb0265..b5e7155032 100644 --- a/pkg/versionhelpers/constraints.go +++ b/pkg/versionhelpers/constraints.go @@ -36,7 +36,7 @@ func (c Constraints) Equals(other *Constraints) bool { return c.Original == other.Original } -// IsPrerelease determines whether the constraint parses as a specifc version with prerelease or metadata set +// IsPrerelease determines whether the constraint parses as a specific version with prerelease or metadata set func (c Constraints) IsPrerelease() bool { v, err := semver.NewVersion(c.Original) if err != nil { diff --git a/tests/acceptance/test_data/mods/bad_mod_with_dep_mod_version_require_not_met/README.md b/tests/acceptance/test_data/mods/bad_mod_with_dep_mod_version_require_not_met/README.md index a0eef23858..72b539ec20 100644 --- a/tests/acceptance/test_data/mods/bad_mod_with_dep_mod_version_require_not_met/README.md +++ b/tests/acceptance/test_data/mods/bad_mod_with_dep_mod_version_require_not_met/README.md @@ -6,7 +6,7 @@ This mod is used to test that while running steampipe from the mod folder, the r ### Usage -This mod is used in the tests in `mod_require.bats` to simulate a scenario where mod installation would fail because of a dependant mod version requirement not being satisfied. +This mod is used in the tests in `mod_require.bats` to simulate a scenario where mod installation would fail because of a dependent mod version requirement not being satisfied. Trying to install the mod would result in an error: `Error: 1 dependency failed to install - no version of github.com/turbot/steampipe-mod-aws-compliance found satisfying version constraint: 99.21.0`. diff --git a/tests/acceptance/test_data/mods/functionality_test_mod/functionality/all_controls_ok.sp b/tests/acceptance/test_data/mods/functionality_test_mod/functionality/all_controls_ok.sp index 7c87e56470..0cf116cf45 100644 --- a/tests/acceptance/test_data/mods/functionality_test_mod/functionality/all_controls_ok.sp +++ b/tests/acceptance/test_data/mods/functionality_test_mod/functionality/all_controls_ok.sp @@ -1,5 +1,5 @@ benchmark "all_controls_ok" { - title = "All controls in OK, no ALARMS/ERORS" + title = "All controls in OK, no ALARMS/ERRORS" description = "Benchmark to verify the exit code when no controls are in error/alarm" children = [ control.ok_1, diff --git a/tests/acceptance/test_data/mods/functionality_test_mod/mod.sp b/tests/acceptance/test_data/mods/functionality_test_mod/mod.sp index cc01b07058..880c732431 100644 --- a/tests/acceptance/test_data/mods/functionality_test_mod/mod.sp +++ b/tests/acceptance/test_data/mods/functionality_test_mod/mod.sp @@ -1,4 +1,4 @@ mod "functionality_test_mod"{ title = "Functionality test mod" - description = "This is a simple mod used for testing different steampipe features and funtionalities." + description = "This is a simple mod used for testing different steampipe features and functionalities." } \ No newline at end of file diff --git a/tests/acceptance/test_data/mods/functionality_test_mod_pp/functionality/all_controls_ok.pp b/tests/acceptance/test_data/mods/functionality_test_mod_pp/functionality/all_controls_ok.pp index 7c87e56470..0cf116cf45 100644 --- a/tests/acceptance/test_data/mods/functionality_test_mod_pp/functionality/all_controls_ok.pp +++ b/tests/acceptance/test_data/mods/functionality_test_mod_pp/functionality/all_controls_ok.pp @@ -1,5 +1,5 @@ benchmark "all_controls_ok" { - title = "All controls in OK, no ALARMS/ERORS" + title = "All controls in OK, no ALARMS/ERRORS" description = "Benchmark to verify the exit code when no controls are in error/alarm" children = [ control.ok_1, diff --git a/tests/acceptance/test_data/mods/functionality_test_mod_pp/mod.pp b/tests/acceptance/test_data/mods/functionality_test_mod_pp/mod.pp index 134b3342c9..2ece184b5e 100644 --- a/tests/acceptance/test_data/mods/functionality_test_mod_pp/mod.pp +++ b/tests/acceptance/test_data/mods/functionality_test_mod_pp/mod.pp @@ -1,4 +1,4 @@ mod "functionality_test_mod_pp"{ title = "Functionality test mod with pp files" - description = "This is a simple mod used for testing different steampipe features and funtionalities." + description = "This is a simple mod used for testing different steampipe features and functionalities." } \ No newline at end of file diff --git a/tests/acceptance/test_data/mods/sample_workspace/cis_v130/section1.sp b/tests/acceptance/test_data/mods/sample_workspace/cis_v130/section1.sp index 7408c51dc9..1c3e09e1a1 100644 --- a/tests/acceptance/test_data/mods/sample_workspace/cis_v130/section1.sp +++ b/tests/acceptance/test_data/mods/sample_workspace/cis_v130/section1.sp @@ -186,7 +186,7 @@ control "cis_v130_1_10" { control "cis_v130_1_11" { title = "1.11 Do not setup access keys during initial user setup for all IAM users that have a console password" - description = "AWS console defaults to no check boxes selected when creating a new IAM user. When cerating the IAM User credentials you have to determine what type of access they require." + description = "AWS console defaults to no check boxes selected when creating a new IAM user. When creating the IAM User credentials you have to determine what type of access they require." sql = query.ok.sql #documentation = file("./cis_v130/docs/cis_v130_1_11.md") diff --git a/tests/acceptance/test_data/mods/test_workspace_mod_var_precedence_set_from_both_ppvars/README.md b/tests/acceptance/test_data/mods/test_workspace_mod_var_precedence_set_from_both_ppvars/README.md index 7ef26b6a52..1d776fc884 100644 --- a/tests/acceptance/test_data/mods/test_workspace_mod_var_precedence_set_from_both_ppvars/README.md +++ b/tests/acceptance/test_data/mods/test_workspace_mod_var_precedence_set_from_both_ppvars/README.md @@ -6,7 +6,7 @@ This mod is used to test variable resolution precedence in a mod by passing the ### Usage -This mod is used in the tests in `mod_vars.bats` to simulate a scenario where the version defined in the mod is picked from the --var command line argument over the steampipe.spvars and *.auto.spvars file and over the default value of variable 'version' set in the mod, because command line arguments have higher precendence. +This mod is used in the tests in `mod_vars.bats` to simulate a scenario where the version defined in the mod is picked from the --var command line argument over the steampipe.spvars and *.auto.spvars file and over the default value of variable 'version' set in the mod, because command line arguments have higher precedence. Steampipe loads variables in the following order, with later sources taking precedence over earlier ones: diff --git a/tests/acceptance/test_data/mods/test_workspace_mod_var_precedence_set_from_both_spvars/README.md b/tests/acceptance/test_data/mods/test_workspace_mod_var_precedence_set_from_both_spvars/README.md index 7ef26b6a52..1d776fc884 100644 --- a/tests/acceptance/test_data/mods/test_workspace_mod_var_precedence_set_from_both_spvars/README.md +++ b/tests/acceptance/test_data/mods/test_workspace_mod_var_precedence_set_from_both_spvars/README.md @@ -6,7 +6,7 @@ This mod is used to test variable resolution precedence in a mod by passing the ### Usage -This mod is used in the tests in `mod_vars.bats` to simulate a scenario where the version defined in the mod is picked from the --var command line argument over the steampipe.spvars and *.auto.spvars file and over the default value of variable 'version' set in the mod, because command line arguments have higher precendence. +This mod is used in the tests in `mod_vars.bats` to simulate a scenario where the version defined in the mod is picked from the --var command line argument over the steampipe.spvars and *.auto.spvars file and over the default value of variable 'version' set in the mod, because command line arguments have higher precedence. Steampipe loads variables in the following order, with later sources taking precedence over earlier ones: diff --git a/tests/acceptance/test_data/templates/expected_check_separator_csv.csv b/tests/acceptance/test_data/templates/expected_check_separator_csv.csv index fc0337ebfb..e008e78b9c 100644 --- a/tests/acceptance/test_data/templates/expected_check_separator_csv.csv +++ b/tests/acceptance/test_data/templates/expected_check_separator_csv.csv @@ -9,7 +9,7 @@ benchmark.cis_v130_1|1 Identity and Access Management||control.cis_v130_1_7|1.7 benchmark.cis_v130_1|1 Identity and Access Management||control.cis_v130_1_8|1.8 Ensure IAM password policy requires minimum length of 14 or greater|Password policies are, in part, used to enforce password complexity requirements. IAM password policies can be used to ensure password are at least a given length. It is recommended that the password policy require a minimum password length 14.|is totally secure and this is qa very very very very very long reason|resource name|ok|21323354377537|partition 30000|us-east-3|cis||16|v7.1|1.8||1|1|automated|v1.3.0|aws benchmark.cis_v130_1|1 Identity and Access Management||control.cis_v130_1_9|1.9 Ensure IAM password policy prevents password reuse|IAM password policies can prevent the reuse of a given password by the same user. It is recommended that the password policy prevent the reuse of passwords.|is totally secure and this is qa very very very very very long reason|resource name|ok|21323354377537|partition 30000|us-east-3|cis||4.4|v7.1|1.9||1|1|automated|v1.3.0|aws benchmark.cis_v130_1|1 Identity and Access Management||control.cis_v130_1_10|1.10 Ensure multi-factor authentication (MFA) is enabled for all IAM users that have a console password|Multi-Factor Authentication (MFA) adds an extra layer of authentication assurance beyond traditional credentials. With MFA enabled, when a user signs in to the AWS Console, they will be prompted for their user name and password as well as for an authentication code from their physical or virtual MFA token. It is recommended that MFA be enabled for all accounts that have a console password.|is totally secure and this is qa very very very very very long reason|resource name|ok|21323354377537|partition 30000|us-east-3|cis||4.5|v7.1|1.10||1|1|automated|v1.3.0|aws -benchmark.cis_v130_1|1 Identity and Access Management||control.cis_v130_1_11|1.11 Do not setup access keys during initial user setup for all IAM users that have a console password|AWS console defaults to no check boxes selected when creating a new IAM user. When cerating the IAM User credentials you have to determine what type of access they require.|is totally secure and this is qa very very very very very long reason|resource name|ok|21323354377537|partition 30000|us-east-3|cis||16|v7.1|1.11||1|1|manual|v1.3.0|aws +benchmark.cis_v130_1|1 Identity and Access Management||control.cis_v130_1_11|1.11 Do not setup access keys during initial user setup for all IAM users that have a console password|AWS console defaults to no check boxes selected when creating a new IAM user. When creating the IAM User credentials you have to determine what type of access they require.|is totally secure and this is qa very very very very very long reason|resource name|ok|21323354377537|partition 30000|us-east-3|cis||16|v7.1|1.11||1|1|manual|v1.3.0|aws benchmark.cis_v130_1|1 Identity and Access Management||control.cis_v130_1_12|1.12 Ensure credentials unused for 90 days or greater are disabled|AWS IAM users can access AWS resources using different types of credentials, such as passwords or access keys. It is recommended that all credentials that have been unused in 90 or greater days be deactivated or removed.|is totally secure and this is qa very very very very very long reason|resource name|ok|21323354377537|partition 30000|us-east-3|cis||16.9|v7.1|1.12||1|1|automated|v1.3.0|aws benchmark.cis_v130_1|1 Identity and Access Management||control.cis_v130_1_13|1.13 Ensure there is only one active access key available for any single IAM user|Access keys are long-term credentials for an IAM user or the AWS account root user. You can use access keys to sign programmatic requests to the AWS CLI or AWS API. One of the best ways to protect your account is to not allow users to have multiple access keys.|is totally secure and this is qa very very very very very long reason|resource name|ok|21323354377537|partition 30000|us-east-3|cis||4|v7.1|1.13||1|1|automated|v1.3.0|aws benchmark.cis_v130_1|1 Identity and Access Management||control.cis_v130_1_14|1.14 Ensure access keys are rotated every 90 days or less|Access keys consist of an access key ID and secret access key, which are used to sign programmatic requests that you make to AWS. AWS users need their own access keys to make programmatic calls to AWS from the AWS Command Line Interface (AWS CLI), Tools for Windows PowerShell, the AWS SDKs, or direct HTTP calls using the APIs for individual AWS services. It is recommended that all access keys be regularly rotated.|is totally secure and this is qa very very very very very long reason|resource name|ok|21323354377537|partition 30000|us-east-3|cis||16|v7.1|1.14||1|1|automated|v1.3.0|aws diff --git a/tests/acceptance/test_files/plugin.bats b/tests/acceptance/test_files/plugin.bats index a33e34529c..28780d48e8 100644 --- a/tests/acceptance/test_files/plugin.bats +++ b/tests/acceptance/test_files/plugin.bats @@ -153,7 +153,7 @@ load "$LIB_BATS_SUPPORT/load.bash" copy_install_directory steampipe plugin install hackernews@0.8.0 bitbucket@0.7.1 --progress=false --install-dir $MY_TEST_COPY - # remove the contents of a plugin execuatable to simulate the failed plugin scenario + # remove the contents of a plugin executable to simulate the failed plugin scenario cat /dev/null > $MY_TEST_COPY/plugins/hub.steampipe.io/plugins/turbot/hackernews@0.8.0/steampipe-plugin-hackernews.plugin # check table output diff --git a/tests/manual_testing/args/with1/dashboard.sp b/tests/manual_testing/args/with1/dashboard.sp index a39f45e94a..d4eb9e2eb2 100644 --- a/tests/manual_testing/args/with1/dashboard.sp +++ b/tests/manual_testing/args/with1/dashboard.sp @@ -31,7 +31,7 @@ dashboard "bug_column_does_not_exist" { EOQ param policy_arn { - // commented out becuase input not working here yet.. + // commented out because input not working here yet.. // default = self.input.policy_arn.value default = "arn:aws:iam::aws:policy/AdministratorAccess" } diff --git a/tests/manual_testing/dashboard_container_inputs/inputs.sp b/tests/manual_testing/dashboard_container_inputs/inputs.sp index b31d83604f..f8ea7d9efb 100644 --- a/tests/manual_testing/dashboard_container_inputs/inputs.sp +++ b/tests/manual_testing/dashboard_container_inputs/inputs.sp @@ -59,7 +59,7 @@ dashboard "inputs" { title = "Inputs Test" text { - value = "dasboard input" + value = "dashboard input" } input "region" { sql = query.aws_region_input.sql