generated from amazon-archives/__template_Apache-2.0
-
Notifications
You must be signed in to change notification settings - Fork 25
feat: only_publish_on_change #293
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
Draft
nbaillie
wants to merge
8
commits into
aws-greengrass:development
Choose a base branch
from
nbaillie:main
base: development
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 3 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
5e00647
feat: recipe-and-artifact-publish-only-on-change
nbaillie 3e7c2d9
Merge remote-tracking branch 'origin/recipe-and-artifact-publish-only…
nbaillie c997f52
feat: only_publish_on_change
nbaillie b33559a
fix: spelling for optionally in config_schema.json
nbaillie 711097f
fix: correct only_on_change item check list
nbaillie 912bb9b
fix: consolidated _validated_region and _get_region
nbaillie f45d0ac
fix: removed duplicate debug for finding latest version
nbaillie a603479
fix: remove DeepDiff as dependancy and replace with our own function …
nbaillie File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,3 +12,4 @@ | |
*.vscode | ||
venv/ | ||
coverage.xml | ||
.python-version |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should default to publishing regardless of recipe/artifact diff if any specific component version is specified in the gdk-config file. IMO, we only care about checking diffs if the version is set to NEXT_PATCH, as this will keep incrementing the patch version and creating new components. If someone specifies an actual component version such as 1.0.0 or 2.0.0 we should attempt the publish to that version regardless of differences.
I'm thinking in some scenario someone may be developing with NEXT_PATCH (say along a 1.0.0 major/minor version), then decide they want to publish the same unchanged component to 2.0.0 to move up a major version and test with other components looking for a version in that dependency range. Unless they remove the only_on_change part of their config, we wouldn't make the publish as it would still be the same component as the latest patch version in the 1.0.0 major/minor version which is still latest. It seems more useful to me for GDK to attempt this publish regardless, rather than prevent a publish to an explicitly defined version. Of course, since only_on_change is not default, they would have added that to their config file at some point themselves as well, so I'm open to hearing your thoughts on what the behavior should be when version isn't set to NEXT_PATCH.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thinking as bellow for scenarios:
version is NEXT_PATCH and only_on_change IS NOT set
version is NEXT_PATCH and only_on_change IS set
version is NOT NEXT_PATCH and only_on_change IS NOT set
version is NOT NEXT_PATCH and only_on_change IS set (this part was not in the initial PR)
--
Happy to leave the last one out and also stick to existing behavior, let me know if you think its something needed or not. and i'll make the change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The first three behaviors looks good to me. For the last scenario (version is NOT NEXT_PATCH and only_on_change IS set), if the version does exist, even if there are changes those changes would never be reflected in the component version, as we get something along the lines of the following error:
botocore.errorfactory.ConflictException: An error occurred (ConflictException) when calling the CreateComponentVersion operation: Component [componentname : componentversion] for account [000000000000] already exists with state: [DEPLOYABLE]
A customer would have to delete this component version before GDK could publish to it again with changes. The GDK currently doesn't do this, and we typically recommend customers to create new component versions when they have changes, so I think this error is sufficient as it describes the issue clearly. So checking if there are changes or not both results in the component version remaining unchanged if it already existed. I think leaving the last scenario out and just sticking to existing behavior would essentially have the same effect since the new publish doesn't actually change the component version even if there are changes.
Maybe an improvement here could be to warn in the GDK output if the S3 artifacts have been changed but the version already existed, since component artifacts that are uploaded could result in a different hash from the existing cloud component version's artifact details in the old recipe if they have been modified. But this would be a separate improvement not closely tied to the new only_on_change feature.