diff --git a/CHANGELOG.md b/CHANGELOG.md index 799e6a64..5f58c5ed 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -94,13 +94,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - page to view the latest build per branch. ### Fixed -- sync routine not executing asyncronously, being cancelled by http context. +- sync routine not executing asynchronously, being cancelled by http context. - sync routine should ignore gitlab subrepositories - convert deploy events in 0.8 yaml to promote events. - do not execute cron job for disabled repositories. [#2931](https://github.com/drone/drone/issues/2931). - remove trailing slash from gitea url to prevent oauth2 token refresh errors, by [@cmj0121](https://github.com/cmj0121). [#2920](https://github.com/drone/drone/issues/2920). - disable font ligatures in build log output. [drone/drone-ui#322](https://github.com/drone/drone-ui/pull/322). -- missing am/pm in timstamps +- missing am/pm in timestamps ## [1.6.5] - 2020-01-29 ### Changed diff --git a/core/build.go b/core/build.go index c164535c..f7076186 100644 --- a/core/build.go +++ b/core/build.go @@ -77,7 +77,7 @@ type BuildStore interface { LatestBranches(context.Context, int64) ([]*Build, error) // LatestPulls returns the latest builds from the - // datastore by pull requeset. + // datastore by pull request. LatestPulls(context.Context, int64) ([]*Build, error) // LatestDeploys returns the latest builds from the diff --git a/core/transfer.go b/core/transfer.go index 48ece418..3e653517 100644 --- a/core/transfer.go +++ b/core/transfer.go @@ -16,7 +16,7 @@ package core import "context" -// Transferer handles transfering repository ownership from one +// Transferer handles transferring repository ownership from one // user to another user account. type Transferer interface { Transfer(ctx context.Context, user *User) error diff --git a/core/user.go b/core/user.go index c4d62ae7..e9fcaa9d 100644 --- a/core/user.go +++ b/core/user.go @@ -101,7 +101,7 @@ type ( } ) -// Validate valides the user and returns an error if the +// Validate validates the user and returns an error if the // validation fails. func (u *User) Validate() error { switch { diff --git a/handler/api/user/repos_test.go b/handler/api/user/repos_test.go index cc99883e..3ab2ebac 100644 --- a/handler/api/user/repos_test.go +++ b/handler/api/user/repos_test.go @@ -25,7 +25,7 @@ func init() { logrus.SetOutput(ioutil.Discard) } -func TestResitoryList(t *testing.T) { +func TestRepositoryList(t *testing.T) { controller := gomock.NewController(t) defer controller.Finish() @@ -63,7 +63,7 @@ func TestResitoryList(t *testing.T) { } } -func TestResitoryListErr(t *testing.T) { +func TestRepositoryListErr(t *testing.T) { controller := gomock.NewController(t) defer controller.Finish() diff --git a/handler/api/user/sync.go b/handler/api/user/sync.go index c2f0555a..42512d73 100644 --- a/handler/api/user/sync.go +++ b/handler/api/user/sync.go @@ -30,7 +30,7 @@ func HandleSync(syncer core.Syncer, repos core.RepositoryStore) http.HandlerFunc return func(w http.ResponseWriter, r *http.Request) { viewer, _ := request.UserFrom(r.Context()) - // performs asyncrhonous account synchronization. + // performs asynchronous account synchronization. // this requires long polling to determine when the // sync is complete. if r.FormValue("async") == "true" { @@ -57,7 +57,7 @@ func HandleSync(syncer core.Syncer, repos core.RepositoryStore) http.HandlerFunc if err != nil { render.InternalError(w, err) logger.FromRequest(r).WithError(err). - Warnln("api: cannot synchrnoize account") + Warnln("api: cannot synchronize account") } else { render.JSON(w, list, 200) } diff --git a/handler/api/users/create.go b/handler/api/users/create.go index d12c1d04..57568067 100644 --- a/handler/api/users/create.go +++ b/handler/api/users/create.go @@ -77,7 +77,7 @@ func HandleCreate(users core.UserStore, service core.UserService, sender core.We if err != nil { render.ErrorCode(w, err, 400) logger.FromRequest(r).WithError(err). - Errorln("api: invlid username") + Errorln("api: invalid username") return } diff --git a/handler/api/users/create_test.go b/handler/api/users/create_test.go index f5779836..77253edb 100644 --- a/handler/api/users/create_test.go +++ b/handler/api/users/create_test.go @@ -30,7 +30,7 @@ func TestCreate(t *testing.T) { t.Errorf("Want user login %s, got %s", want, got) } if in.Hash == "" { - t.Errorf("Expect user secert generated") + t.Errorf("Expect user secret generated") } return nil }) diff --git a/handler/api/users/find.go b/handler/api/users/find.go index efdddd05..491bda8e 100644 --- a/handler/api/users/find.go +++ b/handler/api/users/find.go @@ -35,7 +35,7 @@ func HandleFind(users core.UserStore) http.HandlerFunc { if err != nil { // the client can make a user request by providing // the user id as opposed to the username. If a - // numberic user id is provided as input, attempt + // numeric user id is provided as input, attempt // to lookup the user by id. if id, _ := strconv.ParseInt(login, 10, 64); id != 0 { user, err = users.Find(r.Context(), id) diff --git a/handler/web/login.go b/handler/web/login.go index d7ca7128..08ee23e6 100644 --- a/handler/web/login.go +++ b/handler/web/login.go @@ -150,7 +150,7 @@ func HandleLogin( } // If the user account has never been synchronized we - // execute the synchonrization logic. + // execute the synchronization logic. if time.Unix(user.Synced, 0).Add(syncPeriod).Before(time.Now()) { user.Syncing = true } @@ -163,7 +163,7 @@ func HandleLogin( logger.Errorf("cannot update user: %s", err) } - // launch the synchrnoization process in a go-routine, + // launch the synchronization process in a go-routine, // since it is a long-running process and can take up // to a few minutes. if user.Syncing { diff --git a/operator/manager/manager.go b/operator/manager/manager.go index d8ed9849..af725702 100644 --- a/operator/manager/manager.go +++ b/operator/manager/manager.go @@ -44,7 +44,7 @@ type ( System *core.System `json:"system"` } - // BuildManager encapsulets complex build operations and provides + // BuildManager encapsulates complex build operations and provides // a simplified interface for build runners. BuildManager interface { // Request requests the next available build stage for execution. @@ -60,13 +60,13 @@ type ( Details(ctx context.Context, stage int64) (*Context, error) // Before signals the build step is about to start. - Before(ctxt context.Context, step *core.Step) error + Before(ctx context.Context, step *core.Step) error // After signals the build step is complete. After(ctx context.Context, step *core.Step) error // Before signals the build stage is about to start. - BeforeAll(ctxt context.Context, stage *core.Stage) error + BeforeAll(ctx context.Context, stage *core.Stage) error // After signals the build stage is complete. AfterAll(ctx context.Context, stage *core.Stage) error @@ -84,7 +84,7 @@ type ( UploadBytes(ctx context.Context, step int64, b []byte) error } - // Request provildes filters when requesting a pending + // Request provides filters when requesting a pending // build from the queue. This allows an agent, for example, // to request a build that matches its architecture and kernel. Request struct { diff --git a/operator/manager/rpc/server_oss.go b/operator/manager/rpc/server_oss.go index c056b4c7..6d068b6f 100644 --- a/operator/manager/rpc/server_oss.go +++ b/operator/manager/rpc/server_oss.go @@ -58,7 +58,7 @@ func (Server) Details(ctx context.Context, stage int64) (*manager.Context, error } // Before signals the build step is about to start. -func (Server) Before(ctxt context.Context, step *core.Step) error { +func (Server) Before(ctx context.Context, step *core.Step) error { return errors.New("not implemented") } @@ -68,7 +68,7 @@ func (Server) After(ctx context.Context, step *core.Step) error { } // Before signals the build stage is about to start. -func (Server) BeforeAll(ctxt context.Context, stage *core.Stage) error { +func (Server) BeforeAll(ctx context.Context, stage *core.Stage) error { return errors.New("not implemented") } diff --git a/operator/manager/rpc2/handler.go b/operator/manager/rpc2/handler.go index 311299fb..f901af22 100644 --- a/operator/manager/rpc2/handler.go +++ b/operator/manager/rpc2/handler.go @@ -69,7 +69,7 @@ func HandlePing() http.HandlerFunc { } // HandleRequest returns an http.HandlerFunc that processes an -// http.Request to reqeust a stage from the queue for execution. +// http.Request to request a stage from the queue for execution. // // POST /rpc/v2/stage func HandleRequest(m manager.BuildManager) http.HandlerFunc { @@ -135,7 +135,7 @@ func HandleInfo(m manager.BuildManager) http.HandlerFunc { writeJSON(w, &details{ Context: res, Netrc: netrc, - Repo: &repositroy{ + Repo: &repository{ Repository: res.Repo, Secret: res.Repo.Secret, }, diff --git a/operator/manager/rpc2/types.go b/operator/manager/rpc2/types.go index 5ec3f497..f06749b7 100644 --- a/operator/manager/rpc2/types.go +++ b/operator/manager/rpc2/types.go @@ -16,12 +16,12 @@ import ( type details struct { *manager.Context Netrc *core.Netrc `json:"netrc"` - Repo *repositroy `json:"repository"` + Repo *repository `json:"repository"` } // repository wraps a repository object to include the secret // when the repository is marshaled to json. -type repositroy struct { +type repository struct { *core.Repository Secret string `json:"secret"` } diff --git a/operator/runner/machine/config.go b/operator/runner/machine/config.go index 03d36d6d..1fbe5fa3 100644 --- a/operator/runner/machine/config.go +++ b/operator/runner/machine/config.go @@ -38,7 +38,7 @@ type Config struct { } } -// heper function reads and unmarshales the docker-machine +// helper function reads and unmarshalls the docker-machine // configuration from a reader. func parseReader(r io.Reader) (*Config, error) { out := new(Config) diff --git a/operator/runner/machine/machine.go b/operator/runner/machine/machine.go index a2807aa1..e25faf84 100644 --- a/operator/runner/machine/machine.go +++ b/operator/runner/machine/machine.go @@ -37,7 +37,7 @@ func Load(home, match string) ([]*Config, error) { if err != nil { return nil, err } - // If no match logic is defined, the matchine is + // If no match logic is defined, the machine is // automatically used as a build machine. if match == "" { machines = append(machines, conf) diff --git a/plugin/config/global_test.go b/plugin/config/global_test.go index 3d57ce75..6b2d8586 100644 --- a/plugin/config/global_test.go +++ b/plugin/config/global_test.go @@ -71,7 +71,7 @@ func TestGlobalErr(t *testing.T) { false, time.Minute) _, err := service.Find(noContext, args) if err == nil { - t.Errorf("Expect http.Reponse error") + t.Errorf("Expect http.Response error") } else if err.Error() != "Not Found" { t.Errorf("Expect Not Found error") } diff --git a/plugin/converter/jsonnet/jsonnet.go b/plugin/converter/jsonnet/jsonnet.go index bdb4efa2..4f2b8998 100644 --- a/plugin/converter/jsonnet/jsonnet.go +++ b/plugin/converter/jsonnet/jsonnet.go @@ -17,13 +17,13 @@ func Parse(req *core.ConvertArgs, template *core.Template, templateData map[stri vm.ErrorFormatter.SetMaxStackTraceSize(20) var jsonnetFile string - var jsonentFileName string + var jsonnetFileName string if template != nil { jsonnetFile = template.Data - jsonentFileName = template.Name + jsonnetFileName = template.Name } else { jsonnetFile = req.Config.Data - jsonentFileName = req.Repo.Config + jsonnetFileName = req.Repo.Config } // map external inputs if len(templateData) != 0 { @@ -35,9 +35,9 @@ func Parse(req *core.ConvertArgs, template *core.Template, templateData map[stri } // convert the jsonnet file to yaml buf := new(bytes.Buffer) - docs, err := vm.EvaluateSnippetStream(jsonentFileName, jsonnetFile) + docs, err := vm.EvaluateSnippetStream(jsonnetFileName, jsonnetFile) if err != nil { - doc, err2 := vm.EvaluateSnippet(jsonentFileName, jsonnetFile) + doc, err2 := vm.EvaluateSnippet(jsonnetFileName, jsonnetFile) if err2 != nil { return "", err } diff --git a/plugin/registry/encrypted.go b/plugin/registry/encrypted.go index 34fce12d..e35d1be2 100644 --- a/plugin/registry/encrypted.go +++ b/plugin/registry/encrypted.go @@ -28,7 +28,7 @@ import ( ) // Encrypted returns a new encrypted registry credentials -// provider that sournces credentials from the encrypted strings +// provider that sources credentials from the encrypted strings // in the yaml file. func Encrypted() core.RegistryService { return new(encrypted) diff --git a/plugin/registry/endpoint_test.go b/plugin/registry/endpoint_test.go index 2694fce4..e5bbde55 100644 --- a/plugin/registry/endpoint_test.go +++ b/plugin/registry/endpoint_test.go @@ -67,7 +67,7 @@ func TestEndpointSource_Err(t *testing.T) { service := EndpointSource("https://company.com/auths", "GMEuUHQfmrMRsseWxi9YlIeBtn9lm6im", false) _, err := service.List(noContext, &core.RegistryArgs{Repo: &core.Repository{}, Build: &core.Build{}}) if err == nil { - t.Errorf("Expect http.Reponse error") + t.Errorf("Expect http.Response error") } else if err.Error() != "Not Found" { t.Errorf("Expect Not Found error") } diff --git a/scheduler/queue/queue.go b/scheduler/queue/queue.go index 72410036..8deab988 100644 --- a/scheduler/queue/queue.go +++ b/scheduler/queue/queue.go @@ -147,7 +147,7 @@ func (q *queue) signal(ctx context.Context) error { continue } - // if the system defines concurrencly limits + // if the system defines concurrency limits // per repository we need to make sure those limits // are not exceeded before proceeding. if shouldThrottle(item, items, item.LimitRepo) == true { @@ -275,7 +275,7 @@ func withinLimits(stage *core.Stage, siblings []*core.Stage) bool { } func shouldThrottle(stage *core.Stage, siblings []*core.Stage, limit int) bool { - // if no throttle limit is defined (defualt) then + // if no throttle limit is defined (default) then // return false to indicate no throttling is needed. if limit == 0 { return false diff --git a/scheduler/queue/queue_test.go b/scheduler/queue/queue_test.go index f15ac604..6b534d56 100644 --- a/scheduler/queue/queue_test.go +++ b/scheduler/queue/queue_test.go @@ -148,7 +148,7 @@ func TestMatchResource(t *testing.T) { for i, test := range tests { got, want := matchResource(test.kinda, test.typea, test.kindb, test.typeb), test.want if got != want { - t.Errorf("Unexpectd results at index %d", i) + t.Errorf("Unexpected results at index %d", i) } } } @@ -193,7 +193,7 @@ func TestShouldThrottle(t *testing.T) { for i, test := range tests { stage := stages[i] if got, want := shouldThrottle(stage, stages, stage.LimitRepo), test.Want; got != want { - t.Errorf("Unexpectd results at index %d", i) + t.Errorf("Unexpected results at index %d", i) } } } @@ -219,7 +219,7 @@ func TestWithinLimits(t *testing.T) { }, // stage with concurrency 1, no existing stages - // exist for same repositroy id. expect true. + // exist for same repository id. expect true. { result: true, stage: &core.Stage{ @@ -316,7 +316,7 @@ func TestWithinLimits(t *testing.T) { for i, test := range tests { if got, want := withinLimits(test.stage, test.stages), test.result; got != want { - t.Errorf("Unexpectd results at index %d", i) + t.Errorf("Unexpected results at index %d", i) } } } @@ -352,7 +352,7 @@ func TestWithinLimits_Old(t *testing.T) { for i, test := range tests { stage := stages[i] if got, want := withinLimits(stage, stages), test.Want; got != want { - t.Errorf("Unexpectd results at index %d", i) + t.Errorf("Unexpected results at index %d", i) } } } diff --git a/service/content/content.go b/service/content/content.go index 75300f78..9eeda4a7 100644 --- a/service/content/content.go +++ b/service/content/content.go @@ -49,7 +49,7 @@ type service struct { func (s *service) Find(ctx context.Context, user *core.User, repo, commit, ref, path string) (*core.File, error) { // TODO(gogs) ability to fetch a yaml by pull request ref. // it is not currently possible to fetch the yaml - // configuation file from a pull request sha. This + // configuration file from a pull request sha. This // workaround defaults to master. if s.client.Driver == scm.DriverGogs && strings.HasPrefix(ref, "refs/pull") { diff --git a/service/hook/parser/testdata/gitea_push.json b/service/hook/parser/testdata/gitea_push.json index d5fa3413..2f9b3ca4 100644 --- a/service/hook/parser/testdata/gitea_push.json +++ b/service/hook/parser/testdata/gitea_push.json @@ -38,4 +38,4 @@ "Email": "noreply@gogs.io", "Avatar": "https://secure.gravatar.com/avatar/8c58a0be77ee441bb8f8595b7f1b4e87" } -} \ No newline at end of file +} diff --git a/service/hook/parser/testdata/gitea_tag.json b/service/hook/parser/testdata/gitea_tag.json index 9445f09e..dacc2ac3 100644 --- a/service/hook/parser/testdata/gitea_tag.json +++ b/service/hook/parser/testdata/gitea_tag.json @@ -23,4 +23,4 @@ "Email": "noreply@gogs.io", "Avatar": "https://secure.gravatar.com/avatar/8c58a0be77ee441bb8f8595b7f1b4e87" } -} \ No newline at end of file +} diff --git a/service/hook/parser/testdata/gogs_pull_create.json b/service/hook/parser/testdata/gogs_pull_create.json index 360bcbe2..eb79219f 100644 --- a/service/hook/parser/testdata/gogs_pull_create.json +++ b/service/hook/parser/testdata/gogs_pull_create.json @@ -40,4 +40,4 @@ "Email": "noreply@gogs.io", "Avatar": "https://secure.gravatar.com/avatar/8c58a0be77ee441bb8f8595b7f1b4e87" } -} \ No newline at end of file +} diff --git a/service/hook/parser/testdata/gogs_push.json b/service/hook/parser/testdata/gogs_push.json index 32caf145..15bb470f 100644 --- a/service/hook/parser/testdata/gogs_push.json +++ b/service/hook/parser/testdata/gogs_push.json @@ -38,4 +38,4 @@ "Email": "noreply@gogs.io", "Avatar": "https://secure.gravatar.com/avatar/8c58a0be77ee441bb8f8595b7f1b4e87" } -} \ No newline at end of file +} diff --git a/service/hook/parser/testdata/gogs_tag.json b/service/hook/parser/testdata/gogs_tag.json index a8e961b1..4f9ee41e 100644 --- a/service/hook/parser/testdata/gogs_tag.json +++ b/service/hook/parser/testdata/gogs_tag.json @@ -23,4 +23,4 @@ "Email": "noreply@gogs.io", "Avatar": "https://secure.gravatar.com/avatar/8c58a0be77ee441bb8f8595b7f1b4e87" } -} \ No newline at end of file +} diff --git a/service/syncer/util.go b/service/syncer/util.go index a445044d..82386e03 100644 --- a/service/syncer/util.go +++ b/service/syncer/util.go @@ -19,7 +19,7 @@ import ( "github.com/drone/go-scm/scm" ) -// merge is a helper function that mergest a subset of +// merge is a helper function that merges a subset of // values from the source to the destination repository. func merge(dst, src *core.Repository) { dst.Namespace = src.Namespace diff --git a/session/session_test.go b/session/session_test.go index 65ba5cbe..9cada0bd 100644 --- a/session/session_test.go +++ b/session/session_test.go @@ -45,7 +45,7 @@ func TestGet_Token_QueryParam(t *testing.T) { } // This test verifies that a user is returned when a valid -// authorization token included in the Authorzation header. +// authorization token included in the Authorization header. func TestGet_Token_Header(t *testing.T) { controller := gomock.NewController(t) defer controller.Finish() diff --git a/store/repos/repos.go b/store/repos/repos.go index 53c32519..1251f271 100644 --- a/store/repos/repos.go +++ b/store/repos/repos.go @@ -298,7 +298,7 @@ SELECT ,repo_secret ` -const queryColsBulds = queryCols + ` +const queryColsBuilds = queryCols + ` ,build_id ,build_repo_id ,build_trigger @@ -488,7 +488,7 @@ WHERE repo_id = :repo_id // INNER JOIN perms ON perms.perm_repo_uid = repos.repo_uid // -const queryRepoWithBuild = queryColsBulds + ` +const queryRepoWithBuild = queryColsBuilds + ` FROM repos LEFT OUTER JOIN builds ON build_id = ( SELECT build_id FROM builds WHERE builds.build_repo_id = repos.repo_id @@ -500,7 +500,7 @@ WHERE perms.perm_user_id = :user_id ORDER BY repo_slug ASC ` -const queryRepoWithBuildPostgres = queryColsBulds + ` +const queryRepoWithBuildPostgres = queryColsBuilds + ` FROM repos LEFT OUTER JOIN builds ON build_id = ( SELECT DISTINCT ON (build_repo_id) build_id FROM builds WHERE builds.build_repo_id = repos.repo_id @@ -511,7 +511,7 @@ WHERE perms.perm_user_id = :user_id ORDER BY repo_slug ASC ` -const queryRepoWithBuildAll = queryColsBulds + ` +const queryRepoWithBuildAll = queryColsBuilds + ` FROM repos INNER JOIN perms ON perms.perm_repo_uid = repos.repo_uid INNER JOIN builds ON builds.build_repo_id = repos.repo_id @@ -520,7 +520,7 @@ ORDER BY build_id DESC LIMIT 25; ` -const queryRepoWithBuildIncomplete = queryColsBulds + ` +const queryRepoWithBuildIncomplete = queryColsBuilds + ` FROM repos INNER JOIN builds ON builds.build_repo_id = repos.repo_id WHERE EXISTS ( diff --git a/store/shared/db/conn.go b/store/shared/db/conn.go index 7b53513b..3d32210f 100644 --- a/store/shared/db/conn.go +++ b/store/shared/db/conn.go @@ -70,7 +70,7 @@ func pingDatabase(db *sql.DB) (err error) { return } -// helper function to setup the databsae by performing automated +// helper function to setup the database by performing automated // database migration steps. func setupDatabase(db *sql.DB, driver string) error { switch driver { diff --git a/store/shared/encrypt/aesgcm.go b/store/shared/encrypt/aesgcm.go index a7098e85..83179939 100644 --- a/store/shared/encrypt/aesgcm.go +++ b/store/shared/encrypt/aesgcm.go @@ -21,8 +21,8 @@ import ( "io" ) -// Aesgcm provides an encryper that uses the aesgcm encryption -// alogirthm. +// Aesgcm provides an encrypter that uses the aesgcm encryption +// algorithm. type Aesgcm struct { block cipher.Block Compat bool @@ -56,7 +56,7 @@ func (e *Aesgcm) Decrypt(ciphertext []byte) (string, error) { // mode, it will return the ciphertext as plain text if // decryption fails. This should be used when running the // database in mixed-mode, where there is a mix of encrypted - // and unecrypted content. + // and unencrypted content. if e.Compat { return string(ciphertext), nil } @@ -72,7 +72,7 @@ func (e *Aesgcm) Decrypt(ciphertext []byte) (string, error) { // mode, it will return the ciphertext as plain text if // decryption fails. This should be used when running the // database in mixed-mode, where there is a mix of encrypted - // and unecrypted content. + // and unencrypted content. if err != nil && e.Compat { return string(ciphertext), nil } diff --git a/trigger/dag/dag_test.go b/trigger/dag/dag_test.go index ede56134..c387955b 100644 --- a/trigger/dag/dag_test.go +++ b/trigger/dag/dag_test.go @@ -66,7 +66,7 @@ func TestAncestors(t *testing.T) { } if v := dag.Ancestors("backend"); len(v) != 0 { - t.Errorf("Expect vertexes with no dependences has zero ancestors") + t.Errorf("Expect vertexes with no dependencies has zero ancestors") } } diff --git a/trigger/skip.go b/trigger/skip.go index 6579b9b6..aba3d08a 100644 --- a/trigger/skip.go +++ b/trigger/skip.go @@ -90,7 +90,7 @@ func skipMessageEval(str string) bool { // case len(paths) == 0: // return false // // github returns a maximum of 300 changed files from the -// // api response. If there are 300+ chagned files the system +// // api response. If there are 300+ changed files the system // // will force-run all pipelines and pipeline steps. // case len(paths) >= 300: // return false