Background: We have a mono repo with several modules and a custom logic to figure out, if a job for a certain module has to be re-run. We are currently doing this by externally persisting information about the last ci runs (build_nr per job_name) and querying the circleci v1.1. API to check if the build was successful and if so the get the vcs revision. With that, we can check if a certain module was changed between the two commits
We are migrating to API v2 and i am asking myself, if it is possible with the new API to get rid of the external store. I am almost there, just a small piece is missing:
-
/insights/<project_slug>/workflows/<workflow_name>/jobs/<job_name>?branch=<branch_name>returns the job-ids and status of the resent runs for a givenjob name. -
/project/<project_slug>/job/<job_nr>is returning the pipeline-id for a givenjob number -
/pipeline/<pipeline-id>is returning the vcs_revision for a givenpipeline id
But the /insights/.../jobs/... request is returning the job uuid not the job number, is there a way to get the job number by job uuid ? Is the job number the same as the build number ?
Or maybe there is a better/different way to get the vcs revision for the last successful job by job name ?