@oneuptime/common 7.0.3010 → 7.0.3022
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Models/DatabaseModels/CopilotAction.ts +232 -38
- package/Models/DatabaseModels/CopilotActionTypePriority.ts +340 -0
- package/Models/DatabaseModels/CopilotPullRequest.ts +1 -0
- package/Models/DatabaseModels/Index.ts +2 -0
- package/Server/API/CopilotActionAPI.ts +251 -7
- package/Server/API/StatusAPI.ts +0 -2
- package/Server/API/StatusPageAPI.ts +1 -1
- package/Server/API/TelemetryAPI.ts +1 -1
- package/Server/Infrastructure/Postgres/SchemaMigrations/1725291476867-MigrationName.ts +51 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1725357719072-MigrationName.ts +23 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1725360199561-MigrationName.ts +13 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1725379949648-MigrationName.ts +17 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/Index.ts +8 -0
- package/Server/Services/CopilotActionTypePriorityService.ts +66 -0
- package/Server/Services/CopilotCodeRepositoryService.ts +36 -0
- package/Server/Services/Index.ts +2 -0
- package/Server/Services/ServiceCatalogService.ts +1 -1
- package/Server/Services/TelemetryServiceService.ts +1 -1
- package/Server/Types/Database/Permissions/AccessControlPermission.ts +1 -1
- package/Server/Types/Workflow/Components/Email.ts +32 -25
- package/Server/Utils/CodeRepository/CodeRepository.ts +11 -14
- package/Server/Utils/CodeRepository/CodeRepositoryFile.ts +1 -7
- package/Tests/Types/ArrayUtil.test.ts +1 -1
- package/Types/Copilot/CopilotActionProps/DirectoryActionProp.ts +3 -0
- package/Types/Copilot/CopilotActionProps/ExceptionActionProp.ts +4 -0
- package/Types/Copilot/CopilotActionProps/FileActionProp.ts +7 -0
- package/Types/Copilot/CopilotActionProps/FunctionActionProp.ts +5 -0
- package/Types/Copilot/CopilotActionProps/Index.ts +96 -0
- package/Types/Copilot/CopilotActionProps/SpanActionProp.ts +4 -0
- package/Types/Copilot/CopilotActionStatus.ts +109 -1
- package/Types/Copilot/CopilotActionType.ts +203 -1
- package/Types/Icon/IconProp.ts +1 -0
- package/Types/Permission.ts +26 -0
- package/Types/Workflow/Components/Email.ts +4 -4
- package/UI/Components/Alerts/Alert.tsx +1 -1
- package/UI/Components/Icon/Icon.tsx +8 -0
- package/UI/Components/Workflow/WorkflowStatus.tsx +2 -2
- package/{Types/ArrayUtil.ts → Utils/Array.ts} +1 -1
- package/build/dist/Models/DatabaseModels/CopilotAction.js +237 -40
- package/build/dist/Models/DatabaseModels/CopilotAction.js.map +1 -1
- package/build/dist/Models/DatabaseModels/CopilotActionTypePriority.js +358 -0
- package/build/dist/Models/DatabaseModels/CopilotActionTypePriority.js.map +1 -0
- package/build/dist/Models/DatabaseModels/CopilotPullRequest.js +1 -0
- package/build/dist/Models/DatabaseModels/CopilotPullRequest.js.map +1 -1
- package/build/dist/Models/DatabaseModels/Index.js +2 -0
- package/build/dist/Models/DatabaseModels/Index.js.map +1 -1
- package/build/dist/Server/API/CopilotActionAPI.js +185 -9
- package/build/dist/Server/API/CopilotActionAPI.js.map +1 -1
- package/build/dist/Server/API/StatusAPI.js +0 -1
- package/build/dist/Server/API/StatusAPI.js.map +1 -1
- package/build/dist/Server/API/StatusPageAPI.js +1 -1
- package/build/dist/Server/API/StatusPageAPI.js.map +1 -1
- package/build/dist/Server/API/TelemetryAPI.js +1 -1
- package/build/dist/Server/API/TelemetryAPI.js.map +1 -1
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1725291476867-MigrationName.js +24 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1725291476867-MigrationName.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1725357719072-MigrationName.js +14 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1725357719072-MigrationName.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1725360199561-MigrationName.js +12 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1725360199561-MigrationName.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1725379949648-MigrationName.js +12 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1725379949648-MigrationName.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js +8 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js.map +1 -1
- package/build/dist/Server/Services/CopilotActionTypePriorityService.js +45 -0
- package/build/dist/Server/Services/CopilotActionTypePriorityService.js.map +1 -0
- package/build/dist/Server/Services/CopilotCodeRepositoryService.js +22 -0
- package/build/dist/Server/Services/CopilotCodeRepositoryService.js.map +1 -1
- package/build/dist/Server/Services/Index.js +2 -0
- package/build/dist/Server/Services/Index.js.map +1 -1
- package/build/dist/Server/Services/ServiceCatalogService.js +1 -1
- package/build/dist/Server/Services/ServiceCatalogService.js.map +1 -1
- package/build/dist/Server/Services/TelemetryServiceService.js +1 -1
- package/build/dist/Server/Services/TelemetryServiceService.js.map +1 -1
- package/build/dist/Server/Types/Database/Permissions/AccessControlPermission.js +1 -1
- package/build/dist/Server/Types/Database/Permissions/AccessControlPermission.js.map +1 -1
- package/build/dist/Server/Types/Workflow/Components/Email.js +26 -27
- package/build/dist/Server/Types/Workflow/Components/Email.js.map +1 -1
- package/build/dist/Server/Utils/CodeRepository/CodeRepository.js +6 -13
- package/build/dist/Server/Utils/CodeRepository/CodeRepository.js.map +1 -1
- package/build/dist/Tests/Types/ArrayUtil.test.js +1 -1
- package/build/dist/Tests/Types/ArrayUtil.test.js.map +1 -1
- package/build/dist/Types/Copilot/CopilotActionProps/DirectoryActionProp.js +2 -0
- package/build/dist/Types/Copilot/CopilotActionProps/DirectoryActionProp.js.map +1 -0
- package/build/dist/Types/Copilot/CopilotActionProps/ExceptionActionProp.js +2 -0
- package/build/dist/Types/Copilot/CopilotActionProps/ExceptionActionProp.js.map +1 -0
- package/build/dist/Types/Copilot/CopilotActionProps/FileActionProp.js +2 -0
- package/build/dist/Types/Copilot/CopilotActionProps/FileActionProp.js.map +1 -0
- package/build/dist/Types/Copilot/CopilotActionProps/FunctionActionProp.js +2 -0
- package/build/dist/Types/Copilot/CopilotActionProps/FunctionActionProp.js.map +1 -0
- package/build/dist/Types/Copilot/CopilotActionProps/Index.js +64 -0
- package/build/dist/Types/Copilot/CopilotActionProps/Index.js.map +1 -0
- package/build/dist/Types/Copilot/CopilotActionProps/SpanActionProp.js +2 -0
- package/build/dist/Types/Copilot/CopilotActionProps/SpanActionProp.js.map +1 -0
- package/build/dist/Types/Copilot/CopilotActionStatus.js +89 -0
- package/build/dist/Types/Copilot/CopilotActionStatus.js.map +1 -1
- package/build/dist/Types/Copilot/CopilotActionType.js +165 -1
- package/build/dist/Types/Copilot/CopilotActionType.js.map +1 -1
- package/build/dist/Types/Icon/IconProp.js +1 -0
- package/build/dist/Types/Icon/IconProp.js.map +1 -1
- package/build/dist/Types/Permission.js +24 -0
- package/build/dist/Types/Permission.js.map +1 -1
- package/build/dist/Types/Workflow/Components/Email.js +4 -4
- package/build/dist/Types/Workflow/Components/Email.js.map +1 -1
- package/build/dist/UI/Components/Alerts/Alert.js +1 -1
- package/build/dist/UI/Components/Alerts/Alert.js.map +1 -1
- package/build/dist/UI/Components/Icon/Icon.js +3 -0
- package/build/dist/UI/Components/Icon/Icon.js.map +1 -1
- package/build/dist/UI/Components/Workflow/WorkflowStatus.js +2 -2
- package/build/dist/UI/Components/Workflow/WorkflowStatus.js.map +1 -1
- package/build/dist/{Types/ArrayUtil.js → Utils/Array.js} +1 -1
- package/build/dist/Utils/Array.js.map +1 -0
- package/package.json +2 -2
- package/build/dist/Types/ArrayUtil.js.map +0 -1
|
@@ -1,6 +1,114 @@
|
|
|
1
1
|
enum CopilotActionStatus {
|
|
2
|
+
// Processed States.
|
|
2
3
|
PR_CREATED = "Pull Request Created", // PR created and waiting for review
|
|
3
|
-
NO_ACTION_REQUIRED = "No Action Required", // No
|
|
4
|
+
NO_ACTION_REQUIRED = "No Action Required", // Code is all good. No action required. No PR created.
|
|
5
|
+
CANNOT_FIX = "Cannot Fix", // OneUptime Copilot tried to fix the issue but failed.
|
|
6
|
+
|
|
7
|
+
// Processing States
|
|
8
|
+
PROCESSING = "Processing", // Action is being processed.
|
|
9
|
+
|
|
10
|
+
// In Queue
|
|
11
|
+
IN_QUEUE = "In Queue", // Action is in queue.
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export interface CopilotActionStatusData {
|
|
15
|
+
status: CopilotActionStatus;
|
|
16
|
+
description: string;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export class CopilotActionStatusUtil {
|
|
20
|
+
public static getAllCopilotActionStatuses(): Array<CopilotActionStatus> {
|
|
21
|
+
return [
|
|
22
|
+
CopilotActionStatus.PR_CREATED,
|
|
23
|
+
CopilotActionStatus.NO_ACTION_REQUIRED,
|
|
24
|
+
CopilotActionStatus.CANNOT_FIX,
|
|
25
|
+
CopilotActionStatus.PROCESSING,
|
|
26
|
+
CopilotActionStatus.IN_QUEUE,
|
|
27
|
+
];
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
public static getCopilotActionStatus(status: string): CopilotActionStatus {
|
|
31
|
+
switch (status) {
|
|
32
|
+
case CopilotActionStatus.PR_CREATED:
|
|
33
|
+
return CopilotActionStatus.PR_CREATED;
|
|
34
|
+
case CopilotActionStatus.NO_ACTION_REQUIRED:
|
|
35
|
+
return CopilotActionStatus.NO_ACTION_REQUIRED;
|
|
36
|
+
case CopilotActionStatus.CANNOT_FIX:
|
|
37
|
+
return CopilotActionStatus.CANNOT_FIX;
|
|
38
|
+
case CopilotActionStatus.PROCESSING:
|
|
39
|
+
return CopilotActionStatus.PROCESSING;
|
|
40
|
+
case CopilotActionStatus.IN_QUEUE:
|
|
41
|
+
return CopilotActionStatus.IN_QUEUE;
|
|
42
|
+
default:
|
|
43
|
+
throw new Error(`Invalid CopilotActionStatus: ${status}`);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
public static isCopilotActionStatus(status: string): boolean {
|
|
48
|
+
return CopilotActionStatusUtil.getAllCopilotActionStatuses().includes(
|
|
49
|
+
status as CopilotActionStatus,
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
public static isCopilotActionStatusArray(statuses: Array<string>): boolean {
|
|
54
|
+
return statuses.every((status: string) => {
|
|
55
|
+
return CopilotActionStatusUtil.isCopilotActionStatus(status);
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// get processing status
|
|
60
|
+
public static getProcessingStatus(): CopilotActionStatus {
|
|
61
|
+
return CopilotActionStatus.PROCESSING;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// get in queue status
|
|
65
|
+
public static getInQueueStatus(): CopilotActionStatus {
|
|
66
|
+
return CopilotActionStatus.IN_QUEUE;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// get processed status
|
|
70
|
+
public static getProcessedStatus(): Array<CopilotActionStatus> {
|
|
71
|
+
return [
|
|
72
|
+
CopilotActionStatus.PR_CREATED,
|
|
73
|
+
CopilotActionStatus.NO_ACTION_REQUIRED,
|
|
74
|
+
CopilotActionStatus.CANNOT_FIX,
|
|
75
|
+
];
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
// get copilot actiomn status data
|
|
79
|
+
public static getCopilotActionStatusData(
|
|
80
|
+
status: CopilotActionStatus,
|
|
81
|
+
): CopilotActionStatusData {
|
|
82
|
+
switch (status) {
|
|
83
|
+
case CopilotActionStatus.PR_CREATED:
|
|
84
|
+
return {
|
|
85
|
+
status: CopilotActionStatus.PR_CREATED,
|
|
86
|
+
description: "Pull Request Created",
|
|
87
|
+
};
|
|
88
|
+
case CopilotActionStatus.NO_ACTION_REQUIRED:
|
|
89
|
+
return {
|
|
90
|
+
status: CopilotActionStatus.NO_ACTION_REQUIRED,
|
|
91
|
+
description: "No Action Required",
|
|
92
|
+
};
|
|
93
|
+
case CopilotActionStatus.CANNOT_FIX:
|
|
94
|
+
return {
|
|
95
|
+
status: CopilotActionStatus.CANNOT_FIX,
|
|
96
|
+
description: "Cannot Fix",
|
|
97
|
+
};
|
|
98
|
+
case CopilotActionStatus.PROCESSING:
|
|
99
|
+
return {
|
|
100
|
+
status: CopilotActionStatus.PROCESSING,
|
|
101
|
+
description: "Processing",
|
|
102
|
+
};
|
|
103
|
+
case CopilotActionStatus.IN_QUEUE:
|
|
104
|
+
return {
|
|
105
|
+
status: CopilotActionStatus.IN_QUEUE,
|
|
106
|
+
description: "In Queue",
|
|
107
|
+
};
|
|
108
|
+
default:
|
|
109
|
+
throw new Error(`Invalid CopilotActionStatus: ${status}`);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
4
112
|
}
|
|
5
113
|
|
|
6
114
|
export default CopilotActionStatus;
|
|
@@ -1,10 +1,212 @@
|
|
|
1
1
|
enum CopilotActionType {
|
|
2
2
|
IMPROVE_COMMENTS = "Improve Comments",
|
|
3
|
-
|
|
3
|
+
ADD_COMMENTS = "Add Comments",
|
|
4
|
+
|
|
5
|
+
IMPROVE_README = "Improve Readme",
|
|
6
|
+
ADD_README = "Add Readme",
|
|
7
|
+
|
|
4
8
|
FIX_GRAMMAR_AND_SPELLING = "Fix Grammar and Spelling",
|
|
5
9
|
IMPROVE_VARIABLE_NAMES = "Improve Variable Names",
|
|
6
10
|
REFACTOR_CODE = "Refactor Code",
|
|
11
|
+
|
|
7
12
|
WRITE_UNIT_TESTS = "Write Unit Tests",
|
|
13
|
+
IMPROVE_UNIT_TESTS = "Improve Unit Tests",
|
|
14
|
+
|
|
15
|
+
IMPROVE_LOGS = "Improve Logs",
|
|
16
|
+
ADD_LOGS = "Add Logs",
|
|
17
|
+
|
|
18
|
+
IMPROVE_SPANS = "Improve Spans",
|
|
19
|
+
ADD_SPANS = "Add Spans",
|
|
20
|
+
|
|
21
|
+
IMPROVE_METRICS = "Improve Metrics",
|
|
22
|
+
ADD_METRICS = "Add Metrics",
|
|
23
|
+
|
|
24
|
+
FIX_EXCEPTIONS = "Fix Exceptions",
|
|
25
|
+
FIX_PERFORMANCE_ISSUES = "Fix Performance Issues",
|
|
26
|
+
FIX_BUGS = "Fix Bugs",
|
|
27
|
+
|
|
28
|
+
// SETUP_ACTIONS
|
|
29
|
+
SETUP_OPEN_TELEMETRY = "Setup OpenTelemetry",
|
|
30
|
+
|
|
31
|
+
// Setup Unit Test Framework
|
|
32
|
+
SETUP_UNIT_TEST_FRAMEWORK = "Setup Unit Test Framework",
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export interface CopilotActionTypeData {
|
|
36
|
+
type: CopilotActionType;
|
|
37
|
+
description: string;
|
|
38
|
+
defaultPriority: number;
|
|
39
|
+
dependsOn: Array<CopilotActionType>;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export class CopilotActionTypeUtil {
|
|
43
|
+
public static getAllCopilotActionTypes(): Array<CopilotActionTypeData> {
|
|
44
|
+
return [
|
|
45
|
+
// Fix broken code.
|
|
46
|
+
{
|
|
47
|
+
type: CopilotActionType.FIX_EXCEPTIONS,
|
|
48
|
+
description: "Fix exceptions in your codebase",
|
|
49
|
+
defaultPriority: 1,
|
|
50
|
+
dependsOn: [CopilotActionType.SETUP_OPEN_TELEMETRY],
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
type: CopilotActionType.FIX_PERFORMANCE_ISSUES,
|
|
54
|
+
description: "Fix performance issues in your codebase",
|
|
55
|
+
defaultPriority: 1,
|
|
56
|
+
dependsOn: [CopilotActionType.SETUP_OPEN_TELEMETRY],
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
type: CopilotActionType.FIX_BUGS,
|
|
60
|
+
description: "Fix simple bugs and small issues in your codebase",
|
|
61
|
+
defaultPriority: 1,
|
|
62
|
+
dependsOn: [],
|
|
63
|
+
},
|
|
64
|
+
|
|
65
|
+
// Improve debugging.
|
|
66
|
+
|
|
67
|
+
// add logs, metircs and spans.
|
|
68
|
+
|
|
69
|
+
{
|
|
70
|
+
type: CopilotActionType.ADD_LOGS,
|
|
71
|
+
description: "Add OpenTelemetry logs in your codebase",
|
|
72
|
+
defaultPriority: 2,
|
|
73
|
+
dependsOn: [CopilotActionType.SETUP_OPEN_TELEMETRY],
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
type: CopilotActionType.ADD_SPANS,
|
|
77
|
+
description: "Add OpenTelemetry spans in your codebase",
|
|
78
|
+
defaultPriority: 2,
|
|
79
|
+
dependsOn: [CopilotActionType.SETUP_OPEN_TELEMETRY],
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
type: CopilotActionType.ADD_METRICS,
|
|
83
|
+
description: "Add OpenTelemetry metrics in your codebase",
|
|
84
|
+
defaultPriority: 2,
|
|
85
|
+
dependsOn: [CopilotActionType.SETUP_OPEN_TELEMETRY],
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
type: CopilotActionType.IMPROVE_LOGS,
|
|
89
|
+
description:
|
|
90
|
+
"Improve OpenTelemetry logs in your codebase where required to make debugging easier.",
|
|
91
|
+
defaultPriority: 2,
|
|
92
|
+
dependsOn: [CopilotActionType.SETUP_OPEN_TELEMETRY],
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
type: CopilotActionType.IMPROVE_SPANS,
|
|
96
|
+
description:
|
|
97
|
+
"Improve OpenTelemetry spans in your codebase where required to make debugging easier.",
|
|
98
|
+
defaultPriority: 2,
|
|
99
|
+
dependsOn: [CopilotActionType.SETUP_OPEN_TELEMETRY],
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
type: CopilotActionType.IMPROVE_METRICS,
|
|
103
|
+
description:
|
|
104
|
+
"Improve OpenTelemetry metrics in your codebase where required to make debugging easier.",
|
|
105
|
+
defaultPriority: 2,
|
|
106
|
+
dependsOn: [CopilotActionType.SETUP_OPEN_TELEMETRY],
|
|
107
|
+
},
|
|
108
|
+
|
|
109
|
+
// Improve code and test quality.
|
|
110
|
+
{
|
|
111
|
+
type: CopilotActionType.REFACTOR_CODE,
|
|
112
|
+
description: "Refactor code and make it into smaller units",
|
|
113
|
+
defaultPriority: 3,
|
|
114
|
+
dependsOn: [],
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
type: CopilotActionType.WRITE_UNIT_TESTS,
|
|
118
|
+
description: "Add unit tests",
|
|
119
|
+
defaultPriority: 3,
|
|
120
|
+
dependsOn: [CopilotActionType.SETUP_UNIT_TEST_FRAMEWORK],
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
type: CopilotActionType.IMPROVE_UNIT_TESTS,
|
|
124
|
+
description: "Improve unit tests",
|
|
125
|
+
defaultPriority: 3,
|
|
126
|
+
dependsOn: [CopilotActionType.SETUP_UNIT_TEST_FRAMEWORK],
|
|
127
|
+
},
|
|
128
|
+
|
|
129
|
+
// add comments.
|
|
130
|
+
{
|
|
131
|
+
type: CopilotActionType.IMPROVE_COMMENTS,
|
|
132
|
+
description: "Improve comments in your codebase",
|
|
133
|
+
defaultPriority: 4,
|
|
134
|
+
dependsOn: [],
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
type: CopilotActionType.ADD_COMMENTS,
|
|
138
|
+
description: "Add comments in your codebase",
|
|
139
|
+
defaultPriority: 4,
|
|
140
|
+
dependsOn: [],
|
|
141
|
+
},
|
|
142
|
+
|
|
143
|
+
// Add or improve README file.
|
|
144
|
+
{
|
|
145
|
+
type: CopilotActionType.ADD_README,
|
|
146
|
+
description: "Add a README file",
|
|
147
|
+
defaultPriority: 4,
|
|
148
|
+
dependsOn: [],
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
type: CopilotActionType.IMPROVE_README,
|
|
152
|
+
description: "Improve the README file",
|
|
153
|
+
defaultPriority: 4,
|
|
154
|
+
dependsOn: [],
|
|
155
|
+
},
|
|
156
|
+
|
|
157
|
+
// Fix grammar and spelling mistakes
|
|
158
|
+
{
|
|
159
|
+
type: CopilotActionType.FIX_GRAMMAR_AND_SPELLING,
|
|
160
|
+
description: "Fix grammar and spelling mistakes",
|
|
161
|
+
defaultPriority: 5,
|
|
162
|
+
dependsOn: [],
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
type: CopilotActionType.IMPROVE_VARIABLE_NAMES,
|
|
166
|
+
description: "Improve variable names and make it understandable",
|
|
167
|
+
defaultPriority: 5,
|
|
168
|
+
dependsOn: [],
|
|
169
|
+
},
|
|
170
|
+
];
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
public static getSetupActionTypes(): Array<CopilotActionTypeData> {
|
|
174
|
+
return [
|
|
175
|
+
{
|
|
176
|
+
type: CopilotActionType.SETUP_OPEN_TELEMETRY,
|
|
177
|
+
description: "Setup OpenTelemetry in your codebase",
|
|
178
|
+
defaultPriority: 1,
|
|
179
|
+
dependsOn: [],
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
type: CopilotActionType.SETUP_UNIT_TEST_FRAMEWORK,
|
|
183
|
+
description: "Setup Unit Test Framework in your codebase",
|
|
184
|
+
defaultPriority: 1,
|
|
185
|
+
dependsOn: [],
|
|
186
|
+
},
|
|
187
|
+
];
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
public static getCopilotActionType(
|
|
191
|
+
type: CopilotActionType,
|
|
192
|
+
): CopilotActionTypeData {
|
|
193
|
+
return this.getAllCopilotActionTypes().find(
|
|
194
|
+
(copilotActionTypeData: CopilotActionTypeData) => {
|
|
195
|
+
return copilotActionTypeData.type === type;
|
|
196
|
+
},
|
|
197
|
+
) as CopilotActionTypeData;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
// get actions by priority.
|
|
201
|
+
public static getActionsByPriority(
|
|
202
|
+
priority: number,
|
|
203
|
+
): Array<CopilotActionTypeData> {
|
|
204
|
+
return this.getAllCopilotActionTypes().filter(
|
|
205
|
+
(copilotActionTypeData: CopilotActionTypeData) => {
|
|
206
|
+
return copilotActionTypeData.defaultPriority === priority;
|
|
207
|
+
},
|
|
208
|
+
);
|
|
209
|
+
}
|
|
8
210
|
}
|
|
9
211
|
|
|
10
212
|
export default CopilotActionType;
|
package/Types/Icon/IconProp.ts
CHANGED
package/Types/Permission.ts
CHANGED
|
@@ -499,6 +499,9 @@ enum Permission {
|
|
|
499
499
|
ReadCopilotCodeRepository = "ReadCopilotCodeRepository",
|
|
500
500
|
|
|
501
501
|
ReadCopilotAction = "ReadCopilotAction",
|
|
502
|
+
CreateCopilotAction = "CreateCopilotAction",
|
|
503
|
+
DeleteCopilotAction = "DeleteCopilotAction",
|
|
504
|
+
EditCopilotAction = "EditCopilotAction",
|
|
502
505
|
|
|
503
506
|
ReadCopilotPullRequest = "ReadCopilotPullRequest",
|
|
504
507
|
|
|
@@ -2556,6 +2559,29 @@ export class PermissionHelper {
|
|
|
2556
2559
|
isAssignableToTenant: true,
|
|
2557
2560
|
isAccessControlPermission: false,
|
|
2558
2561
|
},
|
|
2562
|
+
{
|
|
2563
|
+
permission: Permission.EditCopilotAction,
|
|
2564
|
+
title: "Edit Copilot Event",
|
|
2565
|
+
description: "This permission can edit Copilot Event of this project.",
|
|
2566
|
+
isAssignableToTenant: true,
|
|
2567
|
+
isAccessControlPermission: false,
|
|
2568
|
+
},
|
|
2569
|
+
{
|
|
2570
|
+
permission: Permission.DeleteCopilotAction,
|
|
2571
|
+
title: "Delete Copilot Event",
|
|
2572
|
+
description:
|
|
2573
|
+
"This permission can delete Copilot Event of this project.",
|
|
2574
|
+
isAssignableToTenant: true,
|
|
2575
|
+
isAccessControlPermission: false,
|
|
2576
|
+
},
|
|
2577
|
+
{
|
|
2578
|
+
permission: Permission.CreateCopilotAction,
|
|
2579
|
+
title: "Create Copilot Event",
|
|
2580
|
+
description:
|
|
2581
|
+
"This permission can create Copilot Event of this project.",
|
|
2582
|
+
isAssignableToTenant: true,
|
|
2583
|
+
isAccessControlPermission: false,
|
|
2584
|
+
},
|
|
2559
2585
|
|
|
2560
2586
|
{
|
|
2561
2587
|
permission: Permission.CreateProbeOwnerTeam,
|
|
@@ -33,14 +33,14 @@ const components: Array<ComponentMetadata> = [
|
|
|
33
33
|
{
|
|
34
34
|
type: ComponentInputType.Text,
|
|
35
35
|
name: "Subject",
|
|
36
|
-
description: "
|
|
36
|
+
description: "Subject of the email",
|
|
37
37
|
required: false,
|
|
38
38
|
id: "subject",
|
|
39
39
|
},
|
|
40
40
|
{
|
|
41
41
|
type: ComponentInputType.HTML,
|
|
42
42
|
name: "Email Body",
|
|
43
|
-
description: "
|
|
43
|
+
description: "Body of the email",
|
|
44
44
|
required: false,
|
|
45
45
|
id: "email-body",
|
|
46
46
|
},
|
|
@@ -55,14 +55,14 @@ const components: Array<ComponentMetadata> = [
|
|
|
55
55
|
type: ComponentInputType.Text,
|
|
56
56
|
name: "SMTP Username",
|
|
57
57
|
description: "SMTP Username to send emails from",
|
|
58
|
-
required:
|
|
58
|
+
required: false,
|
|
59
59
|
id: "smtp-username",
|
|
60
60
|
},
|
|
61
61
|
{
|
|
62
62
|
type: ComponentInputType.Password,
|
|
63
63
|
name: "SMTP Password",
|
|
64
64
|
description: "SMTP Password to send emails from",
|
|
65
|
-
required:
|
|
65
|
+
required: false,
|
|
66
66
|
id: "smtp-password",
|
|
67
67
|
},
|
|
68
68
|
{
|
|
@@ -117,7 +117,7 @@ const Alert: FunctionComponent<ComponentProps> = (
|
|
|
117
117
|
<div>
|
|
118
118
|
<span className="font-medium">
|
|
119
119
|
{props.strongTitle}{" "}
|
|
120
|
-
{props.title && props.strongTitle ? "-" : ""}
|
|
120
|
+
{props.title && props.strongTitle ? "- " : ""}
|
|
121
121
|
</span>
|
|
122
122
|
{props.title}
|
|
123
123
|
</div>
|
|
@@ -378,6 +378,14 @@ const Icon: FunctionComponent<ComponentProps> = ({
|
|
|
378
378
|
d="M7.5 21L3 16.5m0 0L7.5 12M3 16.5h13.5m0-13.5L21 7.5m0 0L16.5 12M21 7.5H7.5"
|
|
379
379
|
/>,
|
|
380
380
|
);
|
|
381
|
+
} else if (icon === IconProp.CPUChip) {
|
|
382
|
+
return getSvgWrapper(
|
|
383
|
+
<path
|
|
384
|
+
strokeLinecap="round"
|
|
385
|
+
strokeLinejoin="round"
|
|
386
|
+
d="M8.25 3v1.5M4.5 8.25H3m18 0h-1.5M4.5 12H3m18 0h-1.5m-15 3.75H3m18 0h-1.5M8.25 19.5V21M12 3v1.5m0 15V21m3.75-18v1.5m0 15V21m-9-1.5h10.5a2.25 2.25 0 0 0 2.25-2.25V6.75a2.25 2.25 0 0 0-2.25-2.25H6.75A2.25 2.25 0 0 0 4.5 6.75v10.5a2.25 2.25 0 0 0 2.25 2.25Zm.75-12h9v9h-9v-9Z"
|
|
387
|
+
/>,
|
|
388
|
+
);
|
|
381
389
|
} else if (icon === IconProp.Unarchive) {
|
|
382
390
|
return getSvgWrapper(
|
|
383
391
|
<path
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Pill from "../Pill/Pill";
|
|
2
|
-
import {
|
|
2
|
+
import { Blue, Red, Yellow } from "Common/Types/BrandColors";
|
|
3
3
|
import WorkflowStatus from "Common/Types/Workflow/WorkflowStatus";
|
|
4
4
|
import React, { FunctionComponent, ReactElement } from "react";
|
|
5
5
|
|
|
@@ -11,7 +11,7 @@ const WorkflowStatusElement: FunctionComponent<ComponentProps> = (
|
|
|
11
11
|
props: ComponentProps,
|
|
12
12
|
): ReactElement => {
|
|
13
13
|
if (props.status === WorkflowStatus.Success) {
|
|
14
|
-
return <Pill color={
|
|
14
|
+
return <Pill color={Blue} text="Executed" />;
|
|
15
15
|
}
|
|
16
16
|
if (props.status === WorkflowStatus.Running) {
|
|
17
17
|
return <Pill color={Yellow} text="Running" />;
|