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

amplifyconfiguration.dart is being added to .gitignore automatically #7591

Closed
MohammedNoureldin opened this issue May 31, 2021 · 6 comments
Closed
Labels
platform Issues tied to the general CLI platform question General question transferred This issue was transferred from another Amplify project

Comments

@MohammedNoureldin
Copy link

Is it ok that amplifyconfiguration.dart is being added to the .gitignore file automatically? I have just tried initializing my project, and this file was added to gitignore.

In my case I am using already existing resources, so that requires editing this file manually (if I am doing that correctly). If this file should be really excluded, how should I add my already existing resources?

My flutter --version output:

Flutter 2.0.5 • channel stable • https://github.com/flutter/flutter.git  
Framework • revision adc687823a (6 weeks ago) • 2021-04-16 09:40:20 -0700
Engine • revision b09f014e96
Tools • Dart 2.12.3
@MohammedNoureldin MohammedNoureldin changed the title amplifyconfiguration.dart is being added to the .gitignore automatically amplifyconfiguration.dart is being added to .gitignore automatically May 31, 2021
@ragingsquirrel3
Copy link

@MohammedNoureldin yes, by design the configuration file is added to the .gitignore. More info about that file is available on https://docs.amplify.aws/cli/reference/files#amplifyconfigurationjson , as well as other amplify configuration files. A few reasons for having in .gitignore by default is 1) the information in the file should not be shared publicly 2) if you use multiple amplify environments, the contents of that file might change as you switch environments, causing some strange behavior if checked in.

While that's the default behavior for those reasons, you might choose to to add that file to git to support the use case of adding existing resources and recording those changes in git. If you do that, be sure it's a private git repo and be aware that some Amplify CLI actions, such as changing environments, might overwrite custom changes to that file.

@MohammedNoureldin
Copy link
Author

MohammedNoureldin commented Jun 10, 2021

@ragingsquirrel3 thank you for your reply.

Why the information inside that file should not be published? If this data will be shipped anyway with the App to the public, why to not check it into the source control?

It is stated that amplifyconfiguration.dart is equivalent aws-exprots.js, which has no sensitive information (mentioned in the link you sent). So I suppose that pushing this to a public repo should not be a problem.

@haverchuck
Copy link
Member

haverchuck commented Jun 23, 2021

@MohammedNoureldin I am going to transfer this to the amplify-cli repository, as it is the amplify-cli which adds this file to .gitignore.

@haverchuck haverchuck transferred this issue from aws-amplify/amplify-flutter Jun 23, 2021
@josefaidt josefaidt added pending-triage Issue is pending triage transferred This issue was transferred from another Amplify project labels Jun 23, 2021
@josefaidt
Copy link
Contributor

Hey @MohammedNoureldin 👋 as @ragingsquirrel3 noted this is the default behavior for the CLI as checking this file into source control can cause unexpected behavior when using multiple environments and branches as it is specific to the currently-initialized app. You can choose to opt-in to checking this file into source control, however please be aware of the pitfalls such as the CLI making changes to this file and the gitignore as actions are performed.

@attilah attilah added question General question and removed pending-triage Issue is pending triage labels Jun 23, 2021
@attilah attilah added the platform Issues tied to the general CLI platform label Jun 23, 2021
@attilah
Copy link
Contributor

attilah commented Jun 23, 2021

Closing as the question has been answered.

@attilah attilah closed this as completed Jun 23, 2021
@github-actions
Copy link

This issue has been automatically locked since there hasn't been any recent activity after it was closed. Please open a new issue for related bugs.

Looking for a help forum? We recommend joining the Amplify Community Discord server *-help channels for those types of questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 23, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
platform Issues tied to the general CLI platform question General question transferred This issue was transferred from another Amplify project
Projects
None yet
Development

No branches or pull requests

5 participants