From 5cc1f73abc14597d3efe796a4dac6e58f142791e Mon Sep 17 00:00:00 2001 From: Nick Josevski Date: Fri, 14 Aug 2026 15:56:29 +1000 Subject: [PATCH] chore: fix spelling across comments, identifiers and query tags Rebases the corrections from #204 onto main. Three are behavioural rather than cosmetic: the events query sent "interal" so the Internal filter never reached the server, ManualInterverventionApprove gains a correctly spelled name while the misspelling stays as a deprecated alias, and uritemplates.parseTerm's error text changes from "modifers" to "modifiers". The parseTerm message is observable to anyone matching on that string, so it is called out for release notes even though it is an internal parse error. Co-Authored-By: Josh Soref <2119212+jsoref@users.noreply.github.com> Co-Authored-By: Claude Opus 5 (1M context) --- .gitignore | 3 +++ api/spec.json | 8 ++++---- pkg/accounts/accounts.go | 4 ++-- pkg/accounts/ssh_key_account.go | 2 +- pkg/credentials/resource_test.go | 6 +++--- pkg/environments/environment_service.go | 2 +- pkg/events/events_query.go | 2 +- pkg/interruptions/interruption.go | 5 ++++- pkg/machines/ssh_endpoint.go | 4 ++-- pkg/newclient/httpsession.go | 2 +- pkg/resources/resources.go | 4 ++-- pkg/variables/script_module_service.go | 4 ++-- test/e2e/interruption_test.go | 10 +++++----- test/testutil.go | 2 +- tests/Create-ApiKey.ps1 | 2 +- uritemplates/uritemplates.go | 2 +- 16 files changed, 34 insertions(+), 28 deletions(-) diff --git a/.gitignore b/.gitignore index 9240b12c..6ab1a565 100644 --- a/.gitignore +++ b/.gitignore @@ -25,3 +25,6 @@ vendor .env go-octopusdeploy + +# macOS +.DS_Store diff --git a/api/spec.json b/api/spec.json index d38717b0..0955f575 100644 --- a/api/spec.json +++ b/api/spec.json @@ -461,7 +461,7 @@ "enum": [ "Success", "ManualMergeRequired", - "DefaultParamterValueMissing", + "DefaultParameterValueMissing", "RemovedPackageInUse" ], "type": "string" @@ -2556,7 +2556,7 @@ } } }, - "DeploymentPromomotionTenant": { + "DeploymentPromotionTenant": { "type": "object", "properties": { "Id": { @@ -3037,7 +3037,7 @@ "TenantPromotions": { "type": "array", "items": { - "$ref": "#/definitions/DeploymentPromomotionTenant" + "$ref": "#/definitions/DeploymentPromotionTenant" } } } @@ -8127,7 +8127,7 @@ "TenantPromotions": { "type": "array", "items": { - "$ref": "#/definitions/DeploymentPromomotionTenant" + "$ref": "#/definitions/DeploymentPromotionTenant" } } } diff --git a/pkg/accounts/accounts.go b/pkg/accounts/accounts.go index dc665150..82d6abea 100644 --- a/pkg/accounts/accounts.go +++ b/pkg/accounts/accounts.go @@ -148,7 +148,7 @@ func (a *Accounts) UnmarshalJSON(b []byte) error { return nil } -// GetNextPage retrives the next page from the links collection. If no next page +// GetNextPage retrieves the next page from the links collection. If no next page // exists it will return nill func (r *Accounts) GetNextPage(client *sling.Sling) (*Accounts, error) { if r.Links.PageNext == "" { @@ -161,7 +161,7 @@ func (r *Accounts) GetNextPage(client *sling.Sling) (*Accounts, error) { return ToAccounts(response.(*resources.Resources[*AccountResource])), nil } -// GetAllPages will retrive all remaining next pages in the link collection +// GetAllPages will retrieve all remaining next pages in the link collection // and return the result as list of concatenated Items; Including the items // from the base Resource. func (r *Accounts) GetAllPages(client *sling.Sling) ([]IAccount, error) { diff --git a/pkg/accounts/ssh_key_account.go b/pkg/accounts/ssh_key_account.go index 26295ecf..d9ac871b 100644 --- a/pkg/accounts/ssh_key_account.go +++ b/pkg/accounts/ssh_key_account.go @@ -54,7 +54,7 @@ func NewSSHKeyAccount(name string, username string, privateKeyFile *core.Sensiti return &account, nil } -// SetPrivateKeyPassphrase sets the private key [assphrase of this SSH key pair account. +// SetPrivateKeyPassphrase sets the private key passphrase of this SSH key pair account. func (s *SSHKeyAccount) SetPrivateKeyPassphrase(privateKeyPassphrase *core.SensitiveValue) { s.PrivateKeyPassphrase = privateKeyPassphrase } diff --git a/pkg/credentials/resource_test.go b/pkg/credentials/resource_test.go index 853db535..a8e38659 100644 --- a/pkg/credentials/resource_test.go +++ b/pkg/credentials/resource_test.go @@ -75,9 +75,9 @@ func TestResourceWithAnonymousAsJSON(t *testing.T) { require.NoError(t, err) require.NotNil(t, restrictionsAsJSON) - anonymousdAsJSON, err := json.Marshal(anonymous) + anonymousAsJSON, err := json.Marshal(anonymous) require.NoError(t, err) - require.NotNil(t, anonymousdAsJSON) + require.NotNil(t, anonymousAsJSON) resource := credentials.NewResource(name, anonymous) resource.Description = description @@ -94,7 +94,7 @@ func TestResourceWithAnonymousAsJSON(t *testing.T) { "Links": { "Self": "%s" } - }`, description, anonymousdAsJSON, restrictionsAsJSON, id, name, selfLink) + }`, description, anonymousAsJSON, restrictionsAsJSON, id, name, selfLink) resourceAsJSON, err := json.Marshal(resource) require.NoError(t, err) diff --git a/pkg/environments/environment_service.go b/pkg/environments/environment_service.go index eccad991..69128bc5 100644 --- a/pkg/environments/environment_service.go +++ b/pkg/environments/environment_service.go @@ -134,7 +134,7 @@ func (s *EnvironmentService) GetByName(name string) ([]*Environment, error) { return services.GetPagedResponse[Environment](s, path) } -// GetByPartialName performs a lookup and returns enironments with a matching +// GetByPartialName performs a lookup and returns environments with a matching // partial name. func (s *EnvironmentService) GetByPartialName(partialName string) ([]*Environment, error) { if internal.IsEmpty(partialName) { diff --git a/pkg/events/events_query.go b/pkg/events/events_query.go index e10eb644..7c4b40d4 100644 --- a/pkg/events/events_query.go +++ b/pkg/events/events_query.go @@ -12,7 +12,7 @@ type EventsQuery struct { FromAutoID string `uri:"fromAutoId,omitempty" url:"fromAutoId,omitempty"` IDs []string `uri:"ids,omitempty" url:"ids,omitempty"` IncludeSystem bool `uri:"includeSystem,omitempty" url:"includeSystem,omitempty"` - Internal string `uri:"interal,omitempty" url:"interal,omitempty"` + Internal string `uri:"internal,omitempty" url:"internal,omitempty"` Name string `uri:"name,omitempty" url:"name,omitempty"` PartialName string `uri:"partialName,omitempty" url:"partialName,omitempty"` ProjectGroups []string `uri:"projectGroups,omitempty" url:"projectGroups,omitempty"` diff --git a/pkg/interruptions/interruption.go b/pkg/interruptions/interruption.go index 690ccd15..9061fb86 100644 --- a/pkg/interruptions/interruption.go +++ b/pkg/interruptions/interruption.go @@ -30,5 +30,8 @@ func NewInterruption() *Interruption { } } -const ManualInterverventionApprove = "Proceed" +const ManualInterventionApprove = "Proceed" const ManualInterventionDecline = "Abort" + +// Deprecated: use ManualInterventionApprove. +const ManualInterverventionApprove = ManualInterventionApprove diff --git a/pkg/machines/ssh_endpoint.go b/pkg/machines/ssh_endpoint.go index b23a7238..eb547065 100644 --- a/pkg/machines/ssh_endpoint.go +++ b/pkg/machines/ssh_endpoint.go @@ -75,7 +75,7 @@ func (s *SSHEndpoint) GetProxyID() string { func (s *SSHEndpoint) MarshalJSON() ([]byte, error) { sshEndpoint := struct { AccountID string `json:"AccountId,omitempty"` - ComunicationStyle string `json:"CommunicationStyle" validate:"required,eq=Ssh"` + CommunicationStyle string `json:"CommunicationStyle" validate:"required,eq=Ssh"` DotNetCorePlatform string Fingerprint string Host string @@ -85,7 +85,7 @@ func (s *SSHEndpoint) MarshalJSON() ([]byte, error) { resources.Resource }{ AccountID: s.AccountID, - ComunicationStyle: s.CommunicationStyle, + CommunicationStyle: s.CommunicationStyle, DotNetCorePlatform: s.DotNetCorePlatform, Fingerprint: s.Fingerprint, Host: s.Host, diff --git a/pkg/newclient/httpsession.go b/pkg/newclient/httpsession.go index fdfc4890..b1946e5b 100644 --- a/pkg/newclient/httpsession.go +++ b/pkg/newclient/httpsession.go @@ -87,7 +87,7 @@ func (h *HttpSession) DoRawJsonRequest(req *http.Request, requestBody any, outpu if resp.StatusCode == http.StatusNoContent || resp.ContentLength == 0 { // TODO the ContentLength check is copied from Sling, but it's valid for servers to stream responses // without a known content length. This won't handle such responses, which would be a bug. The octopus server tends not - // to do this, so we can defer a fix until it becomes neccessary + // to do this, so we can defer a fix until it becomes necessary return resp, nil } diff --git a/pkg/resources/resources.go b/pkg/resources/resources.go index 6757530b..07bb1ff4 100644 --- a/pkg/resources/resources.go +++ b/pkg/resources/resources.go @@ -15,7 +15,7 @@ type Resources[T any] struct { PagedResults } -// GetNextPage retrives the next page from the links collection. If no next page +// GetNextPage retrieves the next page from the links collection. If no next page // exists it will return nill func (r *Resources[T]) GetNextPage(client *sling.Sling) (*Resources[T], error) { if r.Links.PageNext == "" { @@ -28,7 +28,7 @@ func (r *Resources[T]) GetNextPage(client *sling.Sling) (*Resources[T], error) { return response.(*Resources[T]), nil } -// GetAllPages will retrive all remaining next pages in the link collection +// GetAllPages will retrieve all remaining next pages in the link collection // and return the result as list of concatenated Items; Including the items // from the base Resource. func (r *Resources[T]) GetAllPages(client *sling.Sling) ([]T, error) { diff --git a/pkg/variables/script_module_service.go b/pkg/variables/script_module_service.go index a3151aa5..b795e556 100644 --- a/pkg/variables/script_module_service.go +++ b/pkg/variables/script_module_service.go @@ -210,8 +210,8 @@ func (s *ScriptModuleService) Update(scriptModule *ScriptModule) (*ScriptModule, return nil, err } - updatedVriableSet := updatedVariablesResponse.(*VariableSet) - for _, variable := range updatedVriableSet.Variables { + updatedVariableSet := updatedVariablesResponse.(*VariableSet) + for _, variable := range updatedVariableSet.Variables { if strings.HasPrefix(variable.Name, "Octopus.Script.Module[") { scriptModuleResponse.ScriptBody = variable.Value } diff --git a/test/e2e/interruption_test.go b/test/e2e/interruption_test.go index ea66dada..32d359c5 100644 --- a/test/e2e/interruption_test.go +++ b/test/e2e/interruption_test.go @@ -58,7 +58,7 @@ package e2e // require.NoError(t, err) // require.NotNil(t, client) -// interruption, err := getInterruptonFromJSON(interruptionJSON) +// interruption, err := getInterruptionFromJSON(interruptionJSON) // require.NoError(t, err) // require.NotNil(t, interruption) @@ -76,7 +76,7 @@ package e2e // require.NoError(t, err) // require.NotNil(t, client) -// interruption, err := getInterruptonFromJSON(interruptionJSON) +// interruption, err := getInterruptionFromJSON(interruptionJSON) // require.NoError(t, err) // require.NotNil(t, interruption) @@ -95,14 +95,14 @@ package e2e // require.NoError(t, err) // require.NotNil(t, client) -// interruption, err := getInterruptonFromJSON(interruptionJSON) +// interruption, err := getInterruptionFromJSON(interruptionJSON) // require.NoError(t, err) // require.NotNil(t, interruption) // submitRequest := interruptions.InterruptionSubmitRequest{ // Instructions: "Approve The Deployment", // Notes: "", -// Result: interruptions.ManualInterverventionApprove, +// Result: interruptions.ManualInterventionApprove, // } // i, err := client.Interruptions.Submit(interruption, &submitRequest) @@ -298,7 +298,7 @@ package e2e // } // ` -// func getInterruptonFromJSON(interruptionJSON string) (*interruptions.Interruption, error) { +// func getInterruptionFromJSON(interruptionJSON string) (*interruptions.Interruption, error) { // var interruption interruptions.Interruption // err := json.Unmarshal([]byte(interruptionJSON), &interruption) // return &interruption, err diff --git a/test/testutil.go b/test/testutil.go index 20b267de..f4eda2a6 100644 --- a/test/testutil.go +++ b/test/testutil.go @@ -52,7 +52,7 @@ type MockHttpServer struct { Response chan responseOrError // so test code can detect unanswered requests or responses at the end. - // Not strictly neccessary as unanswered req/resp results in a channel deadlock + // Not strictly necessary as unanswered req/resp results in a channel deadlock // and go panics and kills the process, so we find out about it, but this is a bit // less confusing to troubleshoot pendingMsgCount int32 diff --git a/tests/Create-ApiKey.ps1 b/tests/Create-ApiKey.ps1 index 2fe6edd4..22f1132d 100644 --- a/tests/Create-ApiKey.ps1 +++ b/tests/Create-ApiKey.ps1 @@ -10,7 +10,7 @@ $LoginObj = New-Object Octopus.Client.Model.LoginCommand $LoginObj.Username = "admin" $LoginObj.Password = "Password01!" -#Loging in to Octopus +#Logging in to Octopus $repository.Users.SignIn($LoginObj) #Getting current user logged in diff --git a/uritemplates/uritemplates.go b/uritemplates/uritemplates.go index b9a12f3e..890806bb 100644 --- a/uritemplates/uritemplates.go +++ b/uritemplates/uritemplates.go @@ -185,7 +185,7 @@ func parseTerm(term string) (result templateTerm, err error) { err = errors.New("not a valid name: " + result.name) } if result.explode && result.truncate > 0 { - err = errors.New("both explode and prefix modifers on same term") + err = errors.New("both explode and prefix modifiers on same term") } return result, err }