As part of our CICD we have a script that registers flows for us; I've noticed that our script ends up generating new versions of flows even though nothing changed about the flow. So, in order to debug this, I wrote some debugging statements during CICD:
if not args.dry_run:
project = args.project
logger.log(SUCCESS, f"Registering flow '{flow.name}' to project '{project}'.")
logger.debug(f"Serialized flow: {json.dumps(flow.serialize(), indent=4, sort_keys=True)}")
logger.debug(f"Hashed flow: {flow.serialized_hash()}")
flow.register(
project_name=project,
idempotency_key=flow.serialized_hash(),
set_schedule_active=set_schedule_active,
)
I noticed that on back to back execution of the above script, for the same flow, to the same project, different hashes were being created. When I look at the
serialized_hash
of those flows I see no difference. To confirm the serialized flows are the same, I've saved the logging output to two json files (see screenshot). The only difference I can spot is that is use
indent=4
in my json.dumps however the
codebase does not.