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: Disallow certain targetNames in code generation (#2958) #2972

Merged
merged 1 commit into from
Apr 20, 2023

Conversation

BobaFetters
Copy link
Member

@BobaFetters BobaFetters commented Apr 20, 2023

Added new validation check to ensure the targetName given when using the embeddedInTarget module type does not conflict with existing libraries.

- Added new code gen error for `targetNameConflict`
- Added new `SwiftKeywords` static set for `DisallowedEmbeddedTargetNames`
- Updated `validate` function in `ApolloCodegen` to check for disallowed target names
@apollo-cla
Copy link

@BobaFetters: Thank you for submitting a pull request! Before we can merge it, you'll need to sign the Apollo Contributor License Agreement here: https://contribute.apollographql.com/

@netlify
Copy link

netlify bot commented Apr 20, 2023

Deploy Preview for apollo-ios-docs canceled.

Name Link
🔨 Latest commit 1b361a5
🔍 Latest deploy log https://app.netlify.com/sites/apollo-ios-docs/deploys/644194b5dc94ad00088932b2

Copy link
Member

@calvincestari calvincestari left a comment

Choose a reason for hiding this comment

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

This looks good, thanks for the quick fix!

I questioned whether we should have another test in CodegenCLITests::InitializeTests to validate the error is thrown to the command line during initialization but that validation is in another module with it's own test so I'm fine with it not being in the CLI tests.

@BobaFetters BobaFetters merged commit dab1c32 into main Apr 20, 2023
@BobaFetters BobaFetters deleted the fix/targetName-conflicts branch April 20, 2023 20:51
@calvincestari calvincestari mentioned this pull request May 1, 2023
7 tasks
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.

Disallow a target name of apollo when using a module type of embeddedInTarget(name:)
3 participants