From b1b7d752ca3248a6a8a7a20e7c8aa702e153069f Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Mon, 11 Nov 2024 12:17:17 -0700 Subject: [PATCH] Fix lint --- .../checkAndroidStatus/checkAndroidStatus.ts | 36 +++++++++++++------ .github/workflows/androidBump.yml | 2 ++ 2 files changed, 27 insertions(+), 11 deletions(-) diff --git a/.github/actions/javascript/checkAndroidStatus/checkAndroidStatus.ts b/.github/actions/javascript/checkAndroidStatus/checkAndroidStatus.ts index d103bd185b61..9a51b8e14f9e 100644 --- a/.github/actions/javascript/checkAndroidStatus/checkAndroidStatus.ts +++ b/.github/actions/javascript/checkAndroidStatus/checkAndroidStatus.ts @@ -15,7 +15,7 @@ async function checkAndroidStatus() { const androidApi = google.androidpublisher({ version: 'v3', - auth: auth, + auth, }); try { @@ -23,16 +23,16 @@ async function checkAndroidStatus() { const editResponse = await androidApi.edits.insert({ packageName: PACKAGE_NAME, }); - const editId = editResponse.data.id; + const editId = editResponse.data.id ?? 'undefined'; // Get the production track status const trackResponse = await androidApi.edits.tracks.get({ packageName: PACKAGE_NAME, - editId: editId!, + editId, track: 'production', }); - const status = trackResponse.data.releases?.[0]?.status || 'undefined'; + const status = trackResponse.data.releases?.[0]?.status ?? 'undefined'; console.log('Track status:', status); // Check if the status is halted @@ -65,13 +65,27 @@ function calculateRolloutPercentage(releaseDate: string): number { const daysSinceRelease = Math.floor((current.getTime() - release.getTime()) / (1000 * 60 * 60 * 24)); console.log('Days since release:', daysSinceRelease); - if (daysSinceRelease <= 0) return 0; - if (daysSinceRelease === 1) return 0.01; - if (daysSinceRelease === 2) return 0.02; - if (daysSinceRelease === 3) return 0.05; - if (daysSinceRelease === 4) return 0.1; - if (daysSinceRelease === 5) return 0.2; - if (daysSinceRelease === 6) return 0.5; + if (daysSinceRelease <= 0) { + return 0; + } + if (daysSinceRelease === 1) { + return 0.01; + } + if (daysSinceRelease === 2) { + return 0.02; + } + if (daysSinceRelease === 3) { + return 0.05; + } + if (daysSinceRelease === 4) { + return 0.1; + } + if (daysSinceRelease === 5) { + return 0.2; + } + if (daysSinceRelease === 6) { + return 0.5; + } return 1; } diff --git a/.github/workflows/androidBump.yml b/.github/workflows/androidBump.yml index c65f8c9e4b89..cdc32d2651e9 100644 --- a/.github/workflows/androidBump.yml +++ b/.github/workflows/androidBump.yml @@ -3,6 +3,7 @@ name: Android Rollout Bumper on: # schedule: # - cron: '0 0 * * *' # Runs at midnight every day + # TODO: Remove when done testing push: branches: - andrew-android-bump @@ -31,5 +32,6 @@ jobs: - name: Update Rollout Percentage with Fastlane run: | + # TODO: Write a fastlane lane to bump given a percentage echo "HALTED: ${{ steps.checkAndroidStatus.outputs.HALTED }}" echo "ROLLOUT_PERCENTAGE: ${{ steps.checkAndroidStatus.outputs.ROLLOUT_PERCENTAGE }}"