Skip to content

Commit

Permalink
fix: more typos (#1793)
Browse files Browse the repository at this point in the history
Signed-off-by: David Calvert <[email protected]>
  • Loading branch information
dotdc authored Nov 6, 2024
1 parent 02d7d27 commit 32dd1fd
Show file tree
Hide file tree
Showing 40 changed files with 81 additions and 81 deletions.
24 changes: 12 additions & 12 deletions backend/controllers/github.go
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ func handleInstallationDeletedEvent(installation *github.InstallationEvent) erro
func handlePullRequestEvent(gh utils.GithubClientProvider, payload *github.PullRequestEvent, ciBackendProvider ci_backends.CiBackendProvider) error {
appId, err := strconv.ParseInt(os.Getenv("GITHUB_APP_ID"), 10, 64)
if err != nil {
log.Printf("error getting github app isntallation id: %v", err)
log.Printf("error getting github app installation id: %v", err)
return fmt.Errorf("error getting github app installation id")
}

Expand Down Expand Up @@ -359,9 +359,9 @@ func handlePullRequestEvent(gh utils.GithubClientProvider, payload *github.PullR
if action == "closed" {
branchName, _, err := ghService.GetBranchName(prNumber)
if err != nil {
utils.InitCommentReporter(ghService, prNumber, fmt.Sprintf(":x: Could not retrive PR details, error: %v", err))
log.Printf("Could not retrive PR details error: %v", err)
return fmt.Errorf("Could not retrive PR details: %v", err)
utils.InitCommentReporter(ghService, prNumber, fmt.Sprintf(":x: Could not retrieve PR details, error: %v", err))
log.Printf("Could not retrieve PR details error: %v", err)
return fmt.Errorf("Could not retrieve PR details: %v", err)
}
branchExists, err := ghService.CheckBranchExists(branchName)
if err != nil {
Expand Down Expand Up @@ -409,7 +409,7 @@ func handlePullRequestEvent(gh utils.GithubClientProvider, payload *github.PullR
if err != nil {
log.Printf("could not determine digger command from job: %v", jobsForImpactedProjects[0].Commands)
utils.InitCommentReporter(ghService, prNumber, fmt.Sprintf(":x: could not determine digger command from job: %v", err))
return fmt.Errorf("unkown digger command in comment %v", err)
return fmt.Errorf("unknown digger command in comment %v", err)
}

if *diggerCommand == orchestrator_scheduler.DiggerCommandNoop {
Expand Down Expand Up @@ -541,7 +541,7 @@ func handlePullRequestEvent(gh utils.GithubClientProvider, payload *github.PullR
if err != nil {
log.Printf("TriggerDiggerJobs error: %v", err)
utils.InitCommentReporter(ghService, prNumber, fmt.Sprintf(":x: TriggerDiggerJobs error: %v", err))
return fmt.Errorf("error triggerring Digger Jobs")
return fmt.Errorf("error triggering Digger Jobs")
}

return nil
Expand Down Expand Up @@ -639,7 +639,7 @@ func getBatchType(jobs []orchestrator_scheduler.Job) orchestrator_scheduler.Digg
func handleIssueCommentEvent(gh utils.GithubClientProvider, payload *github.IssueCommentEvent, ciBackendProvider ci_backends.CiBackendProvider) error {
appId, err := strconv.ParseInt(os.Getenv("GITHUB_APP_ID"), 10, 64)
if err != nil {
log.Printf("error getting github app isntallation id: %v", err)
log.Printf("error getting github app installation id: %v", err)
return fmt.Errorf("error getting github app installation id")
}

Expand Down Expand Up @@ -709,9 +709,9 @@ func handleIssueCommentEvent(gh utils.GithubClientProvider, payload *github.Issu

diggerCommand, err := orchestrator_scheduler.GetCommandFromComment(*payload.Comment.Body)
if err != nil {
log.Printf("unkown digger command in comment: %v", *payload.Comment.Body)
log.Printf("unknown digger command in comment: %v", *payload.Comment.Body)
utils.InitCommentReporter(ghService, issueNumber, fmt.Sprintf(":x: Could not recognise comment, error: %v", err))
return fmt.Errorf("unkown digger command in comment %v", err)
return fmt.Errorf("unknown digger command in comment %v", err)
}

prBranchName, _, err := ghService.GetBranchName(issueNumber)
Expand Down Expand Up @@ -860,7 +860,7 @@ func handleIssueCommentEvent(gh utils.GithubClientProvider, payload *github.Issu
if err != nil {
log.Printf("TriggerDiggerJobs error: %v", err)
utils.InitCommentReporter(ghService, issueNumber, fmt.Sprintf(":x: TriggerDiggerJobs error: %v", err))
return fmt.Errorf("error triggerring Digger Jobs")
return fmt.Errorf("error triggering Digger Jobs")
}
return nil
}
Expand Down Expand Up @@ -1028,7 +1028,7 @@ func (d DiggerController) GithubAppCallbackPage(c *gin.Context) {

// TODO: Lookup org in GithubAppInstallation by installationID if found use that installationID otherwise
// create a new org for this installationID
// retrive org for current orgID
// retrieve org for current orgID
installationIdInt64, err := strconv.ParseInt(installationId, 10, 64)
if err != nil {
log.Printf("strconv.ParseInt error: %v", err)
Expand Down Expand Up @@ -1075,7 +1075,7 @@ func (d DiggerController) GithubAppCallbackPage(c *gin.Context) {

client, _, err := d.GithubClientProvider.Get(*installation.AppID, installationId64)
if err != nil {
log.Printf("Error retriving github client: %v", err)
log.Printf("Error retrieving github client: %v", err)
c.JSON(http.StatusInternalServerError, gin.H{"error": "Error fetching organisation"})
return

Expand Down
2 changes: 1 addition & 1 deletion backend/models/runs.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ func (r *DiggerRun) MapToJsonStruct() (interface{}, error) {
func (r DiggerRunStage) MapToJsonStruct() (*SerializedRunStage, error) {
job, err := DB.GetDiggerJobFromRunStage(r)
if err != nil {
log.Printf("Could not retrive job from run")
log.Printf("Could not retrieve job from run")
return nil, err
}

Expand Down
2 changes: 1 addition & 1 deletion backend/models/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -1194,7 +1194,7 @@ func (db *Database) UpdateRepoDiggerConfig(orgId any, config configuration.Digge
projectName := dc.Name
p, err := db.GetProjectByName(orgId, repo, projectName)
if err != nil {
return fmt.Errorf("error retriving project by name: %v", err)
return fmt.Errorf("error retrieving project by name: %v", err)
}
if p == nil {
_, err := db.CreateProject(projectName, org, repo, dc.Generated, isMainBranch)
Expand Down
2 changes: 1 addition & 1 deletion backend/utils/github.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ func SetPRStatusForJobs(prService ci.PullRequestService, prNumber int, jobs []sc
err = prService.SetStatus(prNumber, "pending", job.ProjectName+"/apply")
}
if err != nil {
log.Printf("Erorr setting status: %v", err)
log.Printf("Error setting status: %v", err)
return fmt.Errorf("Error setting pr status: %v", err)
}
}
Expand Down
2 changes: 1 addition & 1 deletion backend/utils/graphs.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func ConvertJobsToDiggerJobs(jobType scheduler.DiggerCommand, vcsType models.Dig
organisation, err := models.DB.GetOrganisationById(organisationId)
if err != nil {
log.Printf("Error getting organisation: %v %v", organisationId, err)
return nil, nil, fmt.Errorf("error retriving organisation")
return nil, nil, fmt.Errorf("error retrieving organisation")
}
organisationName := organisation.Name

Expand Down
2 changes: 1 addition & 1 deletion cli/cmd/digger/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ func main() {
os.Args = append([]string{os.Args[0]}, "default")
}
if err := rootCmd.Execute(); err != nil {
usage.ReportErrorAndExit("", fmt.Sprintf("Error occured during command exec: %v", err), 8)
usage.ReportErrorAndExit("", fmt.Sprintf("Error occurred during command exec: %v", err), 8)
}

}
Expand Down
2 changes: 1 addition & 1 deletion cli/pkg/digger/digger.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ func RunJobs(jobs []orchestrator.Job, prService ci.PullRequestService, orgServic
}
err = UpdateAggregateStatus(batchResult, prService)
if err != nil {
log.Printf("error udpating aggregate status check: %v.\n", err)
log.Printf("error updating aggregate status check: %v.\n", err)
return false, false, err
}

Expand Down
10 changes: 5 additions & 5 deletions cli/pkg/github/github.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
"strings"
)

func GitHubCI(lock core_locking.Lock, policyCheckerProvider core_policy.PolicyCheckerProvider, backendApi core_backend.Api, reportingStrategy reporting.ReportStrategy, githubServiceProvider dg_github.GithubServiceProvider, commentUpdaterProvider comment_updater.CommentUpdaterProvider, driftNotifcationProvider drift.DriftNotificationProvider) {
func GitHubCI(lock core_locking.Lock, policyCheckerProvider core_policy.PolicyCheckerProvider, backendApi core_backend.Api, reportingStrategy reporting.ReportStrategy, githubServiceProvider dg_github.GithubServiceProvider, commentUpdaterProvider comment_updater.CommentUpdaterProvider, driftNotificationProvider drift.DriftNotificationProvider) {
log.Printf("Using GitHub.\n")
githubActor := os.Getenv("GITHUB_ACTOR")
if githubActor != "" {
Expand All @@ -34,7 +34,7 @@ func GitHubCI(lock core_locking.Lock, policyCheckerProvider core_policy.PolicyCh
usage.SendUsageRecord("", "log", "non github initialisation")
}

// default policy checker for backwards compatability, will be overriden in orchestrator flow
// default policy checker for backwards compatibility, will be overridden in orchestrator flow
hostName := os.Getenv("DIGGER_HOSTNAME")
token := os.Getenv("DIGGER_TOKEN")
orgName := os.Getenv("DIGGER_ORGANISATION")
Expand Down Expand Up @@ -194,7 +194,7 @@ func GitHubCI(lock core_locking.Lock, policyCheckerProvider core_policy.PolicyCh
CommandEnvProvider: CommandEnvProvider,
}

notification, err := driftNotifcationProvider.Get(githubPrService)
notification, err := driftNotificationProvider.Get(githubPrService)
if err != nil {
usage.ReportErrorAndExit(githubActor, fmt.Sprintf("could not get drift notification type: %v", err), 8)
}
Expand Down Expand Up @@ -241,7 +241,7 @@ func GitHubCI(lock core_locking.Lock, policyCheckerProvider core_policy.PolicyCh
prBranchName, _, err := githubPrService.GetBranchName(*commentEvent.Issue.Number)

if err != nil {
usage.ReportErrorAndExit(githubActor, fmt.Sprintf("Error while retriving default branch from Issue: %v", err), 6)
usage.ReportErrorAndExit(githubActor, fmt.Sprintf("Error while retrieving default branch from Issue: %v", err), 6)
}
defaultBranch := *commentEvent.Repo.DefaultBranch
repoFullName := *commentEvent.Repo.FullName
Expand Down Expand Up @@ -294,7 +294,7 @@ func GitHubCI(lock core_locking.Lock, policyCheckerProvider core_policy.PolicyCh
}

if allAppliesSuccessful {
// aggreate status checks: success
// aggregate status checks: success
if scheduler.IsPlanJobs(jobs) {
githubPrService.SetStatus(prNumber, "success", "digger/plan")
} else {
Expand Down
6 changes: 3 additions & 3 deletions dgctl/cmd/exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,15 +161,15 @@ func GetWorkflowIdAndUrlFromDiggerJobId(client *github.Client, repoOwner string,

func cleanupDiggerOutput(output string) string {

startingDelimeter := "<========= DIGGER RUNNING IN MANUAL MODE =========>"
startingDelimiter := "<========= DIGGER RUNNING IN MANUAL MODE =========>"
endingDelimiter := "<========= DIGGER COMPLETED =========>"

startPos := 0
endPos := len(output)
// removes output of terraform -version command that terraform-exec executes on every run
i := strings.Index(output, startingDelimeter)
i := strings.Index(output, startingDelimiter)
if i != -1 {
startPos = i + len(startingDelimeter)
startPos = i + len(startingDelimiter)
}

e := strings.Index(output, endingDelimiter)
Expand Down
2 changes: 1 addition & 1 deletion docs/ce/azure-specific/azure.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ jobs:

Just make any change to Terraform - like add a blank line

An action should start. After some time you should see a comment of lock being aquired in your PR. Something like this:
An action should start. After some time you should see a comment of lock being acquired in your PR. Something like this:

```
Project diggerhq/azure-onboarding-test#infra-prod has been locked by PR #1
Expand Down
2 changes: 1 addition & 1 deletion docs/ce/cloud-providers/aws.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: "Setting up DynamoDB Access for locks"
description: "Digger runs without a backend but uses a DynamoDB table to keep track of all the locks that are necessary for locking PR projects. On the first run in your AWS account digger checks for the presense of `DiggerDynamoDBLockTable` and it requires the following policy for the DynamoDB access:"
description: "Digger runs without a backend but uses a DynamoDB table to keep track of all the locks that are necessary for locking PR projects. On the first run in your AWS account digger checks for the presence of `DiggerDynamoDBLockTable` and it requires the following policy for the DynamoDB access:"
---

```
Expand Down
2 changes: 1 addition & 1 deletion docs/ce/gcp/federated-oidc-access.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ Create 2 secrets in your Action Secrets with the following names:

## 5\. Configure Digger workflow to use federated access

Set `EXT` env var intead of the usual key pair. See [oidc-gcp-example](https://github.com/diggerhq/digger-gcp-ocid-demo) repo for more detail. Sample config below:
Set `EXT` env var instead of the usual key pair. See [oidc-gcp-example](https://github.com/diggerhq/digger-gcp-ocid-demo) repo for more detail. Sample config below:

```
- id: 'auth'
Expand Down
2 changes: 1 addition & 1 deletion docs/ce/howto/apply-requirements.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ Digger currently does not support `apply_requirements` (like in Atlantis). Comin
## Workaround

You can use mergeability requirements together with Status Checks to achieve the same.
Digger will not apply if the pull request is not in a “mergable” state as specified by GitHub api. This means that if you have a separate status check and you have this check as “required” by branch protection rules then an attempt of digger apply will not go ahead.
Digger will not apply if the pull request is not in a “mergeable” state as specified by GitHub api. This means that if you have a separate status check and you have this check as “required” by branch protection rules then an attempt of digger apply will not go ahead.
4 changes: 2 additions & 2 deletions docs/ce/howto/generate-projects.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ This will create a project for all sub-directories under environments/core. If s

# Blocks syntax with Terragrunt

You can use blocks generation with terragrunt as well. In order to acheive this all you need to do is specify
You can use blocks generation with terragrunt as well. In order to achieve this all you need to do is specify
`terragrunt: true` for each block. Normally you would only have one terragrunt structure and so you will have
one block entry. However you may be also interested to specify different structure and different parameters
for different folders. For example, you may have a dev, staging and prod account heirarchy and therefore you
for different folders. For example, you may have a dev, staging and prod account hierarchy and therefore you
would specify the blocks in that way. Alternatively maybe you have different providers and you would like to
specify those different providers as well. Note that for very large terragrunt monorepos segragating by blocks
will lead to improved performance since it will not unnecessarily traverse an entire tree if no files have been
Expand Down
6 changes: 3 additions & 3 deletions docs/ce/howto/project-level-roles.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ title: "Project Level Roles for AWS"
---

Multi-account setups are pretty common. In many cases you want to use a different account for
different sets of projects. If you wish to acheive this outside of digger and only use profile names and set
different sets of projects. If you wish to achieve this outside of digger and only use profile names and set
them directly in terraform you can use this as an [example repository](https://github.com/diggerhq/demo-assume-role-multi-account-aws)

You can also use digger.yml to specify which roles should be used for which repository. In this case you specify a main
role in the workflow file using `aws-role-to-assume` (or using keys) and inside the repo if you wish to assume
a differnt role for a specific project you specify an `aws_role_to_assume` under that project.
a different role for a specific project you specify an `aws_role_to_assume` under that project.
If you only specify one role (either `state` or `command`) it is assumed that both options are the same role.

Example digger.yml:
Expand All @@ -27,7 +27,7 @@ projects:
command: "arn:/blabla/accid/prodaccount"
```

Using a workflow file as usual. Here is an [example repository](https://github.com/diggerhq/demo-assume-role-multi-account-aws_diggeryml) using digger.yml to assume differnt roles for differnt projects.
Using a workflow file as usual. Here is an [example repository](https://github.com/diggerhq/demo-assume-role-multi-account-aws_diggeryml) using digger.yml to assume different roles for different projects.

<Note>
NOTE: for locking to be configured user needs to also pass aws-role-to-assume in the workflow file as a
Expand Down
2 changes: 1 addition & 1 deletion docs/ce/howto/using-infracost.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ After the pipeline run finishes, you should see Infracost breakdown output appen

## Diff

For `infracost diff` we'd need to run Infracost twice: first to generate the breakdown on the main branch, then to generate diff on the PR branch. To help with that, Digger provides additional environment varialbes like `$PROJECT_NAME` and `$PR_BRANCH` (see [custom commands](/ce/howto/custom-commands)). You can then configure your workflow in digger.yml to switch branch to main, generate base breakdown, switch back to PR branch, generate diff and finally show it via `$DIGGER_OUT`, like below:
For `infracost diff` we'd need to run Infracost twice: first to generate the breakdown on the main branch, then to generate diff on the PR branch. To help with that, Digger provides additional environment variables like `$PROJECT_NAME` and `$PR_BRANCH` (see [custom commands](/ce/howto/custom-commands)). You can then configure your workflow in digger.yml to switch branch to main, generate base breakdown, switch back to PR branch, generate diff and finally show it via `$DIGGER_OUT`, like below:

```
steps:
Expand Down
4 changes: 2 additions & 2 deletions docs/ce/howto/using-terragrunt.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ This will perform a `terragrunt apply` after changes are detected within this di
# Dynamically generating Terragrunt projects

<Note>
This is not the prefered way of generating terragrunt projects and we advise you to instead use the [blocks declarative](/ce/howto/generate-projects#blocks-syntax-with-terragrunt)
since this way may be depracated in the future
This is not the preferred way of generating terragrunt projects and we advise you to instead use the [blocks declarative](/ce/howto/generate-projects#blocks-syntax-with-terragrunt)
since this way may be deprecated in the future
</Note>

[Demo repo](https://github.com/diggerhq/test-terragrunt-racecondition)
Expand Down
2 changes: 1 addition & 1 deletion docs/ce/securing-digger/external-provider.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: "External providers code execution"
---

Digger executes terraform in github actions within previlliged environments. Since terraform has the ability
to execute arbitrary code based on data blocks or external providers this can lead to a user with mallicious
to execute arbitrary code based on data blocks or external providers this can lead to a user with malicious
intent to expose the environment variables within the CI environment, potentially leaking cloud secrets.

How to avoid this?
Expand Down
2 changes: 1 addition & 1 deletion docs/ee/buildkite.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ BUILDKITE_ORG=myorg
BUILDKITE_PIPELINE=my_digger_pipeline
```

Other than that if you folllow the steps in the self hosting guide you should end up with the orchestrator up and running
Other than that if you follow the steps in the self hosting guide you should end up with the orchestrator up and running
along with a github app successfully installed. The repo you wish to try with digger should be installed onto the orchestrator.

### Install digger cli in your buildkite agent
Expand Down
4 changes: 2 additions & 2 deletions docs/ee/gitlab-support.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ You can use digger with gitlab as your VCS and gitlab pipelines as a CI backend.

- Having a valid digger EE license key. If you don't have a license key please [contact us](https://calendly.com/diggerdev/diggerdemo) to request an EE trial
- A gitlab account.
- a personal github access token. This can be created from user prefences > access tokens
- a personal github access token. This can be created from user preferences > access tokens

### Install the digger EE orchestrator:

Expand All @@ -27,7 +27,7 @@ DIGGER_GITLAB_WEBHOOK_SECRET=abc123
DIGGER_GITLAB_ACCESS_TOKEN=glpat-xxxxyyyyyzzzzz # (this is your gitlab access token from prerequisite step)
```

Other than that if you folllow the steps in the self hosting guide you should end up with the orchestrator up and running
Other than that if you follow the steps in the self hosting guide you should end up with the orchestrator up and running
along with a github app successfully installed. The repo you wish to try with digger should be installed onto the orchestrator.


Expand Down
2 changes: 1 addition & 1 deletion ee/backend/ci_backends/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,5 @@ func (b EEBackendProvider) GetCiBackend(options ci_backends.CiBackendOptions) (c
ciBackend := &BuildkiteCi{Org: org, Pipeline: pipeline, Client: *buildkite}
return ciBackend, nil
}
return nil, fmt.Errorf("unkown ci system: %v", ciBackendType)
return nil, fmt.Errorf("unknown ci system: %v", ciBackendType)
}
Loading

0 comments on commit 32dd1fd

Please sign in to comment.