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

new: Adding cross repo testing workflow for Release #378

Merged
merged 20 commits into from
Mar 12, 2024

Conversation

ykim-1
Copy link
Contributor

@ykim-1 ykim-1 commented Mar 12, 2024

📝 Description

There is a need to run Ansible integration tests before releasing Linode-py to ensure there are no breaking changes. This PR is a POC for one of the ways to get this done.

The workflow provided in the PR automates testing for Ansible collections on pull request (PR) opening on main branch. Here's a concise overview:

Purpose: Automate testing for Ansible collections in SDK repo using the latest code available
Trigger: Runs on PR opening to the main branch or manually triggered.
Job:

  • Environment: Ubuntu
  • Steps:
  1. Checkout repositories
  2. Update system packages and install build essentials
  3. Set up Python version 3.10
  4. Install linode_api4 using the latest code and dependencies
  5. Install Ansible dependencies
  6. Replace existing keys
  7. Run tests with make testall

✔️ How to Test

https://github.com/ykim-1/linode_api4-python/actions/runs/8241152046/job/22537846853

Tested on a forked repo after opening a PR to main
image

📷 Preview

If applicable, include a screenshot or code snippet of this change. Otherwise, please remove this section.

@ykim-1 ykim-1 requested a review from a team as a code owner March 12, 2024 00:06
@ykim-1 ykim-1 requested review from jriddle-linode and yec-akamai and removed request for a team March 12, 2024 00:06
@ykim-1 ykim-1 marked this pull request as draft March 12, 2024 00:06
@zliang-akamai
Copy link
Member

Let's use the latest version of each action? For example, checkout@v4

@ykim-1 ykim-1 marked this pull request as ready for review March 12, 2024 16:02
@ykim-1 ykim-1 requested review from a team, lgarber-akamai and zliang-akamai and removed request for a team March 12, 2024 16:02
- name: install dependencies
run: |
cd .ansible/collections/ansible_collections/linode/cloud
pip install -r requirements.txt -r requirements-dev.txt --upgrade-strategy only-if-needed
Copy link
Contributor

Choose a reason for hiding this comment

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

Just for some added confidence, would it make sense to install linode_api4 after installing the Ansible Collection deps?

Copy link
Contributor Author

@ykim-1 ykim-1 Mar 12, 2024

Choose a reason for hiding this comment

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

I verified that the one built is being used in my local environment

╰─➤  pip install linode_api4 --upgrade-strategy only-if-needed
Requirement already satisfied: linode_api4 in ./venv/lib/python3.10/site-packages (0.0.0.dev0)
Requirement already satisfied: requests in ./venv/lib/python3.10/site-packages (from linode_api4) (2.31.0)

I think doing it after might be complicated considering it will be overwritten

cd .ansible/collections/ansible_collections/linode/cloud
make testall
env:
LINODE_API_TOKEN: ${{ secrets.DX_LINODE_TOKEN }}
Copy link
Contributor

Choose a reason for hiding this comment

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

I think the API token secret for this repo is LINODE_TOKEN rather than DX_LINODE_TOKEN 👍

Copy link
Contributor

@lgarber-akamai lgarber-akamai left a comment

Choose a reason for hiding this comment

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

Works well on my fork other than the feedback left above: https://github.com/lgarber-akamai/linode_api4-python/actions/runs/8253793207/job/22576579523

Giving this my preemptive approval 🙂

Copy link
Collaborator

@jriddle-linode jriddle-linode left a comment

Choose a reason for hiding this comment

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

LGTM

@ykim-1 ykim-1 merged commit bf7f173 into linode:dev Mar 12, 2024
7 checks passed
@jriddle-linode jriddle-linode added the repo-ci-improvement for improvements in the repository or CI workflow in the changelog. label Apr 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
repo-ci-improvement for improvements in the repository or CI workflow in the changelog.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants