Skip to content

Feature catalog generate output, add generic ApiLimitation#11606

Merged
steffyP merged 5 commits intoplayground_feature_catalogfrom
kms_playground_generic_limitation
Oct 1, 2024
Merged

Feature catalog generate output, add generic ApiLimitation#11606
steffyP merged 5 commits intoplayground_feature_catalogfrom
kms_playground_generic_limitation

Conversation

@steffyP
Copy link
Member

@steffyP steffyP commented Sep 30, 2024

Motivation

This PR is building on #11593, which in turn already builds on #11592.
The PR is targeting the playground_feature_catalog branch (#11592).

Changes

  • includes the KMS feature catalog + script from Prototyping api/feature coverage #11593
  • refactoring: move all feature-catalog related decorators into one package
  • add another decorator ApiLimitation than could be used in a generic way for specific api operations
  • PoC for generating json-output using the feature-catalog classes, and collect api-operations that use those as decorator

@steffyP steffyP added the semver: patch Non-breaking changes which can be included in patch releases label Sep 30, 2024
@steffyP steffyP added this to the Playground milestone Sep 30, 2024
@steffyP steffyP self-assigned this Sep 30, 2024
@steffyP steffyP changed the title Feature catalog generate output Feature catalog generate output, add generic ApiLimitation Oct 1, 2024
@steffyP steffyP requested a review from sannya-singal October 1, 2024 11:07
Comment on lines +374 to +375
@kms_api.CreateKey
@ApiLimitation(limitation="Status 'Updating' is not supported.")
Copy link
Member Author

@steffyP steffyP Oct 1, 2024

Choose a reason for hiding this comment

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

testing both approaches here: adding additional Limitations for an API operation using either a specific decorator kms_api.CreateKey or a generic one ApiLimitation.

  • the second option ApiLimitation can be reused for every operation, and we can provide the actual limitations as input (currently string, but we could change this to a list as well).
    • if there are a lot of limitations we could use constants that are defined in a separate file, to not pollute the code too much
    • tested this approach in the playground.py script, e.g. it will be added as api_limitation:
            "Provisioning": {
            "docs": {
              "general_docs": "Manage the creation and modification of the keys.",
              "implementation_status": "ImplementationStatus.FULLY_IMPLEMENTED",
              "support_type": "SupportStatus.SUPPORTED",
              "aws_docs_link": "https://docs.aws.amazon.com/kms/latest/developerguide/create-keys.html",
              "api_operations": [
                "CreateKey"
              ]
            },
            "operations": [
              "localstack.services.kms.provider.KmsProvider.create_key",
              "localstack.services.kms.provider.KmsProvider.update_key_description"
            ],
            "api_limitations": {
              "localstack.services.kms.provider.KmsProvider.create_key": "Status 'Updating' is not supported."
            }
          },
    

"PublicKey": crypto_key.public_key,
}

@handler("GenerateDataKeyPair")
Copy link
Member Author

Choose a reason for hiding this comment

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

i had to remove the empty handlers, as these somehow interfered with the tests in asf_utils.py - didn't investigate further, I am sure we could solve this and keeping the handler. On the other hand the handler doesn't do anything here :)

Copy link
Member Author

Choose a reason for hiding this comment

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

moved the script and adapted the paths. Originally added by @sannya-singal in #11593

@sannya-singal
Copy link
Contributor

Closing #11593 as the current branch pulls the related changes.

@steffyP steffyP marked this pull request as ready for review October 1, 2024 12:57
@steffyP steffyP requested a review from pinzon as a code owner October 1, 2024 12:57
@steffyP steffyP merged commit 61df19a into playground_feature_catalog Oct 1, 2024
@steffyP steffyP deleted the kms_playground_generic_limitation branch October 1, 2024 12:58
@sannya-singal sannya-singal self-assigned this Oct 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

semver: patch Non-breaking changes which can be included in patch releases

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants