Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions .codespellrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

[codespell]
# Ref: https://github.com/codespell-project/codespell#using-a-config-file
skip = .git,.gitignore,.gitattributes,*.svg,go.sum,*.lock,*.css,.codespellrc,.cache,.npm,.yarn,*/e2e/raw_tables/*,*/e2e/snapshot_tables/*
check-hidden = true
# Ignore camelCase and PascalCase identifiers (common in Go and TypeScript code)
ignore-regex = \b[a-z]+[A-Z]\w*\b|\b[A-Z][a-z]+[A-Z]\w*\b
# convertor,convertors - project's deliberate spelling for Go types and filenames (DataConvertor, etc.)
# crypted - variable name in AES encrypt/decrypt functions
# te - Tapd API field name (Te/te struct fields)
# thur - Thursday abbreviation in Grafana dashboard SQL column alias
ignore-words-list = convertor,convertors,crypted,te,thur
2 changes: 1 addition & 1 deletion .github/actions/auto-cherry-pick/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ name: "Auto Cherry Pick"
description: "cherry pick commits from Pull Requests into Release branch"
inputs:
trigger_label_prefix:
description: "The trigger label prefic"
description: "The trigger label prefix"
default: "needs-cherrypick-"
required: false
author_email:
Expand Down
39 changes: 39 additions & 0 deletions .github/workflows/codespell.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Codespell configuration is within .codespellrc
---
name: Codespell

on:
push:
branches: [main]
pull_request:
branches: [main]

permissions:
contents: read

jobs:
codespell:
name: Check for spelling errors
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4
- name: Codespell
uses: codespell-project/actions-codespell@v2
2 changes: 1 addition & 1 deletion backend/core/models/domainlayer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ The following rules make sure Domain Layer Entities serve its purpose

- Read data from platform specific table, convert and store record into one(or multiple) domain table(s)
- Generate its own `Id` accordingly
- Generate foreign key accordlingly
- Generate foreign key accordingly
- Fields conversion

Sample code:
Expand Down
2 changes: 1 addition & 1 deletion backend/core/models/locking.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package models

import "time"

// LockingHistory is desgned for preventing mutiple delake instances from sharing the same database which may cause
// LockingHistory is desgned for preventing multiple delake instances from sharing the same database which may cause
// problems like #3537, #3466. It works by the following step:
//
// 1. Each devlake insert a record to this table whie `Succeeded=false`
Expand Down
4 changes: 2 additions & 2 deletions backend/core/plugin/plugin_blueprint.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@ type DataSourcePluginBlueprintV200 interface {
// BlueprintConnectionV200 contains the pluginName/connectionId and related Scopes,

// MetricPluginBlueprintV200 is similar to the DataSourcePluginBlueprintV200
// but for Metric Plugin, take dora as an example, it doens't have any scope,
// but for Metric Plugin, take dora as an example, it doesn't have any scope,
// nor does it produce any, however, it does require other plugin to be
// executed beforehand, like calcuating refdiff before it can connect PR to the
// executed beforehand, like calculating refdiff before it can connect PR to the
// right Deployment keep in mind it would be called IFF the plugin was enabled
// for the project.
type MetricPluginBlueprintV200 interface {
Expand Down
2 changes: 1 addition & 1 deletion backend/core/plugin/plugin_task.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ type SubTaskMeta struct {
Dependencies []*SubTaskMeta
DependencyTables []string
ProductTables []string
ForceRunOnResume bool // Should a subtask be ran dispite it was finished before
ForceRunOnResume bool // Should a subtask be ran despite it was finished before
}

// PluginTask Implement this interface to let framework run tasks for you
Expand Down
2 changes: 1 addition & 1 deletion backend/core/utils/network_helper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func TestResolvePort(t *testing.T) {
}
_, err = ResolvePort("", "rabbitmq")
if err == nil {
t.Errorf("Expected error %s, Got nil", "schema not fount")
t.Errorf("Expected error %s, Got nil", "schema not found")
}
_, err = ResolvePort("", "")
if err == nil {
Expand Down
2 changes: 1 addition & 1 deletion backend/helpers/e2ehelper/data_flow_tester.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ func NewDataFlowTester(t *testing.T, pluginName string, pluginMeta plugin.Plugin
cfg.Set(`DB_URL`, cfg.GetString(`E2E_DB_URL`))
db, err := runner.NewGormDb(cfg, logruslog.Global)
if err != nil {
// if here fail with error `acces denied for user` you need to create database by your self as follow command
// if here fail with error `access denied for user` you need to create database by your self as follow command
// create databases lake_test;
// grant all on lake_test.* to 'merico'@'%';
panic(err)
Expand Down
6 changes: 3 additions & 3 deletions backend/helpers/migrationhelper/migrationhelper.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import (
helper "github.com/apache/incubator-devlake/helpers/pluginhelper/api"
)

// AutoMigrateTables runs AutoMigrate for muliple tables
// AutoMigrateTables runs AutoMigrate for multiple tables
func AutoMigrateTables(basicRes context.BasicRes, dst ...interface{}) errors.Error {
db := basicRes.GetDal()
for _, entity := range dst {
Expand Down Expand Up @@ -74,14 +74,14 @@ func ChangeColumnsType[D any](

err = db.AutoMigrate(new(D), dal.From(tableName))
if err != nil {
return errors.Default.Wrap(err, "AutoMigrate for Add Colume Error")
return errors.Default.Wrap(err, "AutoMigrate for Add Column Error")
}

defer func() {
if err != nil {
err1 := db.DropColumns(tableName, columns...)
if err1 != nil {
err = errors.Default.Wrap(err, fmt.Sprintf("RollBack by DropColume failed.Relevant data needs to be repaired manually.%s", err1.Error()))
err = errors.Default.Wrap(err, fmt.Sprintf("RollBack by DropColumn failed.Relevant data needs to be repaired manually.%s", err1.Error()))
}
}
}()
Expand Down
16 changes: 8 additions & 8 deletions backend/helpers/migrationhelper/migrationhelper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ func TestTransformTable(t *testing.T) {
assert.Equal(t, dts[2].Id, "fd61a03af4f77d870fc21e05e7e80678095c92d808cfb3b5c279ee04c74aca1357ef3d346f24f386216563752b0c447a35c041e0b7143f929dc4de27742e3307")
}).Return(nil).Once()

// for Primarykey autoincrement cheking
// for Primarykey autoincrement checking
mockDal.On("GetColumns", mock.Anything, mock.Anything).Run(func(args mock.Arguments) {
tableName := args.Get(0).(dal.Tabler).TableName()
assert.Equal(t, tableName, TestTableNameSrc)
Expand Down Expand Up @@ -188,7 +188,7 @@ func TestTransformTable_RollBack(t *testing.T) {
assert.NotEqual(t, oldname, tmpname)
}).Return(nil).Once()

// checking if Rename and Drop RollBack working with rigth table
// checking if Rename and Drop RollBack working with right table
mockDal.On("RenameTable", mock.Anything, mock.Anything).Run(func(args mock.Arguments) {
tmpname, ok := args.Get(0).(string)
assert.Equal(t, ok, true)
Expand All @@ -203,7 +203,7 @@ func TestTransformTable_RollBack(t *testing.T) {
assert.Equal(t, oldname, TestTableNameSrc)
}).Return(nil).Once()

// for Primarykey autoincrement cheking
// for Primarykey autoincrement checking
mockDal.On("GetColumns", mock.Anything, mock.Anything).Run(func(args mock.Arguments) {
tableName := args.Get(0).(dal.Tabler).TableName()
assert.Equal(t, tableName, TestTableNameSrc)
Expand Down Expand Up @@ -296,7 +296,7 @@ func TestCopyTableColumns(t *testing.T) {
assert.Equal(t, dts[2].Id, "fd61a03af4f77d870fc21e05e7e80678095c92d808cfb3b5c279ee04c74aca1357ef3d346f24f386216563752b0c447a35c041e0b7143f929dc4de27742e3307")
}).Return(nil).Once()

// for Primarykey autoincrement cheking
// for Primarykey autoincrement checking
mockDal.On("GetColumns", mock.Anything, mock.Anything).Run(func(args mock.Arguments) {
tableName := args.Get(0).(dal.Tabler).TableName()
assert.Equal(t, tableName, TestTableNameSrc)
Expand Down Expand Up @@ -352,7 +352,7 @@ func TestCopyTableColumns_RollBack(t *testing.T) {
assert.NotEqual(t, oldname, tmpname)
}).Return(nil).Once()

// checking if Rename and Drop RollBack working with rigth table
// checking if Rename and Drop RollBack working with right table
mockDal.On("RenameTable", mock.Anything, mock.Anything).Run(func(args mock.Arguments) {
tmpname, ok := args.Get(0).(string)
assert.Equal(t, ok, true)
Expand All @@ -367,7 +367,7 @@ func TestCopyTableColumns_RollBack(t *testing.T) {
assert.Equal(t, oldname, TestTableNameSrc)
}).Return(nil).Once()

// for Primarykey autoincrement cheking
// for Primarykey autoincrement checking
mockDal.On("GetColumns", mock.Anything, mock.Anything).Run(func(args mock.Arguments) {
tableName := args.Get(0).(dal.Tabler).TableName()
assert.Equal(t, tableName, TestTableNameSrc)
Expand Down Expand Up @@ -521,7 +521,7 @@ func TestTransformColumns_RollBack(t *testing.T) {
assert.NotEqual(t, columnName, tmpColumnName)
}).Return(nil).Once()

// checking if Rename and Drop RollBack working with rigth table
// checking if Rename and Drop RollBack working with right table
mockDal.On("RenameColumn", mock.Anything, mock.Anything, mock.Anything).Run(func(args mock.Arguments) {
tableName, ok := args.Get(0).(string)
assert.Equal(t, ok, true)
Expand Down Expand Up @@ -634,7 +634,7 @@ func TestChangeColumnsType_Rollback(t *testing.T) {
assert.NotEqual(t, columnName, tmpColumnName)
}).Return(nil).Once()

// checking if Rename and Drop RollBack working with rigth table
// checking if Rename and Drop RollBack working with right table
mockDal.On("RenameColumn", mock.Anything, mock.Anything, mock.Anything).Run(func(args mock.Arguments) {
tableName, ok := args.Get(0).(string)
assert.Equal(t, ok, true)
Expand Down
2 changes: 1 addition & 1 deletion backend/helpers/pluginhelper/api/api_async_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ func CreateAsyncApiClient(
return nil, errors.Default.Wrap(err, "failed to create scheduler")
}

// finally, wrap around api client with async sematic
// finally, wrap around api client with async semantic
return &ApiAsyncClient{
apiClient,
scheduler,
Expand Down
2 changes: 1 addition & 1 deletion backend/helpers/pluginhelper/api/api_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ func UnmarshalResponse(res *http.Response, v interface{}) errors.Error {
if err != nil {
statusCode := res.StatusCode
if statusCode == http.StatusUnauthorized || statusCode == http.StatusForbidden {
statusCode = http.StatusBadRequest // to avoid Basic Auth Dialog poping up
statusCode = http.StatusBadRequest // to avoid Basic Auth Dialog popping up
}
return errors.HttpStatus(statusCode).Wrap(err, fmt.Sprintf("error decoding response from %s: raw response: %s", res.Request.URL.String(), string(resBody)))
}
Expand Down
4 changes: 2 additions & 2 deletions backend/helpers/pluginhelper/api/batch_save_divider.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,10 @@ func (d *BatchSaveDivider) ForType(rowType reflect.Type) (*BatchSave, errors.Err
rowElemType := rowType.Elem()
d.log.Debug("missing BatchSave for type %s", rowElemType.Name())
row := reflect.New(rowElemType).Interface()
// check if rowType had RawDataOrigin embeded
// check if rowType had RawDataOrigin embedded
field, hasField := rowElemType.FieldByName("RawDataOrigin")
if !hasField || field.Type != reflect.TypeOf(common.RawDataOrigin{}) {
return nil, errors.Default.New(fmt.Sprintf("type %s must have RawDataOrigin embeded", rowElemType.Name()))
return nil, errors.Default.New(fmt.Sprintf("type %s must have RawDataOrigin embedded", rowElemType.Name()))
}
d.batches[rowType] = batch
if !d.incrementalMode {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ func (converter *StatefulDataConverter[InputType]) Execute() errors.Error {
if err != nil {
return err
}
// save the incremantal state
// save the incremental state
return converter.SubtaskStateManager.Close()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const (
RAS_ENTRY_TYPE_SCOPE = "scope"
)

// DsListRemoteScopes is the function type for listing remote scopes that must be implmeneted by the plugin
// DsListRemoteScopes is the function type for listing remote scopes that must be implemented by the plugin
type DsListRemoteScopes[C plugin.ToolLayerApiConnection, S plugin.ToolLayerScope, P any] func(
connection *C, apiClient plugin.ApiClient, groupId string, page P) (children []models.DsRemoteApiScopeListEntry[S], nextPage *P, errr errors.Error)

Expand Down
4 changes: 2 additions & 2 deletions backend/helpers/pluginhelper/api/iterator.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func NewBatchedDalCursorIterator(db dal.Dal, cursor dal.Rows, elemType reflect.T
}, nil
}

// HasNext increments the row curser. If we're at the end, it'll return false.
// HasNext increments the row cursor. If we're at the end, it'll return false.
func (c *DalCursorIterator) HasNext() bool {
return c.cursor.Next()
}
Expand Down Expand Up @@ -149,7 +149,7 @@ type QueueIterator struct {
queue *Queue
}

// HasNext increments the row curser. If we're at the end, it'll return false.
// HasNext increments the row cursor. If we're at the end, it'll return false.
func (q *QueueIterator) HasNext() bool {
return q.queue.GetCount() > 0
}
Expand Down
4 changes: 2 additions & 2 deletions backend/helpers/pluginhelper/api/model_api_helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -226,11 +226,11 @@ func parsePagination[P any](input *plugin.ApiResourceInput) (*P, errors.Error) {
pagination := new(P)
err := utils.DecodeMapStruct(input.Query, pagination, false)
if err != nil {
return nil, errors.BadInput.Wrap(err, "faild to decode pagination from query string")
return nil, errors.BadInput.Wrap(err, "failed to decode pagination from query string")
}
err = utils.DecodeMapStruct(input.Params, pagination, false)
if err != nil {
return nil, errors.BadInput.Wrap(err, "faild to decode pagination from path variables")
return nil, errors.BadInput.Wrap(err, "failed to decode pagination from path variables")
}
if e := vld.Struct(pagination); e != nil {
return nil, errors.BadInput.Wrap(e, "invalid pagination parameters")
Expand Down
4 changes: 2 additions & 2 deletions backend/helpers/pluginhelper/api/worker_scheduler.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ func NewWorkerScheduler(
// It doesn't return error because it wouldn't be any when with a Blocking semantic, returned error does nothing but
// causing confusion, more often, people thought it is returned by the task.
// Since it is async task, the callframes would not be available for production mode, you can export Environment
// Varaible ASYNC_CF=true to enable callframes capturing when debugging.
// Variable ASYNC_CF=true to enable callframes capturing when debugging.
// IMPORTANT: do NOT call SubmitBlocking inside the async task, it is likely to cause a deadlock, call
// SubmitNonBlocking instead when number of tasks is relatively small.
func (s *WorkerScheduler) SubmitBlocking(task func() errors.Error) {
Expand Down Expand Up @@ -118,7 +118,7 @@ func (s *WorkerScheduler) SubmitBlocking(task func() errors.Error) {

/*
func (s *WorkerScheduler) gatherCallFrames() string {
cf := "set Environment Varaible ASYNC_CF=true to enable callframes capturing"
cf := "set Environment Variable ASYNC_CF=true to enable callframes capturing"
if callframeEnabled {
cf = utils.GatherCallFrames(1)
}
Expand Down
4 changes: 2 additions & 2 deletions backend/helpers/pluginhelper/csv_file_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ func TestExampleCsvFile(t *testing.T) {
defer iter.Close()
for iter.HasNext() {
row := iter.Fetch()
assert.Equal(t, row["name"], "foobar", "name not euqal")
assert.Equal(t, row["json"], `{"url": "https://example.com"}`, "json not euqal")
assert.Equal(t, row["name"], "foobar", "name not equal")
assert.Equal(t, row["json"], `{"url": "https://example.com"}`, "json not equal")
}
}

Expand Down
2 changes: 1 addition & 1 deletion backend/helpers/srvhelper/model_service_helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ func (srv *ModelSrvHelper[M]) ValidateModel(model *M) errors.Error {
}
// basic validator
if e := srv.validator.Struct(model); e != nil {
return errors.BadInput.Wrap(e, "validation faild")
return errors.BadInput.Wrap(e, "validation failed")
}
return nil
}
Expand Down
2 changes: 1 addition & 1 deletion backend/helpers/srvhelper/scope_service_helper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func Test_setDefaultEntities(t *testing.T) {
setDefaultEntities(sc1)
assert.Equal(t, sc1.Entities, plugin.DOMAIN_TYPES)

// plugin embeded the common ScopeConfig
// plugin embedded the common ScopeConfig
sc2 := &struct {
common.ScopeConfig
}{
Expand Down
2 changes: 1 addition & 1 deletion backend/impls/context/default_basic_res.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func (c *DefaultBasicRes) GetConfigReader() config.ConfigReader {
return c.cfg
}

// GetConfig returns the value of the specificed name
// GetConfig returns the value of the specified name
func (c *DefaultBasicRes) GetConfig(name string) string {
return c.cfg.GetString(name)
}
Expand Down
4 changes: 2 additions & 2 deletions backend/impls/dalgorm/dalgorm.go
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ func (d *Dalgorm) Delete(entity interface{}, clauses ...dal.Clause) errors.Error
return d.convertGormError(buildTx(d.db, clauses).Delete(entity).Error)
}

// UpdateColumn allows you to update mulitple records
// UpdateColumn allows you to update multiple records
func (d *Dalgorm) UpdateColumn(entityOrTable interface{}, columnName string, value interface{}, clauses ...dal.Clause) errors.Error {
d.unwrapDynamic(&entityOrTable, &clauses)
if expr, ok := value.(dal.DalClause); ok {
Expand All @@ -286,7 +286,7 @@ func (d *Dalgorm) UpdateColumn(entityOrTable interface{}, columnName string, val
return d.convertGormError(buildTx(d.db, clauses).Update(columnName, value).Error)
}

// UpdateColumns allows you to update multiple columns of mulitple records
// UpdateColumns allows you to update multiple columns of multiple records
func (d *Dalgorm) UpdateColumns(entityOrTable interface{}, set []dal.DalSet, clauses ...dal.Clause) errors.Error {
d.unwrapDynamic(&entityOrTable, &clauses)
updatesSet := make(map[string]interface{})
Expand Down
2 changes: 1 addition & 1 deletion backend/plugins/ae/api/connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func testConnection(ctx context.Context, connection models.AeConn) (*plugin.ApiR
return &plugin.ApiResourceOutput{Body: true, Status: 200}, nil
case 401: // error secretKey or nonceStr
return &plugin.ApiResourceOutput{Body: false, Status: http.StatusBadRequest}, nil
default: // unknow what happen , back to user
default: // unknown what happen , back to user
return &plugin.ApiResourceOutput{Body: res.Body, Status: res.StatusCode}, nil
}
}
Expand Down
Loading
Loading