Skip to content

Commit cc13a3b

Browse files
authored
Merge branch 'green-coding-solutions:main' into main
2 parents 865ae81 + f93d092 commit cc13a3b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+139
-472
lines changed

docker/structure.sql

+1-1
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ VALUES (
121121
-- Default password for user 0 is empty
122122
INSERT INTO "public"."users"("id", "name","token","capabilities","created_at","updated_at")
123123
VALUES
124-
(0, E'[GMT-SYSTEM]',E'',E'{"user":{"is_super_user": false},"api":{"quotas":{},"routes":[]},"data":{"runs":{"retention":2678400},"hog_tasks":{"retention":2678400},"measurements":{"retention":2678400},"hog_coalitions":{"retention":2678400},"ci_measurements":{"retention":2678400},"hog_measurements":{"retention":2678400}},"jobs":{"schedule_modes":[]},"machines":[],"measurement":{"quotas":{},"settings":{"total_duration":86400,"flow_process_duration":86400}},"optimizations":[]}',E'2024-11-06 11:28:24.937262+00',NULL);
124+
(0, E'[GMT-SYSTEM]',E'',E'{"user":{"is_super_user": false},"api":{"quotas":{},"routes":[]},"data":{"runs":{"retention":2678400},"measurements":{"retention":2678400},"ci_measurements":{"retention":2678400}},"jobs":{"schedule_modes":[]},"machines":[],"measurement":{"quotas":{},"settings":{"total_duration":86400,"flow_process_duration":86400}},"optimizations":[]}',E'2024-11-06 11:28:24.937262+00',NULL);
125125

126126
SELECT setval('users_id_seq', (SELECT MAX(id) FROM users));
127127

ee

Submodule ee updated from 0b819b3 to d88a01a

lib/schema_checker.py

+23-17
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,6 @@
22
import string
33
import re
44
from schema import Schema, SchemaError, Optional, Or, Use, And, Regex
5-
#
6-
# networks documentation is different than what i see in the wild!
7-
# name: str
8-
# also isn't networks optional?
9-
# fix documentation - name not needed, also netowrks optional
10-
# add check in runner.py networks parsing, make sure its valid_string
11-
# is services/type optional?
12-
13-
# services /type missing from documentation?
14-
155

166
# https://github.com/compose-spec/compose-spec/blob/master/spec.md
177

@@ -96,11 +86,18 @@ def check_usage_scenario(self, usage_scenario):
9686
"name": str,
9787
"author": And(str, Use(self.not_empty)),
9888
"description": And(str, Use(self.not_empty)),
89+
Optional("ignore-unsupported-compose"): bool,
90+
Optional("version"): str, # is part of compose. we ignore it as it is non functionaly anyway
91+
Optional("architecture"): And(str, Use(self.not_empty)),
92+
Optional("sci"): {
93+
'R_d': And(str, Use(self.not_empty)),
94+
},
9995

10096
Optional("networks"): Or(list, dict),
10197

10298
Optional("services"): {
10399
Use(self.contains_no_invalid_chars): {
100+
Optional("expose"): [str, int], # is part of compose. we ignore it as it is non functionaly anyway
104101
Optional("init"): bool,
105102
Optional("type"): Use(self.valid_service_types),
106103
Optional("image"): And(str, Use(self.not_empty)),
@@ -119,7 +116,10 @@ def check_usage_scenario(self, usage_scenario):
119116
Optional('start_interval'): And(str, Use(self.not_empty)),
120117
Optional('disable'): bool,
121118
},
122-
Optional("setup-commands"): [And(str, Use(self.not_empty))],
119+
Optional("setup-commands"): [{
120+
'command': And(str, Use(self.not_empty)),
121+
Optional("shell"): And(str, Use(self.not_empty)),
122+
}],
123123
Optional("volumes"): self.single_or_list(str),
124124
Optional("folder-destination"):And(str, Use(self.not_empty)),
125125
Optional("entrypoint"): Or(str, [str]),
@@ -152,16 +152,22 @@ def check_usage_scenario(self, usage_scenario):
152152
}],
153153

154154
Optional("compose-file"): Use(self.validate_compose_include)
155-
}, ignore_extra_keys=True)
156-
155+
}, ignore_extra_keys=bool(usage_scenario.get('ignore-unsupported-compose', False)))
157156

158157
# First we check the general structure. Otherwise we later cannot even iterate over it
159158
try:
160159
usage_scenario_schema.validate(usage_scenario)
161160
except SchemaError as e: # This block filters out the too long error message that include the parsing structure
162-
if len(e.autos) > 2:
163-
raise SchemaError(e.autos[2:]) from e
164-
raise SchemaError(e.autos) from e
161+
162+
error_message = e.autos
163+
164+
if len(e.autos) >= 3:
165+
error_message = e.autos[2:]
166+
167+
if 'Wrong key' in e.code:
168+
raise SchemaError(f"Your compose file does contain a key that GMT does not support - Please check if the container will still run as intended. If you want to ignore this error you can add the attribute `ignore-unsupported-compose: true` to your usage_scenario.yml\nError: {error_message}") from e
169+
170+
raise SchemaError(error_message) from e
165171

166172

167173
# This check is necessary to do in a seperate pass. If tried to bake into the schema object above,
@@ -170,7 +176,7 @@ def check_usage_scenario(self, usage_scenario):
170176
self.validate_networks_no_invalid_chars(usage_scenario['networks'])
171177

172178
known_container_names = []
173-
for service_name, service in usage_scenario.get('services').items():
179+
for service_name, service in usage_scenario.get('services', {}).items():
174180
if 'container_name' in service:
175181
container_name = service['container_name']
176182
else:

migrations/2014_03_31_add_co2_ci.sql

-5
This file was deleted.

migrations/2022_01_08_mW_to_mJ.sql

-11
This file was deleted.

migrations/2022_01_17_invalid_project.sql

-1
This file was deleted.

migrations/2022_01_19_branch.sql

-1
This file was deleted.

migrations/2023_02_20_badges.sql

-11
This file was deleted.

migrations/2023_02_25_machine_id.sql

-9
This file was deleted.

migrations/2023_03_07_commit_hash.sql

-1
This file was deleted.

migrations/2023_03_27_ci_measurements.sql

-3
This file was deleted.

migrations/2023_04_04_blue_angel_phases.sql

-22
This file was deleted.

migrations/2023_04_29_ci_measurements.sql

-2
This file was deleted.

migrations/2023_05_01_index.sql

-2
This file was deleted.

migrations/2023_05_30_ci_duration.sql

-1
This file was deleted.

migrations/2023_06_03_logs.sql

-1
This file was deleted.

migrations/2023_06_15_not_null.sql

-17
This file was deleted.

migrations/2023_06_21_adds_proxy.sql

-8
This file was deleted.

migrations/2023_07_08_indices.sql

-12
This file was deleted.

migrations/2023_07_10_indices.sql

-2
This file was deleted.

migrations/2023_07_13_gmt_commit_hash.sql

-1
This file was deleted.

migrations/2023_07_14_min_value.sql

-1
This file was deleted.

migrations/2023_07_22_commit_timestamp.sql

-1
This file was deleted.

migrations/2023_08_11_ci_measurement_cpu_util.sql

-3
This file was deleted.

migrations/2023_09_01_network_intercepts.sql

-8
This file was deleted.

migrations/2023_09_02_projects_to_runs.sql

-117
This file was deleted.

migrations/2023_09_09_runner_arguments.sql

-1
This file was deleted.

migrations/2023_09_18_workflow_name.sql

-2
This file was deleted.

0 commit comments

Comments
 (0)