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

x/build/app/appengine: deploying with clean working tree affects the deploy because certain files are in .gitignore but not .gcloudignore #36553

Open
dmitshur opened this issue Jan 14, 2020 · 3 comments

Comments

@dmitshur
Copy link
Member

@dmitshur dmitshur commented Jan 14, 2020

In x/build right now:

build $ find . -name '.gitignore' | wc -l
      16
build $ find . -name '.gcloudignore'
./app/appengine/.gcloudignore
./.gcloudignore

Not all the files that are gitignored are included in .gcloudignore files, so it's possible to have a clean working status as reported by git status, but still have unwanted files get included in the deploy. That can cause increase in deploy time, or failures (see #34936 (comment)).

I think we should either remove .gitignore files that we can get by without (so that files aren't invisible when you do git status), or include them into .gcloudignore.

My preference is to remove .gitignore files, but I don't know if others find them more useful than harmful. Thoughts?

/cc @bradfitz @cagedmantis @toothrot

@bradfitz

This comment has been minimized.

Copy link
Contributor

@bradfitz bradfitz commented Jan 14, 2020

I think we should make an x/build/cmd/xb subcommand that makes a temp dir and clones a clean checkout into that tempdir and deploys from there. (and only allowing copying modified files if a flag like --dirty is given)

@toothrot

This comment has been minimized.

Copy link
Contributor

@toothrot toothrot commented Jan 14, 2020

Another alternative is to always use Cloud Build to run the deploy process instead of running gcloud locally. Cloud Build can do a fresh checkout and run the deploy, thereby removing the local environment from the equation.

@dmitshur

This comment has been minimized.

Copy link
Member Author

@dmitshur dmitshur commented Jan 14, 2020

I've remembered something that should be taken into account if we consider removing/reducing .gitignore files.

Some of the env directories have scripts that use said directories for "caching" some artifacts, and avoiding re-downloading them if they're already present. For example:

https://github.com/golang/build/blob/1a1d5714b86442e273799824180b67685637717a/env/openbsd-amd64/make.bash#L26-L32

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.