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

Diffs between code in git repo and code retrieved by amplify pull #4800

Closed
lorengordon opened this issue Jul 9, 2020 · 11 comments
Closed

Diffs between code in git repo and code retrieved by amplify pull #4800

lorengordon opened this issue Jul 9, 2020 · 11 comments
Assignees
Labels
bug Something isn't working functions Issues tied to the functions category not-reproducible Not able to reproduce the issue pending-response Issue is pending response from the issue author

Comments

@lorengordon
Copy link

Is your feature request related to a problem? Please describe.

Running amplify pull (or amplify env checkout <env> --restore or amplify env pull) results in changes due to white space. Very annoying for comparing diffs and working in a cicd workflow.

Seems to primarily affect functions. Using amplify function add generates a cloudformation template where spaces are used. After deploying the function with amplify push, a subsequent amplify pull replaces the source code with a template that uses tabs for white space! There tend to be a handful of other changes as well, as if the template json was prettified.

@litwicki litwicki transferred this issue from aws-amplify/amplify-hosting Jul 10, 2020
@jhockett
Copy link
Contributor

Hi @lorengordon what version of the CLI are you using? You can use amplify -v to find out.

@jhockett jhockett added the pending-triage Issue is pending triage label Jul 10, 2020
@lorengordon
Copy link
Author

@jhockett We started the project a week ago with v4.22.0 and updated to v4.23.0 a few days ago.

@lorengordon
Copy link
Author

I think a cdk provider for amplify could also solve this (#171), since cdk-generated cfn templates would not need to be committed to the repo.

@jhockett jhockett added the functions Issues tied to the functions category label Jul 13, 2020
@jhockett jhockett self-assigned this Jul 13, 2020
@jhockett jhockett added bug Something isn't working and removed pending-triage Issue is pending triage labels Jul 14, 2020
@jhockett
Copy link
Contributor

Hi @lorengordon, thanks for the bug report! I was able to reproduce this issue.

@lorengordon
Copy link
Author

lorengordon commented Jul 14, 2020

Thanks for confirming @jhockett. My workaround for now, is to use Amplify Console to manage all builds... Add team-provider-info.json to .gitignore and remove it from the repo, and coach contributors to never run any variation of amplify push or amplify pull locally. Just let the branch builds and pr previews do the work...

@litwicki litwicki assigned attilah and unassigned jhockett Sep 11, 2020
@attilah attilah added the not-reproducible Not able to reproduce the issue label Sep 12, 2020
@attilah
Copy link
Contributor

attilah commented Sep 12, 2020

@lorengordon could you please give it a try with the latest CLI version as I think this is fixed under the changes that involved uniform JSON read/write. I was not able to reproduce it with the latest version.

@attilah attilah added pending-response Issue is pending response from the issue author pending-close-response-required labels Sep 12, 2020
@lorengordon
Copy link
Author

@attilah planning to be working with amplify again this weekend, so good timing! Will let you know

@lorengordon
Copy link
Author

@attilah do you happen to know which pr might have fixed it? I don't see any linked references in this issue...

@lorengordon
Copy link
Author

@attilah I think this is good now. There's still some pain if you used amplify pull in an earlier version and committed the code that used tabs as whitespace, because now another amplify pull with a more recent version will change them back to spaces. Figure it should be a one time conversion though, so that seems fine.

(I'm testing now with amplify v4.29.1... would still be nice to know which version changed the behavior...)

@attilah
Copy link
Contributor

attilah commented Sep 14, 2020

@lorengordon one PR I could call out is this: #5125 that added the state management classes and JSON utility classes. The functions is fixed by some other PR that utilizing the new functions. Closing the issue as it seems to be solved.

@attilah attilah closed this as completed Sep 14, 2020
@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 May 25, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working functions Issues tied to the functions category not-reproducible Not able to reproduce the issue pending-response Issue is pending response from the issue author
Projects
None yet
Development

No branches or pull requests

3 participants