You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 15, 2025. It is now read-only.
CLI now returns and filter test on group name (#321)
* CLI now returns and filter test on group name
Signed-off-by: Aashir Siddiqui <[email protected]>
* Added validation for group name
Signed-off-by: Aashir Siddiqui <[email protected]>
* Added unit test
Signed-off-by: Aashir Siddiqui <[email protected]>
* Added a unit test for checking mutually exclusive flags
Signed-off-by: Aashir Siddiqui <[email protected]>
* Updated integration tests
Signed-off-by: Aashir Siddiqui <[email protected]>
* review: Formatting fixes, revert unwanted changes
Signed-off-by: Eamonn Mansour <[email protected]>
* review: Add group validation, stop erroring out when --age is not given with --group
Signed-off-by: Eamonn Mansour <[email protected]>
* Restore ecosystem script constants and add group name validation test
Signed-off-by: Eamonn Mansour <[email protected]>
* Add group to more unit tests
Signed-off-by: Eamonn Mansour <[email protected]>
* Add group to runs submit output, add runs get --group ecosystem tests
Signed-off-by: Eamonn Mansour <[email protected]>
* Empty commit to kick off build
Signed-off-by: Eamonn Mansour <[email protected]>
* Create RunsQuery struct to store run query parameters and get pages of runs
Signed-off-by: Eamonn Mansour <[email protected]>
* Replace Latin-1 validation for group and secret names with alphanumeric + dashes and underscores
Signed-off-by: Eamonn Mansour <[email protected]>
* Update role name validation to use common name validation function
Signed-off-by: Eamonn Mansour <[email protected]>
---------
Signed-off-by: Aashir Siddiqui <[email protected]>
Signed-off-by: Eamonn Mansour <[email protected]>
Co-authored-by: Eamonn Mansour <[email protected]>
Copy file name to clipboardExpand all lines: docs/generated/errors-list.md
+4-3Lines changed: 4 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -79,7 +79,7 @@ The `galasactl` tool can generate the following errors:
79
79
- GAL1076E: Badly formed from or to value '{}' specified in the age parameter. The value could not be converted into an integer value.
80
80
- GAL1077E: Invalid value '{}' detected for age parameter. The 'from' value must be greater than the 'to' value.
81
81
- GAL1078E: Badly formed '--age' parameter value '{}' specified. Age of the test runs should be specified in the format '{FROM}{TIME-UNIT}:{TO}{TIME-UNIT}' or '{FROM}{TIME-UNIT}', where 'FROM' is a positive, non-zero integer, 'TO' is a non-negative integer, and 'TIME-UNIT' can be {}. 'FROM' must be greater than 'TO'. 'TO' defaults to 0 if not specified. Use the --help flag for more information, or refer to the documentation at https://galasa.dev/docs/reference/cli-commands.
82
-
- GAL1079E: The --ageor the --name parameter must be used to identify which test run(s) you want see. Use the --help flag for more information, or refer to the documentation at https://galasa.dev/docs/reference/cli-commands.
82
+
- GAL1079E: The --age, --name, or --group parameter must be used to identify which test run(s) you want see. Use the --help flag for more information, or refer to the documentation at https://galasa.dev/docs/reference/cli-commands.
83
83
- GAL1080E: Invalid 'from' value '{}' in the '--age' parameter. Age of the test runs should be specified in the format '{FROM}{TIME-UNIT}:{TO}{TIME-UNIT}' or '{FROM}{TIME-UNIT}', where 'FROM' is a positive, non-zero integer, 'TO' is a non-negative integer, and 'TIME-UNIT' can be {}. 'FROM' must be greater than 'TO'. 'TO' defaults to 0 if not specified. Use the --help flag for more information, or refer to the documentation at https://galasa.dev/docs/reference/cli-commands.
84
84
- GAL1081E: Unable use a negative value '{}' in the '--age' parameter. Age of the test runs should be specified in the format '{FROM}{TIME-UNIT}:{TO}{TIME-UNIT}' or '{FROM}{TIME-UNIT}', where 'FROM' is a positive, non-zero integer, 'TO' is a non-negative integer, and 'TIME-UNIT' can be {}. 'FROM' must be greater than 'TO'. 'TO' defaults to 0 if not specified. Use the --help flag for more information, or refer to the documentation at https://galasa.dev/docs/reference/cli-commands.
85
85
- GAL1082E: Invalid time unit specified '{}' in the '--age' parameter. Age of the test runs should be specified in the format '{FROM}{TIME-UNIT}:{TO}{TIME-UNIT}' or '{FROM}{TIME-UNIT}', where 'FROM' is a positive, non-zero integer, 'TO' is a non-negative integer, and 'TIME-UNIT' can be {}. 'FROM' must be greater than 'TO'. 'TO' defaults to 0 if not specified. Use the --help flag for more information, or refer to the documentation at https://galasa.dev/docs/reference/cli-commands.
@@ -105,6 +105,7 @@ The `galasactl` tool can generate the following errors:
105
105
- GAL1102E: name '{}' is invalid. '--name' is a mandatory flag for this command. Use the --help flag for more information, or refer to the documentation at https://galasa.dev/docs/reference/cli-commands.
106
106
- GAL1103E: Could not query CPS results. Reason: '{}'
107
107
- GAL1104E: Unable to delete the bearer token file '{}'.
108
+
- GAL1105E: Invalid group name provided. Group names must only contain characters in the following ranges: 'a'-'z', 'A'-'Z', '0'-'9', '-' (dash), '_' (underscore).
108
109
- GAL1106E: Could not get security bearer token from API server. Reason: '{}'. Ensure you have allocated a personal access token and configured your client program by setting your GALASA_TOKEN as an environment variable or by storing it in your galasactl.properties file
109
110
- GAL1107E: Could not get security bearer token from file '{}'. Reason: '{}'. Ensure you are authenticated by running 'galasactl auth login' and that your personal access token has not expired or been revoked
110
111
- GAL1108E: Invalid bearer token. Ensure you are authenticated by running 'galasactl auth login' and that your personal access token has not expired or been revoked
@@ -167,7 +168,7 @@ The `galasactl` tool can generate the following errors:
167
168
- GAL1169E: An attempt to delete a secret named '{}' failed. Unexpected http status code {} received from the server. Error details from the server are not in a valid json format. Cause: '{}'
168
169
- GAL1170E: An attempt to delete a secret named '{}' failed. Unexpected http status code {} received from the server. Error details from the server are: '{}'
169
170
- GAL1171E: An attempt to delete a secret named '{}' failed. Unexpected http status code {} received from the server. Error details from the server are not in the json format.
170
-
- GAL1172E: Invalid secret name provided. The name provided with the --name flag cannot be empty, contain spaces or dots (.), and must only contain characters in the Latin-1 character set.
171
+
- GAL1172E: Invalid secret name provided. The name provided with the --name flag cannot be emptyand must only contain characters in the following ranges: 'a'-'z', 'A'-'Z', '0'-'9', '-' (dash), '_' (underscore).
171
172
- GAL1173E: An attempt to delete a secret named '{}' failed. Sending the delete request to the Galasa service failed. Cause is {}
172
173
- GAL1174E: An attempt to get a secret named '{}' failed. Unexpected http status code {} received from the server.
173
174
- GAL1175E: An attempt to get a secret named '{}' failed. Unexpected http status code {} received from the server. Error details from the server could not be read. Cause: {}
@@ -204,7 +205,7 @@ The `galasactl` tool can generate the following errors:
204
205
- GAL1206E: Failed to get roles. Unexpected http status code {} received from the server. Error details from the server are not in a valid json format. Cause: '{}'
205
206
- GAL1207E: Failed to get roles. Unexpected http status code {} received from the server. Error details from the server are: '{}'
206
207
- GAL1208E: Failed to get roles. Unexpected http status code {} received from the server. Error details from the server are not in the json format.
207
-
- GAL1209E: Invalid role name provided. The name provided with the --name flag cannot be empty, contain spaces or dots (.), and must only contain characters in the Latin-1 character set.
208
+
- GAL1209E: Invalid role name provided. The name provided with the --name flag cannot be emptyand must only contain characters in the following ranges: 'a'-'z', 'A'-'Z', '0'-'9', '-' (dash), '_' (underscore).
208
209
- GAL1210E: Role name {} is not known on the Galasa service.
209
210
- GAL1225E: Failed to open file '{}' cause: {}. Check that this file exists, and that you have read permissions.
210
211
- GAL1226E: Internal failure. Contents of gzip could be read, but not decoded. New gzip reader failed: file: {} error: {}
Copy file name to clipboardExpand all lines: docs/generated/galasactl_runs_get.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,6 +16,7 @@ galasactl runs get [flags]
16
16
--active parameter to retrieve runs that have not finished yet. Cannot be used in conjunction with --name or --result flag.
17
17
--age string the age of the test run(s) we want information about. Supported formats are: 'FROM' or 'FROM:TO', where FROM and TO are each ages, made up of an integer and a time-unit qualifier. Supported time-units are 'w' (weeks), 'd' (days), 'h' (hours), 'm' (minutes). If missing, the TO part is defaulted to '0h'. Examples: '--age 1d', '--age 6h:1h' (list test runs which happened from 6 hours ago to 1 hour ago). The TO part must be a smaller time-span than the FROM part.
18
18
--format string output format for the data returned. Supported formats are: 'details', 'raw', 'summary'. (default "summary")
19
+
--group string the name of the group to return tests under that group. Cannot be used in conjunction with --name
19
20
-h, --help Displays the options for the 'runs get' command.
20
21
--name string the name of the test run we want information about. Cannot be used in conjunction with --requestor, --result or --active flags
21
22
--requestor string the requestor of the test run we want information about. Cannot be used in conjunction with --name flag.
runsGetCobraCmd.PersistentFlags().StringVar(&cmd.values.runName, "name", "", "the name of the test run we want information about."+
95
96
" Cannot be used in conjunction with --requestor, --result or --active flags")
97
+
runsGetCobraCmd.PersistentFlags().StringVar(&cmd.values.group, "group", "", "the name of the group to return tests under that group."+
98
+
" Cannot be used in conjunction with --name")
96
99
runsGetCobraCmd.PersistentFlags().StringVar(&cmd.values.age, "age", "", "the age of the test run(s) we want information about. Supported formats are: 'FROM' or 'FROM:TO', where FROM and TO are each ages,"+
97
100
" made up of an integer and a time-unit qualifier. Supported time-units are "+units+". If missing, the TO part is defaulted to '0h'. Examples: '--age 1d',"+
98
101
" '--age 6h:1h' (list test runs which happened from 6 hours ago to 1 hour ago)."+
Copy file name to clipboardExpand all lines: pkg/errors/errorMessage.go
+4-3Lines changed: 4 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -241,7 +241,7 @@ var (
241
241
GALASA_ERROR_INVALID_FROM_OR_TO_PARAMETER=NewMessageType("GAL1076E: Badly formed from or to value '%s' specified in the age parameter. The value could not be converted into an integer value.", 1076, STACK_TRACE_NOT_WANTED)
242
242
GALASA_ERROR_FROM_AGE_SMALLER_THAN_TO_AGE=NewMessageType("GAL1077E: Invalid value '%s' detected for age parameter. The 'from' value must be greater than the 'to' value.", 1077, STACK_TRACE_NOT_WANTED)
243
243
GALASA_ERROR_INVALID_AGE_PARAMETER=NewMessageType("GAL1078E: Badly formed '--age' parameter value '%s' specified. Age of the test runs should be specified in the format '{FROM}{TIME-UNIT}:{TO}{TIME-UNIT}' or '{FROM}{TIME-UNIT}', where 'FROM' is a positive, non-zero integer, 'TO' is a non-negative integer, and 'TIME-UNIT' can be %s. 'FROM' must be greater than 'TO'. 'TO' defaults to 0 if not specified."+SEE_COMMAND_REFERENCE, 1078, STACK_TRACE_NOT_WANTED)
244
-
GALASA_ERROR_NO_RUNNAME_OR_AGE_SPECIFIED=NewMessageType("GAL1079E: The --ageor the --name parameter must be used to identify which test run(s) you want see."+SEE_COMMAND_REFERENCE, 1079, STACK_TRACE_NOT_WANTED)
244
+
GALASA_ERROR_NO_TEST_RUN_IDENTIFIER_FLAG_SPECIFIED=NewMessageType("GAL1079E: The --age, --name, or --group parameter must be used to identify which test run(s) you want see."+SEE_COMMAND_REFERENCE, 1079, STACK_TRACE_NOT_WANTED)
245
245
GALASA_ERROR_INVALID_FROM_AGE_SPECIFIED=NewMessageType("GAL1080E: Invalid 'from' value '%s' in the '--age' parameter. Age of the test runs should be specified in the format '{FROM}{TIME-UNIT}:{TO}{TIME-UNIT}' or '{FROM}{TIME-UNIT}', where 'FROM' is a positive, non-zero integer, 'TO' is a non-negative integer, and 'TIME-UNIT' can be %s. 'FROM' must be greater than 'TO'. 'TO' defaults to 0 if not specified."+SEE_COMMAND_REFERENCE, 1080, STACK_TRACE_NOT_WANTED)
246
246
GALASA_ERROR_NEGATIVE_AGE_SPECIFIED=NewMessageType("GAL1081E: Unable use a negative value '%s' in the '--age' parameter. Age of the test runs should be specified in the format '{FROM}{TIME-UNIT}:{TO}{TIME-UNIT}' or '{FROM}{TIME-UNIT}', where 'FROM' is a positive, non-zero integer, 'TO' is a non-negative integer, and 'TIME-UNIT' can be %s. 'FROM' must be greater than 'TO'. 'TO' defaults to 0 if not specified."+SEE_COMMAND_REFERENCE, 1081, STACK_TRACE_NOT_WANTED)
247
247
GALASA_ERROR_BAD_TIME_UNIT_AGE_SPECIFIED=NewMessageType("GAL1082E: Invalid time unit specified '%s' in the '--age' parameter. Age of the test runs should be specified in the format '{FROM}{TIME-UNIT}:{TO}{TIME-UNIT}' or '{FROM}{TIME-UNIT}', where 'FROM' is a positive, non-zero integer, 'TO' is a non-negative integer, and 'TIME-UNIT' can be %s. 'FROM' must be greater than 'TO'. 'TO' defaults to 0 if not specified."+SEE_COMMAND_REFERENCE, 1082, STACK_TRACE_NOT_WANTED)
@@ -268,6 +268,7 @@ var (
268
268
GALASA_ERROR_MISSING_NAME_FLAG=NewMessageType("GAL1102E: name '%s' is invalid. '--name' is a mandatory flag for this command."+SEE_COMMAND_REFERENCE, 1102, STACK_TRACE_WANTED)
269
269
GALASA_ERROR_QUERY_CPS_FAILED=NewMessageType("GAL1103E: Could not query CPS results. Reason: '%s'", 1103, STACK_TRACE_WANTED)
270
270
GALASA_ERROR_UNABLE_TO_DELETE_BEARER_TOKEN_FILE=NewMessageType("GAL1104E: Unable to delete the bearer token file '%s'.", 1104, STACK_TRACE_NOT_WANTED)
271
+
GALASA_ERROR_INVALID_GROUP_NAME_PROVIDED=NewMessageType("GAL1105E: Invalid group name provided. Group names must only contain characters in the following ranges: 'a'-'z', 'A'-'Z', '0'-'9', '-' (dash), '_' (underscore).", 1105, STACK_TRACE_NOT_WANTED)
271
272
GALASA_ERROR_RETRIEVING_BEARER_TOKEN_FROM_API_SERVER=NewMessageType("GAL1106E: Could not get security bearer token from API server. Reason: '%s'. Ensure you have allocated a personal access token and configured your client program by setting your GALASA_TOKEN as an environment variable or by storing it in your galasactl.properties file", 1106, STACK_TRACE_WANTED)
272
273
GALASA_ERROR_RETRIEVING_BEARER_TOKEN_FROM_FILE=NewMessageType("GAL1107E: Could not get security bearer token from file '%s'. Reason: '%s'. Ensure you are authenticated by running 'galasactl auth login' and that your personal access token has not expired or been revoked", 1107, STACK_TRACE_NOT_WANTED)
273
274
GALASA_ERROR_INVALID_BEARER_TOKEN=NewMessageType("GAL1108E: Invalid bearer token. Ensure you are authenticated by running 'galasactl auth login' and that your personal access token has not expired or been revoked", 1108, STACK_TRACE_NOT_WANTED)
@@ -345,7 +346,7 @@ var (
345
346
GALASA_ERROR_DELETE_SECRET_UNPARSEABLE_CONTENT=NewMessageType("GAL1169E: An attempt to delete a secret named '%s' failed. Unexpected http status code %v received from the server. Error details from the server are not in a valid json format. Cause: '%s'", 1169, STACK_TRACE_NOT_WANTED)
346
347
GALASA_ERROR_DELETE_SECRET_SERVER_REPORTED_ERROR=NewMessageType("GAL1170E: An attempt to delete a secret named '%s' failed. Unexpected http status code %v received from the server. Error details from the server are: '%s'", 1170, STACK_TRACE_NOT_WANTED)
347
348
GALASA_ERROR_DELETE_SECRET_EXPLANATION_NOT_JSON=NewMessageType("GAL1171E: An attempt to delete a secret named '%s' failed. Unexpected http status code %v received from the server. Error details from the server are not in the json format.", 1171, STACK_TRACE_NOT_WANTED)
348
-
GALASA_ERROR_INVALID_SECRET_NAME=NewMessageType("GAL1172E: Invalid secret name provided. The name provided with the --name flag cannot be empty, contain spaces or dots (.), and must only contain characters in the Latin-1 character set.", 1172, STACK_TRACE_NOT_WANTED)
349
+
GALASA_ERROR_INVALID_SECRET_NAME=NewMessageType("GAL1172E: Invalid secret name provided. The name provided with the --name flag cannot be emptyand must only contain characters in the following ranges: 'a'-'z', 'A'-'Z', '0'-'9', '-' (dash), '_' (underscore).", 1172, STACK_TRACE_NOT_WANTED)
349
350
GALASA_ERROR_DELETE_SECRET_REQUEST_FAILED=NewMessageType("GAL1173E: An attempt to delete a secret named '%s' failed. Sending the delete request to the Galasa service failed. Cause is %v", 1173, STACK_TRACE_NOT_WANTED)
350
351
351
352
GALASA_ERROR_GET_SECRET_NO_RESPONSE_CONTENT=NewMessageType("GAL1174E: An attempt to get a secret named '%s' failed. Unexpected http status code %v received from the server.", 1174, STACK_TRACE_NOT_WANTED)
@@ -390,7 +391,7 @@ var (
390
391
GALASA_ERROR_GET_ROLES_EXPLANATION_NOT_JSON=NewMessageType("GAL1208E: Failed to get roles. Unexpected http status code %v received from the server. Error details from the server are not in the json format.", 1208, STACK_TRACE_NOT_WANTED)
391
392
392
393
// When getting a single named role...
393
-
GALASA_ERROR_INVALID_ROLE_NAME=NewMessageType("GAL1209E: Invalid role name provided. The name provided with the --name flag cannot be empty, contain spaces or dots (.), and must only contain characters in the Latin-1 character set.", 1209, STACK_TRACE_NOT_WANTED)
394
+
GALASA_ERROR_INVALID_ROLE_NAME=NewMessageType("GAL1209E: Invalid role name provided. The name provided with the --name flag cannot be emptyand must only contain characters in the following ranges: 'a'-'z', 'A'-'Z', '0'-'9', '-' (dash), '_' (underscore).", 1209, STACK_TRACE_NOT_WANTED)
394
395
GALASA_ERROR_ROLE_NAME_NOT_FOUND=NewMessageType("GAL1210E: Role name %v is not known on the Galasa service.", 1210, STACK_TRACE_NOT_WANTED)
0 commit comments