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

Missing and overwritten scaffolding files when scaffolding is already in VCS #40

Closed
apolopena opened this issue Mar 1, 2021 · 1 comment
Assignees
Labels
bug Something isn't working passed-dev-qa Optional state. Use this when QAing other peoples fixes in another branch.ready to be merged to main

Comments

@apolopena
Copy link
Owner

apolopena commented Mar 1, 2021

Describe the bug

After project scaffolding is saved to the repo during the first workspace image build, subsequent rebuilds of the workspace image which may contain new scaffolding such as phpmyadmin, do not copy over. Also project scaffolding is created and copied over blindly even if it already exists which results in data loss.

Screenshots

Steps to reproduce

For the no vendor folder problem

  1. Create a fresh workspace of this repo
  2. Save project scaffolding to the repo
  3. Create a fresh workspace from the repo
  4. Force a rebuild of the workspace by incrementing the value for INVALIDATE_CACHE in .gitpod.Dockerfile

The vendor folder is no longer present and the project will not run.

For the existing front end scaffolding gets overwritten problem

  1. Create a fresh workspace of this repo, ensure no front end scaffolding is installed by default (see starter.ini)
  2. Save project scaffolding to the repo
  3. Modify starter.ini to install react
  4. save files to repo
  5. Create a fresh workspace with the repo
  6. Add a comment to resources/js/app.js (this content of the comment arbitrary)
  7. Save files to the repo
  8. Create a fresh workspace from the repo

The comment in `resources/js/app.js will be gone.

Expected behavior

Any new files created in the project scaffolding phase via .gitpod.Dockerfile such as the vendor folder or public/phpmyadmin should be copied over only if they do not already exist. Furthermore any scaffolding created during the init phase such as scaffolding created directly in the project folder (i.e react) should only be copied over if that scaffolding does not already exist in version control.

Additional information

Switch from mv to rsync so that all new files and directories will be copied over from ~/test-app

  • Hook to determine if laravel/ui has already been installed: composer show | grep laravel/ui >/dev/null && __ui=1 || __ui=0
  • Hook to determine if a node package such as react already exists. Use this for detecting existing frontend scaffolding already in version control.
node_package_exists () {
  [ -z $2 ] && local path='node_modules' || local path="$2/node_modules"
  ls "$path" 2>/dev/null | grep -w $1 >/dev/null 2>&1 && echo "1" || echo "0"
}
@apolopena apolopena added the bug Something isn't working label Mar 1, 2021
@apolopena apolopena self-assigned this Mar 1, 2021
@apolopena apolopena changed the title Missing files after repo save and a new workspace image is built. Missing files after project is in VCS and a new workspace image is built. Mar 3, 2021
@apolopena apolopena changed the title Missing files after project is in VCS and a new workspace image is built. Missing and overwritten scaffolding files when scaffolding is already in VCS Mar 4, 2021
@apolopena
Copy link
Owner Author

No dev-qa for vue was performed. It should be fine, if not it will be addressed if the issue arises.

@apolopena apolopena added passed-dev-qa Optional state. Use this when QAing other peoples fixes in another branch.ready to be merged to main and removed in-dev-qa labels Mar 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working passed-dev-qa Optional state. Use this when QAing other peoples fixes in another branch.ready to be merged to main
Projects
None yet
Development

No branches or pull requests

1 participant