Enforce snapshot limit when publish happens

Most of this is copy-paste from the other lookupDataset method, can we consolidate the code better?