#!/usr/bin/env bash
set -xeuo pipefail

lhs="$1"
rhs="$(mktemp --suffix=.zrn)"

mapping/zrn/tools/import_export --in="$lhs" --out="$rhs"
# TODO(chris): https://jira.zooxlabs.com/browse/CARTA-3214
# Remove cold-start and release_status.type from ignore set.
# This curently causes failures for the following maps:
# * chess_day_southbound
# * labyrinth
# * seattle
# * sf
# TODO(cg): https://jira.zooxlabs.com/browse/CARTA-3891
# Remove signal yaw from signal_head_end and signal_head_start from ignore list
# This curently causes failures for the following maps:
# * chess_day_southbound
# * labyrinth
# * seattle
# * sf
mapping/zrn/tools/diff_zrn --a="$lhs" --b="$rhs" \
  --ignore=changelist,compatibility_version,validation_manifest,postprocess_manifest,region.annotation.is_cold_start_location,region.road_segment.lanes.properties.release_status.type,region.road_segment.signal_head_start.signal.yaw,region.road_segment.signal_head_end.signal.yaw,region.road_segment.lanes.properties.type
