paularmstrong / build-tracker

A set of tools to track the size of your build artifacts over time.
https://buildtracker.dev
MIT License
439 stars 27 forks source link

Avoid setting "Revision" as PRIMARY_KEY #210

Closed PranaytheSingh closed 4 years ago

PranaytheSingh commented 4 years ago

Problem

The database plugins are setup with setting revision key as the PRIMARY_KEY. However if we re-run the build tracker job it ends up in a duplicate key error ( Since the sha is the same).

Proposed solution

I'm proposing adding a unique ID key to each row which will have the property of Uniq and Primary Key. This way subsequent re-runs will ensure that the job works even the sha is unchanges.

paularmstrong commented 4 years ago

Discussed in person. We'll be implementing a getBuild() method in the @build-tracker/api-client to allow checking for existing builds to avoid attempting to double-post.