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(appsync): appsync.HttpDataSourceProps erroneously extends BaseDataSourceProps #32065

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

ScottRobinson03
Copy link
Contributor

Reason for this change

Closes #31979.
Replaces #29689.

In #11185, the HttpDataSource class was updated to extend BackedDataSource instead of BaseDataSource, however the HttpDataSourceProps type wasn't updated to reflect this change. This PR makes the HttpDataSourceProps type reflect the change.

Description of changes

Makes the HttpDataSourceProps type extend BackedDataSourceProps, instead of BaseDataSourceProps. This means users are able to provide the serviceRole prop without getting a type error.

Description of how you validated changes

The below code snippet no longer gives an incorrect type error when providing the serviceRole, as it did before:

import * as appsync from "aws-cdk-lib/aws-appsync";
import type { IRole } from "aws-cdk-lib/aws-iam";

declare const myApi: appsync.GraphqlApi;
declare const serviceRole: IRole;

const stepFunctionHttpDataSource = new appsync.HttpDataSource(
    myApi,
    "MyStepFunctionHTTPDataSource",
    {
        api: myApi,
        authorizationConfig: {
            signingRegion: "eu-west-1",
            signingServiceName: "states",
        },
        endpoint: `https://states.eu-west-1.amazonaws.com`,
        name: "StepFunctionHTTPDataSource",
        // Providing the `serviceRole` now correctly DOESN'T throw a type error
        serviceRole,
    }
);

@github-actions github-actions bot added bug This issue is a bug. effort/small Small work item – less than a day of effort p2 labels Nov 8, 2024
@aws-cdk-automation aws-cdk-automation requested a review from a team November 8, 2024 12:05
@github-actions github-actions bot added the beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK label Nov 8, 2024
Copy link
Collaborator

@aws-cdk-automation aws-cdk-automation left a comment

Choose a reason for hiding this comment

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

The pull request linter has failed. See the aws-cdk-automation comment below for failure reasons. If you believe this pull request should receive an exemption, please comment and provide a justification.

A comment requesting an exemption should contain the text Exemption Request. Additionally, if clarification is needed add Clarification Request to a comment.

@ScottRobinson03 ScottRobinson03 changed the title fix: Make HttpDataSourceProps extend BackedDataSourceProps instead of… fix(appsync): appsync.HttpDataSourceProps erroneously extends BaseDataSourceProps Nov 8, 2024
@ScottRobinson03
Copy link
Contributor Author

Exemption Request

This PR only fixes a TypeScript type, so there's no runtime code to integrate test.

@aws-cdk-automation aws-cdk-automation added pr-linter/exemption-requested The contributor has requested an exemption to the PR Linter feedback. pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. labels Nov 8, 2024
gracelu0
gracelu0 previously approved these changes Dec 4, 2024
@gracelu0 gracelu0 added pr-linter/exempt-test The PR linter will not require test changes pr-linter/exempt-integ-test The PR linter will not require integ test changes labels Dec 4, 2024
@aws-cdk-automation aws-cdk-automation removed the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label Dec 4, 2024
@aws-cdk-automation aws-cdk-automation dismissed their stale review December 4, 2024 01:13

✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.

Copy link
Contributor

mergify bot commented Dec 4, 2024

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@mergify mergify bot dismissed gracelu0’s stale review December 4, 2024 10:22

Pull request has been modified.

Copy link

codecov bot commented Dec 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 78.66%. Comparing base (c5bcfdc) to head (3d6583f).

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #32065      +/-   ##
==========================================
- Coverage   78.67%   78.66%   -0.02%     
==========================================
  Files         107      107              
  Lines        7237     7237              
  Branches     1329     1329              
==========================================
- Hits         5694     5693       -1     
- Misses       1357     1358       +1     
  Partials      186      186              
Flag Coverage Δ
suite.unit 78.66% <ø> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
packages/aws-cdk 78.66% <ø> (-0.02%) ⬇️

@aws-cdk-automation aws-cdk-automation added the pr/needs-maintainer-review This PR needs a review from a Core Team Member label Dec 4, 2024
@ScottRobinson03
Copy link
Contributor Author

@gracelu0 Looks like the codegen check is still "broken" (this was an issue in my previous PR too). Are you able to look into this?

@gracelu0
Copy link
Contributor

gracelu0 commented Dec 4, 2024

@Mergifyio update

Copy link
Contributor

mergify bot commented Dec 4, 2024

update

✅ Branch has been successfully updated

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildv2Project1C6BFA3F-wQm2hXv2jqQv
  • Commit ID: 3d6583f
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

Copy link
Contributor

mergify bot commented Dec 4, 2024

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@aws-cdk-automation aws-cdk-automation removed the pr/needs-maintainer-review This PR needs a review from a Core Team Member label Dec 4, 2024
Copy link
Contributor

mergify bot commented Dec 4, 2024

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK bug This issue is a bug. effort/small Small work item – less than a day of effort p2 pr-linter/exempt-integ-test The PR linter will not require integ test changes pr-linter/exempt-test The PR linter will not require test changes pr-linter/exemption-requested The contributor has requested an exemption to the PR Linter feedback.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

appsync: appsync.HttpDataSourceProps erroneously extends BaseDataSourceProps
4 participants