Closed alambike closed 1 month ago
It is not possible to obtain the workflow run_id from the check run, so we are going to go for another solution:
The build-xxx should create a specific status check ( Build Docker snapshots
, Build Docker pre-releases
, Build Docker releases
for the commit, with the annotation_url pointing to the workflow run, and the following array in yaml format to locate the builds made:
- flavor: inss-pre
image_type: snapshots
build_args:
MY_API_URL: https://my-url
image_repo: 'service/councilbox/rivulet-client'
image_tag: v1.17.0-myflavour-pre
registry: myacr1
version: v1.17.0-pre
run_id: 1234132112
- flavor: inss-pre
image_type: snapshots
build_args:
MY_API_URL: https://my-url
image_repo: 'service/councilbox/rivulet-client'
image_tag: v1.17.0-myflavour-pre
registry: myacr2 # <- alternative registry
version: v1.17.0-pre
run_id: 1234132112
If we use the FS GitHub app, we can create our own check suite, and a check run containing info about the images built (for human consumption), and as a backup, if we lose the artifact the developer can get the images tags from here and use the image tag parameter to make the dispatch manually
In the automatic mode, the make_dispatches
is triggered by an trigger_dispatch_on..
workflow, after a workflow_run event, so we would have direct access to the run id.
We need to download, from the trigger_dispatch_on... workflows, the related artifact attached to the workflow_run
and build a matrix to make as many dispatches as flavors have been built
In the manual dispatch, where the make_dispatches doesn't have direct access to the build-images run_id, we need to:
version
input, or the $latest_release, $latest_prerelease
, $branch_xxx
keywords configured in the config file, related to the flavors to dispatch
Motivation
After https://github.com/prefapp/firestarter-workflows/issues/93, we should be able to remove the image tag calculation and use the image information obtained from the
build_images_results.json
artifact, and filtering automatically the dispatches to do.With this we should:
This would work with any triggered event (workflow_dispatch, release, pull_request, push...) BUT we would need to make some changes:
$branch_xxx
-> calculate the related commit in branchxxx
, as now, but search in the commit checks for the workflow_run associated with the image build (https://github.com/orgs/community/discussions/24709), which will contain the corresponding report needed to make the dispatches$latest_release
/$latest_prerelease
-> obtain the commit from the tag, and search in the commit checks for the workflow_run associated with the image build (https://github.com/orgs/community/discussions/24709), which will contain the corresponding reportoverwrite_version
input and versions fixed in the config file: check if the format is a short-sha commit or a git tag, and follow the previous paths accordinglyNew Inputs needed (optionals)
image_tag
: Escape hatch New input parameter that skips the workflow_run artifact and use the image_tag passedbuild_images_run_id
: the run id of the relatedbuild_xxx
workflowbuild_images_check_name
: Build Docker snapshots, Build Docker pre-releases, Build Docker releases... the check name to search for the run-id