in hack/validate_tekton.py [0:0]
def check_key_order(spec, expected_order):
keys = list(spec.keys())
expected_keys = [key for key in expected_order if key in keys]
# Check if all required keys are present
for key in expected_order:
if key not in keys and key not in ['workspaces', 'volumes', 'finally', 'results']:
return False
# Check if the order of the present keys is correct
return keys[:len(expected_keys)] == expected_keys