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

(CODEMGMT-1454) Ensure missing repo caches are re-synced #1210

Conversation

mwaggett
Copy link
Contributor

This commit updates the status method for stateful git repos to check for the
presence of the git cache when determining whether repo updates are necessary.
Previously, if the repo's working dir and git dir were present, but the cache
was missing, the @repo.dirty? check would fail when attempting to diff the
workdir (object not found - no match for id). This would occur during an
environment deploy if the environment used the same remote repo as another
environment that had been deleted (and thus its artifacts cleaned up). By
setting the status to :mismatched when the cache doesn't exist, we ensure that
the cache is resynced and the deployment may proceed.

This commit updates the `status` method for stateful git repos to check for the
presence of the git cache when determining whether repo updates are necessary.
Previously, if the repo's working dir and git dir were present, but the cache
was missing, the `@repo.dirty?` check would fail when attempting to diff the
workdir (`object not found - no match for id`). This would occur during an
environment deploy if the environment used the same remote repo as another
environment that had been deleted (and thus its artifacts cleaned up). By
setting the status to `:mismatched` when the cache doesn't exist, we ensure that
the cache is resynced and the deployment may proceed.
@mwaggett mwaggett requested a review from a team August 19, 2021 23:12
@Magisus
Copy link
Collaborator

Magisus commented Aug 19, 2021

We're going to add a test for the scenario that revealed this bug at a different level (in PE).

@Magisus Magisus merged commit 40455db into puppetlabs:main Aug 20, 2021
@mwaggett mwaggett deleted the ticket/main/codemgmt-1454-missing-worker-caches branch August 27, 2021 18:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants