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

Closed
dmitshur opened this issue Jan 14, 2020 · 4 comments
Labels
Builders x/build issues (builders, bots, dashboards) NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made.
Milestone

Comments

@dmitshur
Copy link
Contributor

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

@dmitshur dmitshur added Builders x/build issues (builders, bots, dashboards) NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made. labels Jan 14, 2020
@gopherbot gopherbot added this to the Unreleased milestone Jan 14, 2020
@bradfitz
Copy link
Contributor

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
Copy link
Contributor

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
Copy link
Contributor Author

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

@dmitshur
Copy link
Contributor Author

dmitshur commented Jun 9, 2023

There's nothing to deploy inside app/appengine as of #34744, and cmd/coordinator is deployed via Cloud Build as part of progress on #57852.

I'm realizing that using Cloud Build from a local checkout doesn't entirely avoid the possibility of skew if there are mismatches between the checked-in .gitignore and .gcloudignore files. To really solve it, it'd need to be combined with remote repo cloning + triggering (e.g., as done in x/website deploys).

Since this issue refers to a component that doesn't exist and there haven't been noticeable problems in a long while, so I'll close it for now. We can file a new issue if this problem comes up again.

@dmitshur dmitshur closed this as not planned Won't fix, can't repro, duplicate, stale Jun 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Builders x/build issues (builders, bots, dashboards) NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made.
Projects
Archived in project
Development

No branches or pull requests

4 participants