Skip to content

new: Adding cross repo testing workflow for Release - #378

Merged
ykim-akamai merged 20 commits into
linode:devfrom
ykim-akamai:new/release_cross_testing_workflow
Mar 12, 2024
Merged

new: Adding cross repo testing workflow for Release#378
ykim-akamai merged 20 commits into
linode:devfrom
ykim-akamai:new/release_cross_testing_workflow

Conversation

@ykim-akamai

Copy link
Copy Markdown
Contributor

📝 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-akamai
ykim-akamai requested a review from a team as a code owner March 12, 2024 00:06
@ykim-akamai
ykim-akamai requested review from jriddle-linode and yec-akamai and removed request for a team March 12, 2024 00:06
@ykim-akamai
ykim-akamai marked this pull request as draft March 12, 2024 00:06
@zliang-akamai

Copy link
Copy Markdown
Member

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

@ykim-akamai
ykim-akamai marked this pull request as ready for review March 12, 2024 16:02
@ykim-akamai
ykim-akamai 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
Copy Markdown
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?

@ykim-akamai ykim-akamai Mar 12, 2024

Copy link
Copy Markdown
Contributor Author

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
Copy Markdown
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 👍

@lgarber-akamai lgarber-akamai left a comment

Copy link
Copy Markdown
Contributor

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 🙂

@jriddle-linode jriddle-linode left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@ykim-akamai
ykim-akamai merged commit bf7f173 into linode:dev Mar 12, 2024
@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