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

Add Docker context build hash check #446

Merged
merged 15 commits into from
Jan 4, 2023
Merged

Add Docker context build hash check #446

merged 15 commits into from
Jan 4, 2023

Conversation

guineveresaenger
Copy link
Contributor

This PR introduces contextDigest as a computed (non-schematized) resource input.
Specifically, the provider's Check() function will detect any changes in the supplied docker build context and
calculate a hash of any changes, which will be passed to the resource as a contextDigest.
When this input changes on follwing updates to the stack, the Image resource will be re-build.
If there are no changes within the Docker build context, the resource will remain unchanged.
For any users of this provider, this encourages the use of a .dockerignore file to avoid unnecessary rebuilds.

Fixes #443.

  • First pass at adding contextDigest and passing in a more verbose diff

  • Set contextDigest in Diff as a nonschematized computed resource input

@github-actions
Copy link

Does the PR have any schema changes?

Looking good! No breaking changes found.
No new resources/functions.

@github-actions
Copy link

Does the PR have any schema changes?

Looking good! No breaking changes found.
No new resources/functions.

Copy link
Contributor

@AaronFriel AaronFriel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there's one change to make to meet the spec for return values for Diff(): https://pulumi-developer-docs.readthedocs.io/en/latest/providers/implementers-guide.html#id4

provider/provider.go Show resolved Hide resolved
Copy link
Member

@t0yv0 t0yv0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good - resolved the questions I had in-person. Would love to see a dedicated test case for this tho it might be tricky.

provider/provider.go Outdated Show resolved Hide resolved
provider/provider.go Show resolved Hide resolved
@github-actions
Copy link

Does the PR have any schema changes?

Looking good! No breaking changes found.
No new resources/functions.

@github-actions
Copy link

Does the PR have any schema changes?

Looking good! No breaking changes found.
No new resources/functions.

@github-actions
Copy link

Does the PR have any schema changes?

Looking good! No breaking changes found.
No new resources/functions.

@github-actions
Copy link

Does the PR have any schema changes?

Looking good! No breaking changes found.
No new resources/functions.

@github-actions
Copy link

Does the PR have any schema changes?

Looking good! No breaking changes found.
No new resources/functions.

@github-actions
Copy link

github-actions bot commented Jan 3, 2023

Does the PR have any schema changes?

Looking good! No breaking changes found.
No new resources/functions.

@github-actions
Copy link

github-actions bot commented Jan 3, 2023

Does the PR have any schema changes?

Looking good! No breaking changes found.
No new resources/functions.

@github-actions
Copy link

github-actions bot commented Jan 3, 2023

Does the PR have any schema changes?

Looking good! No breaking changes found.
No new resources/functions.

@github-actions
Copy link

github-actions bot commented Jan 3, 2023

Does the PR have any schema changes?

Looking good! No breaking changes found.
No new resources/functions.

@guineveresaenger guineveresaenger merged commit 985a2c5 into master Jan 4, 2023
@guineveresaenger guineveresaenger deleted the build-hash branch January 4, 2023 20:10
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.

Add Docker build context to Diff check
3 participants