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

Maintenance: Remove overrides from Parameters' BaseProvider #1213

Closed
1 of 2 tasks
dreamorosi opened this issue Jan 5, 2023 · 1 comment · Fixed by #1214
Closed
1 of 2 tasks

Maintenance: Remove overrides from Parameters' BaseProvider #1213

dreamorosi opened this issue Jan 5, 2023 · 1 comment · Fixed by #1214
Assignees
Labels
completed This item is complete and has been merged/shipped internal PRs that introduce changes in governance, tech debt and chores (linting setup, baseline, etc.) parameters This item relates to the Parameters Utility

Comments

@dreamorosi
Copy link
Contributor

Summary

The implementation for the upcoming Parameters utility's BaseProvider contains some method overrides as well as some aliased method in the children.

i.e. BaseProvider.ts

class BaseProvider {
  public async get(name: string, options?: SecretsGetOptionsInterface): Promise<undefined | string | Uint8Array | Record<string, unknown>>;
  public async get(name: string, options?: GetOptionsInterface): Promise<undefined | string | Uint8Array | Record<string, unknown>> {
    // ... method implementation
  }
}

i.e. SecretsProvider.ts

class SecretsProvider extends BaseProvider {
  public constructor() {
    super();
  }
  
  public async get(name: string, options?: SecretsGetOptionsInterface): Promise<undefined | string | Uint8Array | Record<string, unknown>> {
    super.get(name, options); 
  }
}

The alias in the child class (i.e. SecretsProvider) is needed so that, once build and exported, customers get the correct typings:
image

This however, causes type issues when the same parent class (BaseProvider) is extended by multiple child classes.

Why is this needed?

We need to remove the overrides and leave to the children classes the responsibility of giving the correct types.

Which area does this relate to?

Parameters

Solution

No response

Acknowledgment

@dreamorosi dreamorosi added internal PRs that introduce changes in governance, tech debt and chores (linting setup, baseline, etc.) parameters This item relates to the Parameters Utility confirmed The scope is clear, ready for implementation labels Jan 5, 2023
@dreamorosi dreamorosi self-assigned this Jan 5, 2023
@github-project-automation github-project-automation bot moved this from Pending review to Coming soon in AWS Lambda Powertools for TypeScript Jan 5, 2023
@dreamorosi dreamorosi added completed This item is complete and has been merged/shipped and removed confirmed The scope is clear, ready for implementation labels Jan 5, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Jan 5, 2023

⚠️ COMMENT VISIBILITY WARNING ⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

@github-actions github-actions bot added the pending-release This item has been merged and will be released soon label Jan 5, 2023
@dreamorosi dreamorosi removed the pending-release This item has been merged and will be released soon label Jan 13, 2023
@dreamorosi dreamorosi moved this from Coming soon to Shipped in AWS Lambda Powertools for TypeScript Jan 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
completed This item is complete and has been merged/shipped internal PRs that introduce changes in governance, tech debt and chores (linting setup, baseline, etc.) parameters This item relates to the Parameters Utility
Projects
None yet
1 participant