Improve the build filtering in the continuous-deploy-fingerprint GitHub action to prevent duplicate builds from being triggered.
Motivation
The current implementation uses --status finished when querying for existing builds, which can lead to unnecessary new builds even when there's an existing build for the same runtime version. This results in wasted CI resources. By implementing a more comprehensive filtering approach, we can save CI resources and improve the efficiency of the deployment process.
The --status finished filter is too restrictive and doesn't account for builds that might be in progress or queued. The eas build:list command supports the following status values: new, in-queue, in-progress, pending-cancel, errored, finished, canceled.
Proposed solution:
Remove the --status finished filter from the eas build:list command.
Implement frontend filtering in the action to exclude builds with status pending-cancel, errored, and canceled.
Consider builds with status new, in-queue, in-progress, or finished as valid existing builds to prevent triggering duplicate builds.
This change would require modifying the getBuildInfoWithFingerprintAsync function to:
Remove the --status finished parameter from the eas build:list command.
Parse the JSON output to filter out unwanted build statuses.
Return the most recent valid build or null if no valid builds are found.
By implementing this feature, we can significantly reduce unnecessary builds, saving CI resources and improving the overall efficiency of the continuous deployment process.
Description of the feature
Improve the build filtering in the
continuous-deploy-fingerprint
GitHub action to prevent duplicate builds from being triggered.Motivation
The current implementation uses
--status finished
when querying for existing builds, which can lead to unnecessary new builds even when there's an existing build for the same runtime version. This results in wasted CI resources. By implementing a more comprehensive filtering approach, we can save CI resources and improve the efficiency of the deployment process.Additional context
The issue is in the
getBuildInfoWithFingerprintAsync
function in the file: https://sourcegraph.com/github.com/expo/expo-github-action/-/blob/src/actions/continuous-deploy-fingerprint.ts?L133-197Currently, the function uses the following command to list builds:
The
--status finished
filter is too restrictive and doesn't account for builds that might be in progress or queued. Theeas build:list
command supports the following status values:new
,in-queue
,in-progress
,pending-cancel
,errored
,finished
,canceled
.Proposed solution:
--status finished
filter from theeas build:list
command.pending-cancel
,errored
, andcanceled
.new
,in-queue
,in-progress
, orfinished
as valid existing builds to prevent triggering duplicate builds.This change would require modifying the
getBuildInfoWithFingerprintAsync
function to:--status finished
parameter from theeas build:list
command.By implementing this feature, we can significantly reduce unnecessary builds, saving CI resources and improving the overall efficiency of the continuous deployment process.