-
Notifications
You must be signed in to change notification settings - Fork 1
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
NH-26173 Add sdist and wheel extension checks at package build #75
Conversation
This reverts commit 5dbd83a.
c961c97
to
9448800
Compare
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.
LGTM and your approach of splitting them up makes sense to me @tammy-baylis-swi! I left some minor comments, none are blockers :)
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: ./.github/actions/package_solarwinds_apm |
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.
Does the Create draft release
job need these above steps to checkout the repo (maybe?) and build the package (seems no?)
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.
Yes, package_solarwinds_apm
isn't needed. Removed in 0f755db.
I thiiiink the checkout
isn't needed either for gh release create
if we specify --repo
. This doc doesn't make it super clear to me: https://cli.github.com/manual/gh_release_create. But this blog (haha) says:
In fact GitHub releases created by any means trigger the package build and upload workflow. For example I could run GitHub CLI’s gh release create command from any directory on my local machine. This doesn’t require me to have a local copy of the project or to have anything setup locally other than GitHub CLI itself:
$ gh release create --repo seanh/gha-python-packaging-demo --generate-notes 0.0.1
https://github.com/seanh/gha-python-packaging-demo/releases/tag/0.0.1
So I'm going to give this a try and report back!
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.
...Actually don't think I can test this as is until next release. Changed in 70e469b and trying something else.
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.
We do need the checkout! This run failed: https://github.com/appoptics/solarwinds-apm-python/actions/runs/3441033073/jobs/5740153872
Run git config user.name "GitHub Actions"
git config user.name "GitHub Actions"
git config user.email noreply@github.com
shell: /usr/bin/bash -e {0}
env:
RELEASE_NAME: rel-0.[2](https://github.com/appoptics/solarwinds-apm-python/actions/runs/3441033073/jobs/5740153872#step:2:2).2
fatal: not in a git directory
Error: Process completed with exit code 12[8](https://github.com/appoptics/solarwinds-apm-python/actions/runs/3441033073/jobs/5740153872#step:2:9).
- name: Open Pull Request for version bump | ||
run: gh pr create --title "Update agent version to ${{ env.RELEASE_VERSION }}" --body "Upgrade agent version" | ||
- name: Open draft Pull Request for version bump | ||
run: gh pr create --draft --title "solarwinds-apm ${{ env.RELEASE_VERSION }}" --body "For PyPI release of solarwinds-apm ${{ env.RELEASE_VERSION }}. See also CHANGELOG.md." |
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.
Nice!
|
||
if [ -z "$PIP_INSTALL" ]; then | ||
echo -e "PIP_INSTALL not specified." | ||
echo -e "Using APM_ROOT to use one existing cp38 x86_64 wheel" |
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.
Nit: may be clearer to say something like "only testing the cp38 x86_64 wheel under ${APM ROOT}"
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.
Sounds good! Changed in 5496b3b
@cd $(CURR_DIR) | ||
|
||
# Build and check the full Python agent distribution (sdist and wheels) | ||
package: sdist check-sdist-local manylinux-wheels check-wheel-local |
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.
Minor, the check-*
tasks already depend on the sdist
and manylinux-wheels
tasks, so don't need them in the package
task... or if it seems clearer, the check-*
tasks don't have them as deps.
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.
Yes good call! Addressed in 5496b3b
Thanks @cheempz ! I've addressed your comments. We will have to keep the |
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.
Good to know, thanks for the revisit @tammy-baylis-swi!
Add sdist and wheel extension checks at package build as part of the
make package
target.make package
is called locally or by GH workflows viapackage_solarwinds_apm
(by all of TestPyPI, PackageCloud, PyPI publishes). This way, the extensions are checked immediately after sdist/wheel creation andexit 1
if they fail. For the GH workflows, this should stop everything before the actual upload step.To implement this I've split up the existing install test bash scripts so that the check sdist/wheel calls can be accessed separately by Makefile without doing the full install, instrument, and startup checks (is that what we want?)
I've been tested this locally with:
./run_docker_dev
thenmake package
cd tests/docker/install
andMODE=local docker-compose up py3.7-install-alpine3.13
MODE=testpypi
So far this hasn't caught anything unusual like what happened with solarwinds-apm 0.2.0 publish to PyPI.
I think I'll have to wait until our next TestPyPI/PackageCloud/PyPI publish to make sure this works there too.
Bonus: I've also updated some of the GH workflows themselves. The PyPI release PRs will be a bit more informative than this one and will be drafts because most times an additional commit for changelog update is needed. The publish and release creation workflow should also be a bit more clean than this run; the 2nd action now has a name and the third action gives some separation.
Please let me know what you think!