Skip to content

Incremental Prebuilds can sometimes execute an outdated config #7475

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

Closed
Tracked by #7812
jankeromnes opened this issue Jan 6, 2022 · 0 comments · Fixed by #7805
Closed
Tracked by #7812

Incremental Prebuilds can sometimes execute an outdated config #7475

jankeromnes opened this issue Jan 6, 2022 · 0 comments · Fixed by #7805
Assignees
Labels
feature: prebuilds team: webapp Issue belongs to the WebApp team type: bug Something isn't working

Comments

@jankeromnes
Copy link
Contributor

jankeromnes commented Jan 6, 2022

Bug description

When Incremental Prebuilds are enabled for a project, new prebuilds will look for a compatible parent prebuild (by looking up the ancestor commits) in order to use it as a base and make the new prebuild faster.

"Compatible" means, among other things, that both the parent and the new prebuild have the exact same set of init, before and prebuild tasks.

If a compatible parent prebuild is found, the new prebuild is started from the older prebuild, and simply runs the init tasks again:

ws = await this.createForPrebuiltWorkspace({span}, user, incrementalPrebuildContext, normalizedContextURL);

However, the effective configuration of the new incremental prebuild is copied over from the (parent) prebuild:

const config = { ... buildWorkspace.config };

This works well for before, prebuild and init tasks (because we check that they are identical when looking for a compatible parent), however, if the command tasks (or anything else in the config) has changed since the parent prebuild was created, the new incremental prebuild will get an outdated config and GITPOD_TASKS, and e.g. execute oudated command tasks on startup (even if the .gitpod.yml in the repo shows the newer tasks).

This happened to @mads-hartmann in #7456

Steps to reproduce

  1. Run a full Prebuild for a repository with both an init task and a command task, then wait for it to be successful
  2. Enable Incremental Prebuilds for that repository
  3. Push a new commit to the same branch as in 1. that modifies the command task, and wait for this new commit to prebuild successfully
  4. Open a workspace based on the new, incremental prebuild

Expected:

  • The new command task should be run

Observed:

  • The old command task is executed (or, if the .gitpod.yml did not have a command in 1., no command task is executed at all)

Workspace affected

No response

Expected behavior

No response

Example repository

No response

Anything else?

No response

@jankeromnes jankeromnes added feature: prebuilds type: bug Something isn't working team: webapp Issue belongs to the WebApp team labels Jan 6, 2022
@jankeromnes jankeromnes self-assigned this Jan 6, 2022
@jldec jldec moved this to Scheduled in 🍎 WebApp Team Jan 10, 2022
@jankeromnes jankeromnes moved this from Scheduled to In Progress in 🍎 WebApp Team Jan 25, 2022
Repository owner moved this from In Progress to Done in 🍎 WebApp Team Jan 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature: prebuilds team: webapp Issue belongs to the WebApp team type: bug Something isn't working
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant