Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update gitconfig from UD #928

Merged
merged 6 commits into from
Sep 21, 2023
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
6 changes: 3 additions & 3 deletions .deps/dev.md
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@
| [`fs-constants@1.0.0`](https://github.com/mafintosh/fs-constants.git) | MIT | clearlydefined |
| [`fs-extra@9.1.0`](https://github.com/jprichardson/node-fs-extra) | MIT | clearlydefined |
| `fsevents@2.3.2` | | transitive dependency |
| [`function.prototype.name@1.1.5`](git://github.com/es-shims/Function.prototype.name.git) | MIT | clearlydefined |
| [`function.prototype.name@1.1.5`](git://github.com/es-shims/Function.prototype.name.git) | MIT | #10255 |
| [`functions-have-names@1.2.3`](git+https://github.com/inspect-js/functions-have-names.git) | MIT | clearlydefined |
| [`gauge@4.0.4`](https://github.com/npm/gauge.git) | ISC | clearlydefined |
| [`gensync@1.0.0-beta.2`](https://github.com/loganfsmyth/gensync.git) | MIT | clearlydefined |
Expand Down Expand Up @@ -799,7 +799,7 @@
| [`run-async@2.4.1`](https://github.com/SBoudrias/run-async.git) | MIT | clearlydefined |
| [`run-parallel@1.2.0`](git://github.com/feross/run-parallel.git) | MIT | clearlydefined |
| [`rxjs@7.8.1`](https://github.com/reactivex/rxjs.git) | Apache-2.0 | #5993 |
| [`safe-array-concat@1.0.0`](git+https://github.com/ljharb/safe-array-concat.git) | MIT | clearlydefined |
| [`safe-array-concat@1.0.0`](git+https://github.com/ljharb/safe-array-concat.git) | MIT | #10335 |
| [`safe-regex-test@1.0.0`](git+https://github.com/ljharb/safe-regex-test.git) | MIT | clearlydefined |
| [`saxes@6.0.0`](https://github.com/lddubeau/saxes.git) | ISC | clearlydefined |
| [`schema-utils@4.2.0`](https://github.com/webpack/schema-utils.git) | MIT | #8986 |
Expand Down Expand Up @@ -836,7 +836,7 @@
| [`string-width-cjs@4.2.3`](https://github.com/sindresorhus/string-width.git) | MIT | transitive dependency |
| [`string-width@4.2.3`](https://github.com/sindresorhus/string-width.git) | MIT | clearlydefined |
| [`string.prototype.matchall@4.0.8`](git+https://github.com/es-shims/String.prototype.matchAll.git) | MIT | #4571 |
| [`string.prototype.trim@1.2.7`](git://github.com/es-shims/String.prototype.trim.git) | MIT | clearlydefined |
| [`string.prototype.trim@1.2.7`](git://github.com/es-shims/String.prototype.trim.git) | MIT | #10361 |
| [`string.prototype.trimend@1.0.6`](git://github.com/es-shims/String.prototype.trimEnd.git) | MIT | #4564 |
| [`string.prototype.trimstart@1.0.6`](git://github.com/es-shims/String.prototype.trimStart.git) | MIT | #4647 |
| [`strip-ansi-cjs@6.0.1`](https://github.com/chalk/strip-ansi.git) | MIT | transitive dependency |
Expand Down
9 changes: 5 additions & 4 deletions .deps/prod.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
| [`@babel/runtime@7.22.10`](https://github.com/babel/babel.git) | MIT | #8730 |
| [`@devfile/api@2.2.1-alpha-1667236163`](https://github.com/devfile/api.git) | Apache-2.0 | clearlydefined |
| `@eclipse-che/api@7.72.0` | EPL-2.0 | ecd.che |
| [`@eclipse-che/che-devworkspace-generator@0.0.1-99986b8`](git+https://github.com/eclipse-che/che-devfile-registry.git) | EPL-2.0 | ecd.che |
| [`@eclipse-che/common@7.74.0-next`](https://github.com/eclipse-che/che-dashboard) | EPL-2.0 | ecd.che |
| [`@eclipse-che/dashboard-backend@7.74.0-next`](https://github.com/eclipse-che/che-dashboard) | EPL-2.0 | ecd.che |
| [`@eclipse-che/dashboard-frontend@7.74.0-next`](git://github.com/eclipse/che-dashboard.git) | EPL-2.0 | ecd.che |
| [`@eclipse-che/che-devworkspace-generator@7.75.0-next-50585f6`](git+https://github.com/eclipse-che/che-devfile-registry.git) | EPL-2.0 | ecd.che |
| [`@eclipse-che/common@7.75.0-next`](https://github.com/eclipse-che/che-dashboard) | EPL-2.0 | ecd.che |
| [`@eclipse-che/dashboard-backend@7.75.0-next`](https://github.com/eclipse-che/che-dashboard) | EPL-2.0 | ecd.che |
| [`@eclipse-che/dashboard-frontend@7.75.0-next`](git://github.com/eclipse/che-dashboard.git) | EPL-2.0 | ecd.che |
| [`@eclipse-che/devfile-converter@0.0.1-ff55f9a`](git+https://github.com/che-incubator/devfile-converter.git) | EPL-2.0 | ecd.che |
| [`@eclipse-che/workspace-client@0.0.1-1672830275`](https://github.com/eclipse/che-workspace-client) | EPL-2.0 | ecd.che |
| [`@fastify/accept-negotiator@1.1.0`](git+https://github.com/fastify/accept-negotiator.git) | MIT | clearlydefined |
Expand Down Expand Up @@ -256,6 +256,7 @@
| [`monaco-languages@1.10.0`](https://github.com/Microsoft/monaco-languages) | MIT | clearlydefined |
| [`mri@1.1.4`](https://github.com/lukeed/mri.git) | MIT | clearlydefined |
| [`ms@2.0.0`](https://github.com/zeit/ms.git) | MIT | clearlydefined |
| [`multi-ini@2.3.2`](git://github.com/evangelion1204/multi-ini.git) | MIT | clearlydefined |
| [`nanoid@3.3.6`](https://github.com/ai/nanoid.git) | MIT | #7571 |
| [`node-fetch@2.6.12`](https://github.com/bitinn/node-fetch.git) | MIT | #6954 |
| [`oauth-sign@0.9.0`](https://github.com/mikeal/oauth-sign) | Apache-2.0 | clearlydefined |
Expand Down
13 changes: 13 additions & 0 deletions packages/common/src/dto/api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,19 @@ export interface IDockerConfig {
resourceVersion?: string;
}

export interface IGitConfig {
resourceVersion?: string;
gitconfig: {
user: {
name: string;
email: string;
};
[section: string]: {
[key: string]: string;
};
};
}

export interface IWorkspacesDefaultPlugins {
editor: string;
plugins: string[];
Expand Down
3 changes: 2 additions & 1 deletion packages/dashboard-backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,14 @@
"@fastify/swagger": "^8.8.0",
"@fastify/swagger-ui": "1.9.2",
"@fastify/websocket": "^8.2.0",
"@kubernetes/client-node": "^0.18.0",
"@kubernetes/client-node": "^0.18.1",
"args": "^5.0.3",
"axios": "^0.21.4",
"fastify": "^4.21.0",
"fs-extra": "^11.1.1",
"https": "^1.0.0",
"js-yaml": "^4.0.0",
"multi-ini": "^2.3.2",
"node-fetch": "^2.6.7",
"querystring": "^0.2.1",
"reflect-metadata": "^0.1.13",
Expand Down
3 changes: 3 additions & 0 deletions packages/dashboard-backend/src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ import { registerWebsocket } from './routes/api/websocket';
import { registerYamlResolverRoute } from './routes/api/yamlResolver';
import { registerFactoryAcceptanceRedirect } from './routes/factoryAcceptanceRedirect';
import { registerWorkspaceRedirect } from './routes/workspaceRedirect';
import { registerGitConfigRoutes } from './routes/api/gitConfig';
import { registerGettingStartedSamplesRoutes } from './routes/api/gettingStartedSample';

export default async function buildApp(server: FastifyInstance): Promise<void> {
Expand Down Expand Up @@ -112,5 +113,7 @@ export default async function buildApp(server: FastifyInstance): Promise<void> {

registerPersonalAccessTokenRoutes(server);

registerGitConfigRoutes(server);

registerGettingStartedSamplesRoutes(isLocalRun(), server);
}
26 changes: 26 additions & 0 deletions packages/dashboard-backend/src/constants/schemas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,32 @@ export const dockerConfigSchema: JSONSchema7 = {
required: ['dockerconfig'],
};

export const gitConfigSchema: JSONSchema7 = {
type: 'object',
properties: {
gitconfig: {
type: 'object',
properties: {
user: {
type: 'object',
properties: {
name: {
type: 'string',
},
email: {
type: 'string',
},
},
},
},
},
resourceVersion: {
type: 'string',
},
},
required: ['gitconfig'],
};

export const devfileVersionSchema: JSONSchema7 = {
type: 'object',
properties: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import { DevWorkspaceApiService } from '../services/devWorkspaceApi';
import { DevWorkspaceTemplateApiService } from '../services/devWorkspaceTemplateApi';
import { DockerConfigApiService } from '../services/dockerConfigApi';
import { EventApiService } from '../services/eventApi';
import { GitConfigApiService } from '../services/gitConfigApi';
import { KubeConfigApiService } from '../services/kubeConfigApi';
import { LogsApiService } from '../services/logsApi';
import { PodApiService } from '../services/podApi';
Expand Down Expand Up @@ -50,6 +51,7 @@ describe('DevWorkspace client', () => {
expect(client.podApi).toBeInstanceOf(PodApiService);
expect(client.serverConfigApi).toBeInstanceOf(ServerConfigApiService);
expect(client.userProfileApi).toBeInstanceOf(UserProfileApiService);
expect(client.gitConfigApi).toBeInstanceOf(GitConfigApiService);
expect(client.gettingStartedSampleApi).toBeInstanceOf(GettingStartedSamplesApiService);
});
});
13 changes: 10 additions & 3 deletions packages/dashboard-backend/src/devworkspaceClient/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,28 +15,31 @@ import { DevWorkspaceApiService } from './services/devWorkspaceApi';
import { DevWorkspaceTemplateApiService } from './services/devWorkspaceTemplateApi';
import { DockerConfigApiService } from './services/dockerConfigApi';
import { EventApiService } from './services/eventApi';
import { GettingStartedSamplesApiService } from './services/gettingStartedSamplesApi';
import { GitConfigApiService } from './services/gitConfigApi';
import { KubeConfigApiService } from './services/kubeConfigApi';
import { PodmanApiService } from './services/podmanApi';
import { LogsApiService } from './services/logsApi';
import { PersonalAccessTokenService } from './services/personalAccessTokenApi';
import { PodApiService } from './services/podApi';
import { PodmanApiService } from './services/podmanApi';
import { ServerConfigApiService } from './services/serverConfigApi';
import { UserProfileApiService } from './services/userProfileApi';
import { IGettingStartedSampleApi, IPodmanApi } from './types/index';
import {
IDevWorkspaceApi,
IDevWorkspaceClient,
IDevWorkspaceTemplateApi,
IDockerConfigApi,
IEventApi,
IGettingStartedSampleApi,
IGitConfigApi,
IKubeConfigApi,
ILogsApi,
IPersonalAccessTokenApi,
IPodApi,
IPodmanApi,
IServerConfigApi,
IUserProfileApi,
} from './types';
import { GettingStartedSamplesApiService } from './services/gettingStartedSamplesApi';

export * from './types';

Expand Down Expand Up @@ -91,6 +94,10 @@ export class DevWorkspaceClient implements IDevWorkspaceClient {
return new PersonalAccessTokenService(this.kubeConfig);
}

get gitConfigApi(): IGitConfigApi {
return new GitConfigApiService(this.kubeConfig);
}

get gettingStartedSampleApi(): IGettingStartedSampleApi {
return new GettingStartedSamplesApiService(this.kubeConfig);
}
Expand Down
Loading