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

fix(amplify-util-uibuilder): make studio app check static #11220

Merged
merged 1 commit into from
Oct 19, 2022

Conversation

SwaySway
Copy link
Contributor

problem: having the admin check as a part of the studio client instance assumes the app is already studio enabled

solution: move out studio app check into static function and also don't throw error on failed app check this is so other flows are not blocked

Description of changes

Issue #, if available

Description of how you validated changes

Checklist

  • PR description included
  • yarn test passes
  • Tests are changed or added
  • Relevant documentation is changed or added (and PR referenced)
  • New AWS SDK calls or CloudFormation actions have been added to relevant test and service IAM policies
  • Pull request labels are added

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

problem: having the admin check as a part of the studio client instance assumes
the app is already studio enabled

solution: move out studio app check into static function and also don't
throw error on failed app check this is so other flows are not blocked
@SwaySway SwaySway requested a review from a team as a code owner October 19, 2022 19:11
@SwaySway
Copy link
Contributor Author

running console integ tests locally - adding pr now to get review started

@codecov-commenter
Copy link

codecov-commenter commented Oct 19, 2022

Codecov Report

Merging #11220 (edd830b) into dev (9a1c725) will increase coverage by 0.00%.
The diff coverage is 81.81%.

@@           Coverage Diff           @@
##              dev   #11220   +/-   ##
=======================================
  Coverage   49.49%   49.49%           
=======================================
  Files         682      682           
  Lines       32861    32864    +3     
  Branches     6708     6708           
=======================================
+ Hits        16263    16266    +3     
  Misses      15118    15118           
  Partials     1480     1480           
Impacted Files Coverage Δ
...til-uibuilder/src/clients/amplify-studio-client.ts 91.58% <66.66%> (-0.87%) ⬇️
...-util-uibuilder/src/commands/generateComponents.ts 81.39% <100.00%> (ø)
...ilder/src/commands/utils/shouldRenderComponents.ts 53.84% <100.00%> (+3.84%) ⬆️
...li/src/domain/amplify-usageData/getUsageDataUrl.ts 100.00% <0.00%> (+12.50%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@SwaySway
Copy link
Contributor Author

failing test in ci passed locally with change

Debugger attached.
 PASS  __tests__/pullAndInit.test.ts (1202.394 s)
------------------------------|---------|----------|---------|---------|----------------------------
File                          | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s          
------------------------------|---------|----------|---------|---------|----------------------------
All files                     |   41.41 |    26.21 |    37.5 |   39.83 |                            
 src                          |    44.7 |    28.57 |   53.84 |   41.25 |                            
  profile-helper.ts           |    36.5 |    26.31 |      25 |    36.5 | 30-32,44-101               
  setup-profile.ts            |       0 |      100 |       0 |       0 | 1-8                        
  util.ts                     |   93.75 |       50 |      75 |    90.9 | 16                         
 src/consoleHosting           |       0 |        0 |       0 |       0 |                            
  consoleHosting.ts           |       0 |        0 |       0 |       0 | 1-223                      
  constants.ts                |       0 |      100 |     100 |       0 | 1-14                       
  utils.ts                    |       0 |        0 |       0 |       0 | 1-87                       
 src/pullAndInit              |   81.29 |    63.63 |   81.25 |   82.85 |                            
  amplifyArtifactsManager.ts  |     100 |      100 |     100 |     100 |                            
  amplifyConsoleOperations.ts |    53.7 |        0 |   45.45 |   58.33 | 12-13,18-24,28-54,66,79,93 
  deleteProject.ts            |    87.5 |       50 |     100 |    87.5 | 14                         
  initProject.ts              |    87.5 |       50 |     100 |    87.5 | 23                         
  pullProject.ts              |   92.59 |       75 |     100 |   91.66 | 51,94                      
------------------------------|---------|----------|---------|---------|----------------------------

Test Suites: 1 passed, 1 total
Tests:       4 passed, 4 total
Snapshots:   0 total
Time:        1208.139 s
Ran all test suites matching /__tests__\/pullAndInit.test.ts/i.

@awsluja awsluja merged commit b1fdc86 into aws-amplify:dev Oct 19, 2022
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