Skip to content

Commit

Permalink
Merge branch 'main' into pipe-22241-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
cjlee01 authored Nov 25, 2024
2 parents 5000feb + 59c75c4 commit 7394461
Show file tree
Hide file tree
Showing 290 changed files with 12,189 additions and 576 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/build-and-deploy-storybook.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
name: PR Checks
on:
push:
pull_request_target:
types:
- opened
- synchronize
- reopened
branches:
- main

jobs:
Lint:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- uses: pnpm/action-setup@v4
- run: pnpm deps
- run: pnpm lint
Expand All @@ -15,6 +24,8 @@ jobs:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- uses: pnpm/action-setup@v4
- run: pnpm deps
- run: pnpm pretty
Expand All @@ -23,6 +34,8 @@ jobs:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- uses: pnpm/action-setup@v4
- run: pnpm deps
- run: pnpm build
Expand Down
21 changes: 10 additions & 11 deletions CONTRIBUTOR_LICENSE_AGREEMENT.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
## Harness Inc. Individual Contributor License Agreement


Thank you for your interest in contributing to products or services made available by Harness Inc. or its affiliates (“Harness”). This Individual Contributor License Agreement (“Agreement”) sets out the terms governing your Contributions (as defined below). If you have any questions respecting this Agreement, please contact Harness at [email protected].
Thank you for your interest in contributing to products or services made available by Harness Inc. or its affiliates (“Harness”). This Individual Contributor License Agreement (“Agreement”) sets out the terms governing your Contributions (as defined below). If you have any questions respecting this Agreement, please contact Harness at [email protected].

You agree that the following terms apply to all of your past, present and future Contributions. Except for the licenses granted in this Agreement, you retain all of your right, title and interest in and to your Contributions.

1. Definitions

1.1 "You" (or "Your") shall mean the copyright owner or legal entity authorized by the copyright owner that is making this Agreement with Harness Inc. and its affiliates (collectively “Harness”). For legal entities, the entity making a Contribution and all other entities that control, are controlled by, or are under common control with that entity are considered to be a single Contributor. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
1.1 "You" (or "Your") shall mean the copyright owner or legal entity authorized by the copyright owner that is making this Agreement with Harness Inc. and its affiliates (collectively “Harness”). For legal entities, the entity making a Contribution and all other entities that control, are controlled by, or are under common control with that entity are considered to be a single Contributor. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.

1.2 "Contribution" shall mean any original work of authorship, including any modifications or additions to an existing work, that is intentionally submitted by You to Harness for inclusion in, or documentation of, any of the products or services owned or managed by Harness (the "Work"). For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to Harness or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, Harness for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by You as "Not a Contribution." You agree that the Agreement applies to all of your past, present and future Contributions.
1.2 "Contribution" shall mean any original work of authorship, including any modifications or additions to an existing work, that is intentionally submitted by You to Harness for inclusion in, or documentation of, any of the products or services owned or managed by Harness (the "Work"). For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to Harness or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, Harness for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by You as "Not a Contribution." You agree that the Agreement applies to all of your past, present and future Contributions.

2. Grant of Licenses

2.1 Grant of Copyright License. You hereby grant to Harness and to recipients and/or users of software distributed and/or made available by Harness a perpetual, worldwide, non-exclusive, no-charge, fully-paid, royalty-free, irrevocable, transferable copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, sublicense, and distribute Your Contributions and such derivative works.
2.1 Grant of Copyright License. You hereby grant to Harness and to recipients and/or users of software distributed and/or made available by Harness a perpetual, worldwide, non-exclusive, no-charge, fully-paid, royalty-free, irrevocable, transferable copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, sublicense, and distribute Your Contributions and such derivative works.

2.2 Grant of Patent License. You hereby grant to Harness and to recipients and/or users of software distributed and/or made available by Harness a perpetual, worldwide, non-exclusive, no-charge, fully-paid, royalty-free, irrevocable (except as stated in this section), transferable patent license to make, have made, use, offer to sell, sell, import, sublicense, and otherwise transfer the Work, where such license applies only to those patent claims licensable by You that are necessarily infringed by Your Contribution(s) alone or by combination of Your Contribution(s) with the Work to which such Contribution(s) were submitted. If any entity institutes patent litigation against You or any other entity (including a cross-claim or counterclaim in a lawsuit) alleging that your Contribution, or the Work to which you have contributed, constitutes direct or contributory patent infringement, then any patent licenses granted to that entity under this Agreement for that Contribution or Work shall terminate as of the date such litigation is filed.
2.2 Grant of Patent License. You hereby grant to Harness and to recipients and/or users of software distributed and/or made available by Harness a perpetual, worldwide, non-exclusive, no-charge, fully-paid, royalty-free, irrevocable (except as stated in this section), transferable patent license to make, have made, use, offer to sell, sell, import, sublicense, and otherwise transfer the Work, where such license applies only to those patent claims licensable by You that are necessarily infringed by Your Contribution(s) alone or by combination of Your Contribution(s) with the Work to which such Contribution(s) were submitted. If any entity institutes patent litigation against You or any other entity (including a cross-claim or counterclaim in a lawsuit) alleging that your Contribution, or the Work to which you have contributed, constitutes direct or contributory patent infringement, then any patent licenses granted to that entity under this Agreement for that Contribution or Work shall terminate as of the date such litigation is filed.

2.3 Moral Rights. To the fullest extent permitted under applicable law, you hereby waive, and agree not to assert, all of your “moral rights” in or relating to your Contributions for the benefit of Harness, its assigns, and their respective direct and indirect sublicensees.

Expand All @@ -27,12 +26,12 @@ You agree that the following terms apply to all of your past, present and future

3.3 You represent that none of Your Contributions includes any third party copyrights, patents, trade secrets, licenses or other restrictions.

3.4 If You are an individual employed by another individual or a legal entity, You represent that Your employer has waived any of its rights in Your Contributions.
3.4 If You are an individual employed by another individual or a legal entity, You represent that Your employer has waived any of its rights in Your Contributions.

3.5 If you are a legal entity, You represent further that each employee of the legal entity is authorized to submit Contributions on behalf of the legal entity.
3.5 If you are a legal entity, You represent further that each employee of the legal entity is authorized to submit Contributions on behalf of the legal entity.

4. You are not expected to provide support for Your Contributions, except to the extent You desire to provide support. You may provide support for free, for a fee, or not at all. Unless required by applicable law or agreed to in writing, You provide Your Contributions on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE.
4. You are not expected to provide support for Your Contributions, except to the extent You desire to provide support. You may provide support for free, for a fee, or not at all. Unless required by applicable law or agreed to in writing, You provide Your Contributions on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE.

5. No Obligation. You acknowledge that Harness is under no obligation to use or incorporate your Contributions into any of the Work. The decision to use or incorporate your Contributions into any of the Work will be made at the sole discretion of Harness or its authorized delegates.
5. No Obligation. You acknowledge that Harness is under no obligation to use or incorporate your Contributions into any of the Work. The decision to use or incorporate your Contributions into any of the Work will be made at the sole discretion of Harness or its authorized delegates.

6. General. No failure or delay by you or Harness in exercising any right under this Agreement shall constitute a waiver of that right. Other than as expressly stated herein, the remedies herein are in addition to, and not exclusive of, any other remedies of a party at law or in equity. Should any provision of this Agreement be held by a court to be unenforceable, such provision shall be modified by the court and interpreted so as to best to accomplish the objectives of the original provision to the fullest extent permitted by law, and the remaining provisions of this Agreement shall remain in full force and effect. This Agreement shall be governed exclusively by, and construed exclusively in accordance with, the laws of the United States and the State of California, without regard to its conflict of laws provisions. The state and federal courts located in San Francisco, California shall have exclusive jurisdiction to adjudicate any dispute arising out of or relating to this Agreement. You agree that Harness may assign this Agreement, and all of its rights, obligations and licenses hereunder. This Agreement constitutes the entire agreement between the parties as to its subject matter and supersedes all prior and contemporaneous agreements, proposals or representations, written or oral, concerning the subject matter of this Agreement. No modification, amendment or waiver of any provision of this Agreement shall be effective unless in writing and signed by the party against whom the modification, amendment or waiver is to be asserted. This Agreement does not supersede or amend any existing agreement between the parties for the purchase or use of either party’s products or services.
6. General. No failure or delay by you or Harness in exercising any right under this Agreement shall constitute a waiver of that right. Other than as expressly stated herein, the remedies herein are in addition to, and not exclusive of, any other remedies of a party at law or in equity. Should any provision of this Agreement be held by a court to be unenforceable, such provision shall be modified by the court and interpreted so as to best to accomplish the objectives of the original provision to the fullest extent permitted by law, and the remaining provisions of this Agreement shall remain in full force and effect. This Agreement shall be governed exclusively by, and construed exclusively in accordance with, the laws of the United States and the State of California, without regard to its conflict of laws provisions. The state and federal courts located in San Francisco, California shall have exclusive jurisdiction to adjudicate any dispute arising out of or relating to this Agreement. You agree that Harness may assign this Agreement, and all of its rights, obligations and licenses hereunder. This Agreement constitutes the entire agreement between the parties as to its subject matter and supersedes all prior and contemporaneous agreements, proposals or representations, written or oral, concerning the subject matter of this Agreement. No modification, amendment or waiver of any provision of this Agreement shall be effective unless in writing and signed by the party against whom the modification, amendment or waiver is to be asserted. This Agreement does not supersede or amend any existing agreement between the parties for the purchase or use of either party’s products or services.
1 change: 1 addition & 0 deletions apps/gitness/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
},
"devDependencies": {
"@eslint/js": "^9.9.0",
"@git-diff-view/react": "^0.0.16",
"@testing-library/dom": "^10.4.0",
"@testing-library/react": "^13.4.0",
"@types/event-source-polyfill": "^1.0.0",
Expand Down
Binary file added apps/gitness/public/fonts/InterVariable.ttf
Binary file not shown.
15 changes: 13 additions & 2 deletions apps/gitness/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import { queryClient } from './framework/queryClient'
import PipelineLayout from './layouts/PipelineStudioLayout'
import PullRequestLayout from './layouts/PullRequestLayout'
import RepoLayout from './layouts/RepoLayout'
import ReposListPage from './pages-v2/repo/repo-list'
import CreateProject from './pages/create-project'
import { EmptyPage } from './pages/empty-page'
import { Execution } from './pages/execution/execution-details'
Expand Down Expand Up @@ -55,7 +56,7 @@ import { CreateRepo } from './pages/repo/repo-create-page'
import { RepoFiles } from './pages/repo/repo-files'
import { RepoHeader } from './pages/repo/repo-header'
import { RepoImportContainer } from './pages/repo/repo-import-container'
import ReposListPage from './pages/repo/repo-list'
import ReposListPageV1 from './pages/repo/repo-list'
import { RepoSettingsGeneralPageContainer } from './pages/repo/repo-settings-general-container'
import { RepoSummaryList } from './pages/repo/repo-summary'
import { SignIn } from './pages/signin'
Expand Down Expand Up @@ -104,6 +105,16 @@ export default function App() {
{
path: '/',
element: <RootWrapper />,
children: [
{
path: ':spaceId/repos',
element: <ReposListPage />
}
]
},
{
path: '/v1',
element: <RootWrapper />,
children: [
{
index: true,
Expand Down Expand Up @@ -136,7 +147,7 @@ export default function App() {
children: [
{
path: ':spaceId/repos',
element: <ReposListPage />
element: <ReposListPageV1 />
},
{
path: ':spaceId/repos/:repoId',
Expand Down
20 changes: 15 additions & 5 deletions apps/gitness/src/components/RootWrapper.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,25 @@
import { SandboxRoot } from '@harnessio/views'
import { SandboxRoot } from '@harnessio/ui/views'

import { useAppContext } from '../framework/context/AppContext'
import { useGetSpaceURLParam } from '../framework/hooks/useGetSpaceParam'

// import { useGetSpaceURLParam } from '../framework/hooks/useGetSpaceParam'

const RootWrapper = () => {
const { currentUser, spaces } = useAppContext()
const spaceId = useGetSpaceURLParam()
const {
currentUser
// spaces
} = useAppContext()
// const spaceId = useGetSpaceURLParam()

return (
<>
<SandboxRoot currentUser={currentUser} currentSpaceId={spaceId || spaces?.[0]?.identifier} />
<SandboxRoot
currentUser={currentUser}
pinnedMenu={null}
recentMenu={[]}
changePinnedMenu={_data => {}}
changeRecentMenu={_data => {}}
/>
</>
)
}
Expand Down
63 changes: 63 additions & 0 deletions apps/gitness/src/pages-v2/repo/repo-list.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
import { useCallback, useEffect, useMemo } from 'react'

import { parseAsInteger, useQueryState } from 'nuqs'

import { ListReposOkResponse, useListReposQuery } from '@harnessio/code-service-client'
import { SandboxRepoListPage } from '@harnessio/ui/views'

import { useGetSpaceURLParam } from '../../framework/hooks/useGetSpaceParam'
import useSpaceSSE from '../../framework/hooks/useSpaceSSE'
import { useDebouncedQueryState } from '../../hooks/useDebouncedQueryState'
import { SSEEvent } from '../../types'
import { useRepoStore } from './stores/repo-store'

export default function ReposListPage() {
const space = useGetSpaceURLParam() ?? ''
const { setRepositories, page, setPage } = useRepoStore()

/* Query and Pagination */
const [query] = useDebouncedQueryState('query')
const [queryPage, setQueryPage] = useQueryState('page', parseAsInteger.withDefault(1))

const { data: { body: repoData, headers } = {}, refetch } = useListReposQuery(
{
queryParams: { page, query },
space_ref: `${space}/+`
},
{ retry: false }
)

useEffect(() => {
if (repoData) {
setRepositories(repoData, headers)
}
}, [repoData, headers, setRepositories])

useEffect(() => {
setQueryPage(page)
}, [queryPage, page, setPage])

const isRepoStillImporting: boolean = useMemo(() => {
return repoData?.some(repository => repository.importing) ?? false
}, [repoData])

const onEvent = useCallback(
(_eventRepos: ListReposOkResponse) => {
if (repoData?.some(repository => repository.importing)) {
refetch()
}
},
[repoData]
)

const events = useMemo(() => [SSEEvent.REPO_IMPORTED], [])

useSpaceSSE({
space,
events,
onEvent,
shouldRun: isRepoStillImporting
})

return <SandboxRepoListPage useRepoStore={useRepoStore} />
}
Loading

0 comments on commit 7394461

Please sign in to comment.