Skip to content

Commit

Permalink
Merge branch 'main' into feat-gitlab-tx-inc
Browse files Browse the repository at this point in the history
  • Loading branch information
klesh authored Sep 11, 2024
2 parents 3c6d9fd + 550002e commit 387ed8e
Show file tree
Hide file tree
Showing 15 changed files with 677 additions and 525 deletions.
13 changes: 4 additions & 9 deletions backend/plugins/webhook/api/deployments.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import (
"crypto/md5"
"fmt"
"net/http"
"strings"
"time"

"github.com/apache/incubator-devlake/core/dal"
Expand Down Expand Up @@ -135,20 +134,16 @@ func CreateDeploymentAndDeploymentCommits(connection *models.WebhookConnection,
request.Environment = devops.PRODUCTION
}
duration := float64(request.FinishedDate.Sub(*request.StartedDate).Milliseconds() / 1e3)
name := request.Name
if name == "" {
var commitShaList []string
for _, commit := range request.DeploymentCommits {
commitShaList = append(commitShaList, commit.CommitSha)
}
name = fmt.Sprintf(`deploy %s to %s`, strings.Join(commitShaList, ","), request.Environment)
}
createdDate := time.Now()
if request.CreatedDate != nil {
createdDate = *request.CreatedDate
} else if request.StartedDate != nil {
createdDate = *request.StartedDate
}
name := request.Name
if name == "" {
name = fmt.Sprintf(`deploy to %s at %s`, request.Environment, createdDate.Format(time.RFC3339))
}

// prepare deploymentCommits and deployment records
// queuedDuration := dateInfo.CalculateQueueDuration()
Expand Down
9 changes: 8 additions & 1 deletion config-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@
"dependencies": {
"@ahooksjs/use-url-state": "^3.5.1",
"@ant-design/icons": "^5.3.0",
"@fontsource/roboto": "^5.0.14",
"@mints/miller-columns": "^2.0.0-beta.1",
"@mui/icons-material": "^5.16.7",
"@mui/material": "^5.16.7",
"@mui/styled-engine-sc": "^6.0.0-alpha.18",
"@reduxjs/toolkit": "^2.2.1",
"ahooks": "^3.7.10",
"antd": "^5.14.2",
Expand All @@ -34,7 +39,6 @@
"dayjs": "^1.11.10",
"file-saver": "^2.0.5",
"lodash": "^4.17.21",
"miller-columns-select": "1.4.1",
"react": "^18.2.0",
"react-copy-to-clipboard": "^5.1.0",
"react-dom": "^18.2.0",
Expand Down Expand Up @@ -69,5 +73,8 @@
"typescript": "^5.1.6",
"vite": "^5.1.4",
"vite-plugin-svgr": "^4.2.0"
},
"resolutions": {
"@mui/styled-engine": "npm:@mui/styled-engine-sc@^6.0.0-alpha.18"
}
}
2 changes: 1 addition & 1 deletion config-ui/src/api/scope/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export const searchRemote = (
plugin: string,
connectionId: ID,
data: SearchRemoteQuery,
): Promise<{ children: RemoteScope[]; count: number }> =>
): Promise<{ children: RemoteScope[]; page: number; pageSize: number }> =>
request(`/plugins/${plugin}/connections/${connectionId}/search-remote-scopes`, {
method: 'get',
data,
Expand Down
8 changes: 4 additions & 4 deletions config-ui/src/app/routrer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ const PATH_PREFIX = import.meta.env.DEVLAKE_PATH_PREFIX ?? '/';

export const router = createBrowserRouter(
[
{
path: 'db-migrate',
element: <DBMigrate />,
},
{
path: '/',
element: <App />,
Expand All @@ -54,10 +58,6 @@ export const router = createBrowserRouter(
index: true,
element: <Navigate to="projects" />,
},
{
path: 'db-migrate',
element: <DBMigrate />,
},
{
path: 'onboard',
element: <Onboard />,
Expand Down
2 changes: 1 addition & 1 deletion config-ui/src/features/connections/slice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const initialState: {
connections: IConnection[];
webhooks: IWebhook[];
} = {
status: 'idle',
status: 'loading',
plugins: [],
connections: [],
webhooks: [],
Expand Down
2 changes: 1 addition & 1 deletion config-ui/src/features/onboard/slice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export const done = createAsyncThunk('onboard/done', async (_, { getState }) =>
});

const initialState: { status: IStatus; error?: unknown; data: DataType } = {
status: 'idle',
status: 'loading',
data: {
initial: true,
step: 0,
Expand Down
2 changes: 1 addition & 1 deletion config-ui/src/features/version/slice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const initialState: {
error?: unknown;
version: string;
} = {
status: 'idle',
status: 'loading',
version: '',
};

Expand Down
Loading

0 comments on commit 387ed8e

Please sign in to comment.