diff --git a/Makefile b/Makefile index 863e490b9..4ba3205ed 100644 --- a/Makefile +++ b/Makefile @@ -93,7 +93,7 @@ ar-clean: ############################################################################### format: tools # Format go code and error if any changes are made - @echo "Formating ..." + @echo "Formatting ..." @goimports -w . @gci write --skip-generated --custom-order -s standard -s "prefix(github.com/harness/gitness)" -s default -s blank -s dot . @echo "Formatting complete" diff --git a/README.md b/README.md index b7cbb99ea..122719d7b 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ See [developer.harness.io](https://developer.harness.io/docs/open-source) to lea Harness Open Source represents a massive investment in the next generation of Drone. Where Drone focused solely on continuous integration, Harness adds source code hosting, developer environments (gitspaces), and artifact registries; providing teams with an end-to-end, open source DevOps platform. -The goal is for Harness to eventually be at full parity with Drone in terms of pipeline capabilities, allowing users to seemlessly migrate from Drone to Harness. +The goal is for Harness to eventually be at full parity with Drone in terms of pipeline capabilities, allowing users to seamlessly migrate from Drone to Harness. But, we expect this to take some time, which is why we took a snapshot of Drone as a feature branch [drone](https://github.com/harness/harness/tree/drone) ([README](https://github.com/harness/harness/blob/drone/.github/readme.md)) so it can continue development. diff --git a/app/api/controller/repo/create.go b/app/api/controller/repo/create.go index a41df48fc..d93a99a81 100644 --- a/app/api/controller/repo/create.go +++ b/app/api/controller/repo/create.go @@ -143,7 +143,7 @@ func (c *Controller) Create(ctx context.Context, session *auth.Session, in *Crea return nil, fmt.Errorf("failed to set repo public access (and repo purge: %w): %w", dErr, err) } - return nil, fmt.Errorf("failed to set repo public access (succesfull cleanup): %w", err) + return nil, fmt.Errorf("failed to set repo public access (successful cleanup): %w", err) } // backfil GitURL diff --git a/app/api/controller/space/create.go b/app/api/controller/space/create.go index d55573ee6..8587b2dd5 100644 --- a/app/api/controller/space/create.go +++ b/app/api/controller/space/create.go @@ -94,7 +94,7 @@ func (c *Controller) Create( return nil, fmt.Errorf("failed to set space public access (and space purge: %w): %w", dErr, err) } - return nil, fmt.Errorf("failed to set space public access (succesfull cleanup): %w", err) + return nil, fmt.Errorf("failed to set space public access (successful cleanup): %w", err) } return GetSpaceOutput(ctx, c.publicAccess, space) diff --git a/app/services/cleanup/tokens.go b/app/services/cleanup/tokens.go index 7fb2f5bf2..33ff7df3c 100644 --- a/app/services/cleanup/tokens.go +++ b/app/services/cleanup/tokens.go @@ -52,7 +52,7 @@ func newTokensCleanupJob( // Handle purges old token that are expired. func (j *tokensCleanupJob) Handle(ctx context.Context, _ string, _ job.ProgressReporter) (string, error) { - // Don't remove PAT / SAT as they were explicitly created and are manged by user. + // Don't remove PAT / SAT as they were explicitly created and are managed by user. expiredBefore := time.Now().Add(-tokenRetentionTime) log.Ctx(ctx).Info().Msgf( "start purging expired tokens (expired before: %s)", diff --git a/events/error.go b/events/error.go index 640550cdf..65a62b6e5 100644 --- a/events/error.go +++ b/events/error.go @@ -24,7 +24,7 @@ var ( ) // discardEventError is an error which, if returned by the event handler, -// causes the source event to be discarded despite any erros. +// causes the source event to be discarded despite any errors. type discardEventError struct { inner error } diff --git a/git/api/ref.go b/git/api/ref.go index e032deebe..8d0a0f015 100644 --- a/git/api/ref.go +++ b/git/api/ref.go @@ -253,7 +253,7 @@ func GetReferenceFromBranchName(branchName string) string { // remove spaces branchName = strings.TrimSpace(branchName) // remove `refs/heads/` prefix (shouldn't be there, but if it is remove it to try to avoid complications) - // NOTE: This is used to reduce missconfigurations via api + // NOTE: This is used to reduce misconfigurations via api // TODO: block via CLI, too branchName = strings.TrimPrefix(branchName, gitReferenceNamePrefixBranch) @@ -265,7 +265,7 @@ func GetReferenceFromTagName(tagName string) string { // remove spaces tagName = strings.TrimSpace(tagName) // remove `refs/heads/` prefix (shouldn't be there, but if it is remove it to try to avoid complications) - // NOTE: This is used to reduce missconfigurations via api + // NOTE: This is used to reduce misconfigurations via api // TODO: block via CLI, too tagName = strings.TrimPrefix(tagName, gitReferenceNamePrefixTag) diff --git a/git/repo.go b/git/repo.go index fb0020499..3fa8f9e31 100644 --- a/git/repo.go +++ b/git/repo.go @@ -515,7 +515,7 @@ func (s *Service) GetRepositorySize( }, nil } -// UpdateDefaultBranch updates the default barnch of the repo. +// UpdateDefaultBranch updates the default branch of the repo. func (s *Service) UpdateDefaultBranch( ctx context.Context, params *UpdateDefaultBranchParams, diff --git a/registry/app/remote/clients/registry/auth/authorizer.go b/registry/app/remote/clients/registry/auth/authorizer.go index 1ce256108..69c2d32e4 100644 --- a/registry/app/remote/clients/registry/auth/authorizer.go +++ b/registry/app/remote/clients/registry/auth/authorizer.go @@ -121,7 +121,7 @@ func (a *authorizer) initialize(u *url.URL) error { a.authorizer = basic.NewAuthorizer(a.username, a.password) return nil } - return fmt.Errorf("unspported auth scheme: %v", challenges) + return fmt.Errorf("unsupported auth scheme: %v", challenges) } // isTarget checks whether the request targets the registry. diff --git a/resources/gitignore/Gradle.gitignore b/resources/gitignore/Gradle.gitignore index a5b111377..f93fdf444 100644 --- a/resources/gitignore/Gradle.gitignore +++ b/resources/gitignore/Gradle.gitignore @@ -8,7 +8,7 @@ gradle-app.setting # Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored) !gradle-wrapper.jar -# Avoid ignore Gradle wrappper properties +# Avoid ignore Gradle wrapper properties !gradle-wrapper.properties # Cache of project diff --git a/stream/options.go b/stream/options.go index d49ed943e..1e7cc08e5 100644 --- a/stream/options.go +++ b/stream/options.go @@ -46,7 +46,7 @@ func (f consumerOptionFunc) apply(config *ConsumerConfig) { // WithConcurrency sets up the concurrency of the stream consumer. func WithConcurrency(concurrency int) ConsumerOption { if concurrency < 1 || concurrency > MaxConcurrency { - // missconfiguration - panic to keep options clean + // misconfiguration - panic to keep options clean panic(fmt.Sprintf("provided concurrency %d is invalid - has to be between 1 and %d", concurrency, MaxConcurrency)) } @@ -80,7 +80,7 @@ func (f handlerOptionFunc) apply(config *HandlerConfig) { // WithMaxRetries can be used to set the max retry count for a specific handler. func WithMaxRetries(maxRetries int) HandlerOption { if maxRetries < 0 || maxRetries > MaxMaxRetries { - // missconfiguration - panic to keep options clean + // misconfiguration - panic to keep options clean panic(fmt.Sprintf("provided maxRetries %d is invalid - has to be between 0 and %d", maxRetries, MaxMaxRetries)) } return handlerOptionFunc(func(c *HandlerConfig) { @@ -91,7 +91,7 @@ func WithMaxRetries(maxRetries int) HandlerOption { // WithIdleTimeout can be used to set the idle timeout for a specific handler. func WithIdleTimeout(timeout time.Duration) HandlerOption { if timeout < MinIdleTimeout { - // missconfiguration - panic to keep options clean + // misconfiguration - panic to keep options clean panic(fmt.Sprintf("provided timeout %d is invalid - has to be longer than %s", timeout, MinIdleTimeout)) } return handlerOptionFunc(func(c *HandlerConfig) { diff --git a/stream/stream.go b/stream/stream.go index 07209e861..402556a0e 100644 --- a/stream/stream.go +++ b/stream/stream.go @@ -46,7 +46,7 @@ type ConsumerConfig struct { // HandlerConfig defines the configuration for a single stream handler containing externally exposed values // that can be configured using the available HandlerOptions. type HandlerConfig struct { - // idleTimeout specifies the maximum duration a message stays read but unacknowleged + // idleTimeout specifies the maximum duration a message stays read but unacknowledged // before it can be claimed by others. idleTimeout time.Duration diff --git a/types/check/service_account.go b/types/check/service_account.go index 380d97a5f..cef193c18 100644 --- a/types/check/service_account.go +++ b/types/check/service_account.go @@ -28,7 +28,7 @@ var ( ) // ServiceAccountParent verifies the remaining fields of a service account -// that aren't inhereted from principal. +// that aren't inherited from principal. func ServiceAccountParent(parentType enum.ParentResourceType, parentID int64) error { if parentType != enum.ParentResourceTypeRepo && parentType != enum.ParentResourceTypeSpace { return ErrServiceAccountParentTypeIsInvalid diff --git a/types/config.go b/types/config.go index b1466a3f9..9c9cb09ad 100644 --- a/types/config.go +++ b/types/config.go @@ -58,7 +58,7 @@ type Config struct { // Git defines the external URL via which the GIT API is reachable. // NOTE: for routing to work properly, the request path & hostname reaching gitness - // have to statisfy at least one of the following two conditions: + // have to satisfy at least one of the following two conditions: // - Path ends with `/git` // - Hostname is different to API hostname // (this could be after proxy path / header rewrite). diff --git a/web/scripts/clean-css-types.js b/web/scripts/clean-css-types.js index bbc85abe8..4c54035c4 100644 --- a/web/scripts/clean-css-types.js +++ b/web/scripts/clean-css-types.js @@ -42,7 +42,7 @@ console.log(`Found ${files.length} '.css.d.ts' files`); let i = 0; files.forEach(file => { - // for every '.css' there will be a coresponding '.css.d.ts' file and vice versa + // for every '.css' there will be a corresponding '.css.d.ts' file and vice versa const cssFile = file.replace('.d.ts', ''); if (!fs.existsSync(cssFile)) { diff --git a/web/scripts/strings/generateTypesCli.mjs b/web/scripts/strings/generateTypesCli.mjs index 280219459..d18c462f1 100644 --- a/web/scripts/strings/generateTypesCli.mjs +++ b/web/scripts/strings/generateTypesCli.mjs @@ -18,4 +18,4 @@ import generateTypes from './generateTypes.cjs' await generateTypes() -console.log('✅ Generated type for string files succesfully!') +console.log('✅ Generated type for string files successfully!') diff --git a/web/src/ar/frameworks/strings/StringsContextProvider.tsx b/web/src/ar/frameworks/strings/StringsContextProvider.tsx index 943b0de56..c9747bb2c 100644 --- a/web/src/ar/frameworks/strings/StringsContextProvider.tsx +++ b/web/src/ar/frameworks/strings/StringsContextProvider.tsx @@ -21,7 +21,7 @@ import { StringsContext, StringsContextValue } from './StringsContext' export interface StringsContextProviderProps extends Pick { children: React.ReactNode - initialStrings?: Record // temp prop for backward compatability + initialStrings?: Record // temp prop for backward compatibility } export function StringsContextProvider(props: StringsContextProviderProps): React.ReactElement { diff --git a/web/src/ar/scripts/strings/generateTypesCli.mjs b/web/src/ar/scripts/strings/generateTypesCli.mjs index 711e88695..59dc60a6b 100644 --- a/web/src/ar/scripts/strings/generateTypesCli.mjs +++ b/web/src/ar/scripts/strings/generateTypesCli.mjs @@ -18,4 +18,4 @@ import generateTypes from './generateTypes.cjs' await generateTypes() -console.log('✅ Generated type for string files succesfully!') +console.log('✅ Generated type for string files successfully!') diff --git a/web/src/cde-gitness/strings/strings.en.yaml b/web/src/cde-gitness/strings/strings.en.yaml index 6ad26af6f..0cdf8e126 100644 --- a/web/src/cde-gitness/strings/strings.en.yaml +++ b/web/src/cde-gitness/strings/strings.en.yaml @@ -44,7 +44,7 @@ sessionDuration: Last Started lastActivated: Last Activated deleteGitspaceTitle: Delete Gitspace '{{name}}' deleteGitspaceText: 'This action cannot be undone. Are you sure you want to proceed to delete?' -deleteSuccess: Gitspace deleted succesfully +deleteSuccess: Gitspace deleted successfully repositoryAndBranch: Repository & Branch importInto: Import Repository into Gitness status: Status diff --git a/web/src/framework/strings/StringsContextProvider.tsx b/web/src/framework/strings/StringsContextProvider.tsx index ef127f584..cb2ce36c6 100644 --- a/web/src/framework/strings/StringsContextProvider.tsx +++ b/web/src/framework/strings/StringsContextProvider.tsx @@ -22,7 +22,7 @@ import { StringsContext, StringsContextValue } from './StringsContext' export interface StringsContextProviderProps extends Pick { children: React.ReactNode // eslint-disable-next-line @typescript-eslint/no-explicit-any - initialStrings?: Record // temp prop for backward compatability + initialStrings?: Record // temp prop for backward compatibility } export function StringsContextProvider(props: StringsContextProviderProps): React.ReactElement { diff --git a/web/src/framework/strings/stringTypes.ts b/web/src/framework/strings/stringTypes.ts index c6efa2c13..70ab898e7 100644 --- a/web/src/framework/strings/stringTypes.ts +++ b/web/src/framework/strings/stringTypes.ts @@ -151,7 +151,7 @@ export interface StringsMap { cancelImportConfirm: string cancelledImport: string changePassword: string - changePasswordSuccesfully: string + changePasswordSuccessfully: string changeRepoVis: string changeRepoVisContent: string changeRole: string diff --git a/web/src/i18n/strings.en.yaml b/web/src/i18n/strings.en.yaml index 1fb9b968a..58509335e 100644 --- a/web/src/i18n/strings.en.yaml +++ b/web/src/i18n/strings.en.yaml @@ -639,7 +639,7 @@ expired: Expired expirationDate: Expiration Date created: Created thisRefHas: 'This {isTag|true:tag,branch} has' -changePasswordSuccesfully: Password changed successfully +changePasswordSuccessfully: Password changed successfully applyChanges: Apply Changes showMore: View more showLess: View less diff --git a/web/src/pages/ChangePassword/ChangePassword.tsx b/web/src/pages/ChangePassword/ChangePassword.tsx index 3dc90922c..74964d865 100644 --- a/web/src/pages/ChangePassword/ChangePassword.tsx +++ b/web/src/pages/ChangePassword/ChangePassword.tsx @@ -56,7 +56,7 @@ const ChangePassword = () => { password: values.newPassword }) - showSuccess(getString('changePasswordSuccesfully')) + showSuccess(getString('changePasswordSuccessfully')) history.goBack() } catch (error) { showError(getErrorMessage(error)) diff --git a/web/src/pages/PullRequest/useGetPullRequestInfo.ts b/web/src/pages/PullRequest/useGetPullRequestInfo.ts index b54fd840e..8880c27f0 100644 --- a/web/src/pages/PullRequest/useGetPullRequestInfo.ts +++ b/web/src/pages/PullRequest/useGetPullRequestInfo.ts @@ -29,12 +29,12 @@ import { normalizeGitRef } from 'utils/GitUtils' /** * This hook abstracts data handling for a pull request. It's used as a * centralized data store for all tabs in Pull Request page. The hook - * fetches neccessary repository metadata, poll/refetch request metadata + * fetches necessary repository metadata, poll/refetch request metadata * for updates, cache data, etc... * * We use Atom to reduce React rendering cycles. Data could be re-fetched, * but their reference only updated only if the incoming one is different - * from cache. This optimization reduces unneccessary React state updates, + * from cache. This optimization reduces unnecessary React state updates, * hence improves rendering pipeline. * * The abstraction allows Pull Request tabs to do less data handling and diff --git a/web/src/pages/RepositoryFileEdit/FileEditor/FileEditor.tsx b/web/src/pages/RepositoryFileEdit/FileEditor/FileEditor.tsx index e7696cb20..aedb93905 100644 --- a/web/src/pages/RepositoryFileEdit/FileEditor/FileEditor.tsx +++ b/web/src/pages/RepositoryFileEdit/FileEditor/FileEditor.tsx @@ -44,7 +44,7 @@ import { makeDiffRefs } from 'utils/GitUtils' import { useStrings } from 'framework/strings' -import { filenameToLanguage, FILE_SEPERATOR } from 'utils/Utils' +import { filenameToLanguage, FILE_SEPARATOR } from 'utils/Utils' import { useGetResourceContent } from 'hooks/useGetResourceContent' import { CommitModalButton } from 'components/CommitModalButton/CommitModalButton' import { DiffEditor } from 'components/SourceCodeEditor/MonacoSourceCodeEditor' @@ -63,7 +63,7 @@ function Editor({ resourceContent, repoMetadata, gitRef, resourcePath, isReposit const isNew = useMemo(() => !resourceContent || isDir(resourceContent), [resourceContent]) const [fileName, setFileName] = useState(isNew ? '' : resourceContent?.name || '') const [parentPath, setParentPath] = useState( - isNew ? resourcePath : resourcePath.split(FILE_SEPERATOR).slice(0, -1).join(FILE_SEPERATOR) + isNew ? resourcePath : resourcePath.split(FILE_SEPARATOR).slice(0, -1).join(FILE_SEPARATOR) ) const { getString } = useStrings() const { routes } = useAppContext() @@ -73,7 +73,7 @@ function Editor({ resourceContent, repoMetadata, gitRef, resourcePath, isReposit ) const [content, setContent] = useState(originalContent) const fileResourcePath = useMemo( - () => [(parentPath || '').trim(), (fileName || '').trim()].filter(p => !!p.trim()).join(FILE_SEPERATOR), + () => [(parentPath || '').trim(), (fileName || '').trim()].filter(p => !!p.trim()).join(FILE_SEPARATOR), [parentPath, fileName] ) const { data: folderContent, refetch: verifyFolder } = useGetResourceContent({ @@ -90,14 +90,14 @@ function Editor({ resourceContent, repoMetadata, gitRef, resourcePath, isReposit ) const [startVerifyFolder, setStartVerifyFolder] = useState(false) const rebuildPaths = useCallback(() => { - const _tokens = fileName.split(FILE_SEPERATOR).filter(part => !!part.trim()) + const _tokens = fileName.split(FILE_SEPARATOR).filter(part => !!part.trim()) const _fileName = ((_tokens.pop() as string) || '').trim() const _parentPath = parentPath - .split(FILE_SEPERATOR) + .split(FILE_SEPARATOR) .concat(_tokens) .map(p => p.trim()) .filter(part => !!part.trim()) - .join(FILE_SEPERATOR) + .join(FILE_SEPARATOR) if (_fileName) { const normalizedFilename = _fileName.trim() @@ -203,7 +203,7 @@ function Editor({ resourceContent, repoMetadata, gitRef, resourcePath, isReposit }} onBlur={rebuildPaths} onFocus={({ target }) => { - const value = (parentPath ? parentPath + FILE_SEPERATOR : '') + fileName + const value = (parentPath ? parentPath + FILE_SEPARATOR : '') + fileName setFileName(value) setParentPath('') setTimeout(() => { diff --git a/web/src/utils/Utils.ts b/web/src/utils/Utils.ts index 1b156307c..62a5d27e3 100644 --- a/web/src/utils/Utils.ts +++ b/web/src/utils/Utils.ts @@ -64,7 +64,7 @@ export const DEFAULT_DATE_FORMAT = 'MM/DD/YYYY hh:mm a' export const DEFAULT_BRANCH_NAME = 'main' export const REGEX_VALID_REPO_NAME = /^[a-zA-Z_][0-9a-zA-Z-_.$]*$/ export const SUGGESTED_BRANCH_NAMES = [DEFAULT_BRANCH_NAME, 'master'] -export const FILE_SEPERATOR = '/' +export const FILE_SEPARATOR = '/' export const INITIAL_ZOOM_LEVEL = 1 export const ZOOM_INC_DEC_LEVEL = 0.1