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: rest api policy size calculation #9576

Merged
merged 4 commits into from
Feb 3, 2022
Merged

fix: rest api policy size calculation #9576

merged 4 commits into from
Feb 3, 2022

Conversation

attilah
Copy link
Contributor

@attilah attilah commented Jan 21, 2022

Description of changes

Change REST API policy size calculation logic and numbers. The resource gets collapsed into a single resource with * when all the HTTP verbs are allowed for a path.

Issue #, if available

N/A

Description of how you validated changes

Manual deployments

Checklist

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

@attilah attilah requested a review from a team as a code owner January 21, 2022 20:45
@yuth yuth removed their assignment Jan 26, 2022
@yuth yuth requested a review from jhockett January 26, 2022 22:50
@yuth yuth changed the title WIP: fix: rest policy size calculation fix: rest api policy size calculation Jan 26, 2022
Copy link
Contributor

@jhockett jhockett left a comment

Choose a reason for hiding this comment

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

LGTM

@codecov-commenter
Copy link

Codecov Report

Merging #9576 (640dd5f) into master (3490719) will increase coverage by 0.12%.
The diff coverage is 78.57%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #9576      +/-   ##
==========================================
+ Coverage   52.76%   52.88%   +0.12%     
==========================================
  Files         821      821              
  Lines       45576    45580       +4     
  Branches     9731     9732       +1     
==========================================
+ Hits        24049    24107      +58     
+ Misses      19531    19477      -54     
  Partials     1996     1996              
Impacted Files Coverage Δ
...dformation/src/utils/consolidate-apigw-policies.ts 67.82% <78.57%> (+49.80%) ⬆️

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 3490719...640dd5f. Read the comment docs.

packages/amplify-e2e-tests/src/__tests__/api_5.test.ts Outdated Show resolved Hide resolved
@@ -16,16 +16,38 @@ import * as fs from 'fs-extra';
import * as path from 'path';
import { ProviderName } from '../constants';

// type information from input schema located at packages/amplify-category-api/resources/schemas/aPIGateway/APIGatewayCLIInputs.schema.json
Copy link
Contributor

Choose a reason for hiding this comment

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

aPIGateway 😄

Copy link
Contributor

Choose a reason for hiding this comment

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

That's how its named 😈

@yuth
Copy link
Contributor

yuth commented Jan 31, 2022

I think it should be fine since each REST API can have its own /items route (IIRC). Changing the name might help with debugging though.

@cjihrig In this test I am adding the paths to and existing API and increasing the number of routes in it rather than adding new REST API.

@ammarkarachi ammarkarachi merged commit 388d014 into aws-amplify:master Feb 3, 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.

Applications with multiple REST APIs and resources/API fail with Cannot exceed quota for PoliciesPerRole: 20
6 participants