Skip to content

chore: Add validation to test release codebuild spec #326

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

Merged
merged 5 commits into from
Mar 26, 2021

Conversation

farleyb-amazon
Copy link
Contributor

@farleyb-amazon farleyb-amazon commented Mar 25, 2021

Description of changes:

Now the test release validation does the same checks as the prod release (running the sample application against the new version), but targeting testpypi. To support this I've also refactored out the validation steps into a dedicated spec so both the prod and test specs can depend on it.

Testing:
Prod and test releases succeed (without any version uploaded, because it hasn't changed) when I give them the correct version and commit.

When I give a bad commit, we fail to checkout the branch and stop.

When I give a good commit but bad version, we detect that the authoritative version in identifiers.py does not match the requested version and stop.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Now the test release validation does the same checks as the prod release
(running the sample application against the new version). To support this
I've also refactored out the validation steps into a dedicated spec so both
the prod and test specs can depend on it.
@farleyb-amazon farleyb-amazon force-pushed the release-validation branch 2 times, most recently from 6a72e0a to a0c74cf Compare March 25, 2021 21:54
- git checkout $COMMIT_ID
- FOUND_VERSION=$(sed -n 's/__version__ = "\(.*\)"/\1/p' src/aws_encryption_sdk/identifiers.py)
- |
if expr ${FOUND_VERSION} != ${VERSION}; then
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm assuming VERSION has to be provided manually when executing this build? Is there a good place to document a repository's available build commands and how to call them?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Correct, and good question. There is a spot for environment variables, but it looks like they do require you pass a value, and I didn't want to provide a default for the version. Worst case we could add comments, but let me look a bit more to see if there are other options.

fast-fail: false
build-list:
fast-fail: true
build-graph:
- identifier: test_release
Copy link
Contributor

Choose a reason for hiding this comment

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

These labels are a little confusing: in isolation I'm not sure if this one means "test the release" or "release the test artifact". Perhaps we can use phrases like "release to production" vs "release to staging"?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Makes sense, will update wording.

runtime-versions:
python: latest
pre_build:
Copy link
Contributor

Choose a reason for hiding this comment

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

What's the functional difference between build and pre_build?

Copy link
Contributor Author

@farleyb-amazon farleyb-amazon Mar 26, 2021

Choose a reason for hiding this comment

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

To be honest I haven't found a clear description of any functional differences. The docs provide some examples of what you could do in each one, but there doesn't seem to be anything concrete. My grouping here is fairly arbitrary, so I'm open to suggestions.

Copy link
Contributor

Choose a reason for hiding this comment

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

This is fine, it looks like pre_build/build/post_build are really just to help organize the phases, and this seems to fit well.

@farleyb-amazon farleyb-amazon merged commit adb6c72 into aws:master Mar 26, 2021
@farleyb-amazon farleyb-amazon deleted the release-validation branch March 26, 2021 20:13
robin-aws pushed a commit to robin-aws/aws-encryption-sdk-python that referenced this pull request Apr 27, 2021
Now the test release validation does the same checks as the prod release
(running the sample application against the new version). To support this
I've also refactored out the validation steps into a dedicated spec so both
the prod and test specs can depend on it.
robin-aws pushed a commit that referenced this pull request Apr 28, 2021
Now the test release validation does the same checks as the prod release
(running the sample application against the new version). To support this
I've also refactored out the validation steps into a dedicated spec so both
the prod and test specs can depend on it.
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