Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[eas-cli] use google service key detection in credentials service #660

Merged
merged 3 commits into from
Sep 30, 2021

Conversation

quinlanj
Copy link
Member

@quinlanj quinlanj commented Sep 30, 2021

Checklist

  • I've added an entry to CHANGELOG.md if necessary.
  • I've tagged the changelog entry with [EAS BUILD API] if it's a part of a breaking change to EAS Build API (only possible when updating @expo/eas-build-job package).

Why

The current logic in the Android submission service has some features that detect potential Google Service Jsons and suggest them to the user. I think this is a very good idea, so I've taken most of this logic, made minor adjustments to it, and put it in the credentials service.

This logic is copied over instead of refactored because in a followup PR, I'm thinking the submissions logic here can be changed to something like this:

 // path is explicitly passed in
 if (serviceAccountKeyPath) {
      return result({
        sourceType: ServiceAccountSourceType.path,
        path: serviceAccountKeyPath,
      });
    } 

 // fallback to credentials service otherwise
 if (keyIsSetupOnCredentialsService) {
    return savedKey;
 }

 return await (new SetupGoogleServiceAccountKey().runAsync(credentialsCtx));

Test Plan

  • modified tests pass

@github-actions
Copy link

github-actions bot commented Sep 30, 2021

Size Change: +2.86 kB (0%)

Total Size: 22.4 MB

Filename Size Change
./packages/eas-cli/dist/eas-linux-x64.tar.gz 22.4 MB +2.86 kB (0%)

compressed-size-action

@codecov
Copy link

codecov bot commented Sep 30, 2021

Codecov Report

Merging #660 (6a1be34) into main (e8d71a5) will increase coverage by 0.17%.
The diff coverage is 91.49%.

❗ Current head 6a1be34 differs from pull request most recent head 1ca6379. Consider uploading reports for the commit 1ca6379 to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##             main     #660      +/-   ##
==========================================
+ Coverage   49.37%   49.54%   +0.17%     
==========================================
  Files         314      314              
  Lines       10782    10822      +40     
  Branches     2030     2036       +6     
==========================================
+ Hits         5323     5361      +38     
- Misses       5453     5455       +2     
  Partials        6        6              
Impacted Files Coverage Δ
...s/android/actions/CreateGoogleServiceAccountKey.ts 84.00% <75.00%> (-0.21%) ⬇️
...edentials/android/utils/googleServiceAccountKey.ts 86.77% <97.15%> (+10.30%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e8d71a5...1ca6379. Read the comment docs.

Copy link
Contributor

@dsokal dsokal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@quinlanj quinlanj merged commit 426a3d1 into main Sep 30, 2021
@quinlanj quinlanj deleted the @quin/borrowDetection branch September 30, 2021 19:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants