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

chore: Spelling #204

Open
wants to merge 15 commits into
base: main
Choose a base branch
from
8 changes: 4 additions & 4 deletions api/spec.json
Copy link
Author

Choose a reason for hiding this comment

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

The changes probably can't be made, but they're unfortunate, and I'm using this PR to call them out...

Choose a reason for hiding this comment

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

This device is being used by a 9 yr old kid right now. I don't want to be mistreated again as what happened before.
No cla signet yet.

Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@
"enum": [
"Success",
"ManualMergeRequired",
"DefaultParamterValueMissing",
"DefaultParameterValueMissing",
"RemovedPackageInUse"
],
"type": "string"
Expand Down Expand Up @@ -2551,7 +2551,7 @@
}
}
},
"DeploymentPromomotionTenant": {
"DeploymentPromotionTenant": {
"type": "object",
"properties": {
"Id": {
Expand Down Expand Up @@ -3032,7 +3032,7 @@
"TenantPromotions": {
"type": "array",
"items": {
"$ref": "#/definitions/DeploymentPromomotionTenant"
"$ref": "#/definitions/DeploymentPromotionTenant"
}
}
}
Expand Down Expand Up @@ -8122,7 +8122,7 @@
"TenantPromotions": {
"type": "array",
"items": {
"$ref": "#/definitions/DeploymentPromomotionTenant"
"$ref": "#/definitions/DeploymentPromotionTenant"
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/accounts/accounts.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,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 == "" {
Expand All @@ -140,7 +140,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) {
Expand Down
2 changes: 1 addition & 1 deletion pkg/accounts/ssh_key_account.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Copy link
Author

Choose a reason for hiding this comment

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

this was amusing

func (s *SSHKeyAccount) SetPrivateKeyPassphrase(privateKeyPassphrase *core.SensitiveValue) {
s.PrivateKeyPassphrase = privateKeyPassphrase
}
Expand Down
6 changes: 3 additions & 3 deletions pkg/credentials/resource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ func TestResourceWithAnonymousAsJSON(t *testing.T) {
name := internal.GetRandomName()
selfLink := internal.GetRandomName()

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
Expand All @@ -72,7 +72,7 @@ func TestResourceWithAnonymousAsJSON(t *testing.T) {
"Links": {
"Self": "%s"
}
}`, description, anonymousdAsJSON, id, name, selfLink)
}`, description, anonymousAsJSON, id, name, selfLink)

resourceAsJSON, err := json.Marshal(resource)
require.NoError(t, err)
Expand Down
2 changes: 1 addition & 1 deletion pkg/environments/environment_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,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) {
Expand Down
2 changes: 1 addition & 1 deletion pkg/events/events_query.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Copy link
Author

Choose a reason for hiding this comment

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

Changes like this are scary, as it's an API of sorts...

Name string `uri:"name,omitempty" url:"name,omitempty"`
PartialName string `uri:"partialName,omitempty" url:"partialName,omitempty"`
ProjectGroups []string `uri:"projectGroups,omitempty" url:"projectGroups,omitempty"`
Expand Down
2 changes: 1 addition & 1 deletion pkg/interruptions/interruption.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@ func NewInterruption() *Interruption {
}
}

const ManualInterverventionApprove = "Proceed"
const ManualInterventionApprove = "Proceed"
Copy link
Author

Choose a reason for hiding this comment

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

This is probably an API of sorts and thus probably can't be done either.

const ManualInterventionDecline = "Abort"
4 changes: 2 additions & 2 deletions pkg/machines/duration_formatter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ func TestToTimeSpan(t *testing.T) {
halfSecond, _ := time.ParseDuration("0.5s")
second, _ := time.ParseDuration("1111ms")
twoHours, _ := time.ParseDuration("120m")
fourtySevenHours, _ := time.ParseDuration("47h")
fortySevenHours, _ := time.ParseDuration("47h")
twoDays, _ := time.ParseDuration("48h")
t.Logf("500ms: %s", ToTimeSpan(halfSecond))
t.Logf("1000ms: %s", ToTimeSpan(second))
t.Logf("1s: %s", ToTimeSpan(time.Second))
t.Logf("1m: %s", ToTimeSpan(time.Minute))
t.Logf("1h: %s", ToTimeSpan(time.Hour))
t.Logf("120m: %s", ToTimeSpan(twoHours))
t.Logf("47h: %s", ToTimeSpan(fourtySevenHours))
t.Logf("47h: %s", ToTimeSpan(fortySevenHours))
t.Logf("48h: %s", ToTimeSpan(twoDays))
}

Expand Down
4 changes: 2 additions & 2 deletions pkg/machines/ssh_endpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Copy link
Author

Choose a reason for hiding this comment

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

This could be an API too...

DotNetCorePlatform string
Fingerprint string
Host string
Expand All @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion pkg/newclient/httpsession.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,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
}

Expand Down
4 changes: 2 additions & 2 deletions pkg/resources/resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 == "" {
Expand All @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions pkg/variables/script_module_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,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
}
Expand Down
10 changes: 5 additions & 5 deletions test/e2e/interruption_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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)

Expand All @@ -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)
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion test/testutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/Create-ApiKey.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion uritemplates/uritemplates.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Copy link
Author

Choose a reason for hiding this comment

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

I'm hoping nothing cares about the spelling of error messages.

}
return result, err
}
Expand Down