Skip to content
This repository was archived by the owner on Nov 8, 2024. It is now read-only.

Conversation

typotter
Copy link
Collaborator

@typotter typotter commented Aug 21, 2024

🎟️ Fixes FF-3094 towards FF-3085

πŸ‘―β€β™‚οΈ Related PRs

Motivation

Changes are often made to the sdk-test-data repository to capture new behaviours, bugs and edge cases. When these changes are pushed to main, the SDKs are cloned locally (locally to the github action running) and their respective tests are run. These tests are set up and run by copies of the SDK test workflows - see sdk-test-data workflow. There are a number of limitations to this setup:

  • Test steps are copied from the SDK’s respective workflows; changes to the SDK test workflows need to be replicated in sdk-test-data and this is not obvious to devs
  • The SDK tests are not able to run against in-flight changes to sdk-test-data
  • When new test-data is committed that breaks an SDK, that breakage is not surfaced in the SDK’s repository until some action triggers its testing workflow (on demand, on pull-request, etc.).

Description of Changes

This change
πŸš€ - The test job is extracted into a composite action, allowing it to be called from both the SDK's local workflow as well as from workflows in other repositories.

External to this Change
sdk-test-data get two testing workflows.

  1. ♻️ "Local Testing"- For all pull request changes, the "Local Testing" workflow calls the reusable SDK workflows, test results are recorded only in the sdk-test-data action. This is run using the main SDK branch and the "current" branch of workflow, i.e. the pull request branch. (SDK repo does not see/is not notified of test failures during PR lifecycle, only on push to main)
  2. ♻️ πŸ§‘β€πŸ’» "Remote Testing" - On all pushes to the main branch of sdk-test-data, the SDK testing workflows are triggered to run within their respective repositories, alerting all subscribers of failed runs (repo is red/green).

@typotter typotter changed the title Tp/workflows/remote quality: parameterize branch names and extract test action Aug 21, 2024
@typotter typotter force-pushed the tp/workflows/remote branch from fa7349e to 6263c23 Compare August 21, 2024 16:08
@typotter typotter force-pushed the tp/workflows/remote branch from 6263c23 to 60bea96 Compare August 21, 2024 16:16
uses: 'google-github-actions/setup-gcloud@v0'
- name: "Run tests"
run: make test
- uses: Eppo-exp/python-sdk/.github/actions/action-test@tp/workflows/remote
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

temp branch reference.

Copy link
Contributor

Choose a reason for hiding this comment

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

Would a relative path work here and be more concise?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yes, yes it would, however, it requires an additional actions/checkout step to checkout the repo first, which is a step that needs to be done in the action, so it adds redundant work.

pull_request:
paths:
- '**/*'
workflow_dispatch:
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

allows workflow to be triggered remotely via API

Copy link
Contributor

Choose a reason for hiding this comment

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

I like the rename to be consistent with other SDKs as well 🧹

run-tests-with-tox:
runs-on: ubuntu-latest
steps:
- uses: "actions/checkout@v2"
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

extracted into a composite action. Keeps the main workflow file cleaner in exchange for some more boilerplate and yet another yaml file

pull_request:
paths:
- '**/*'
workflow_dispatch:
Copy link
Contributor

Choose a reason for hiding this comment

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

I like the rename to be consistent with other SDKs as well 🧹

uses: 'google-github-actions/setup-gcloud@v0'
- name: "Run tests"
run: make test
- uses: Eppo-exp/python-sdk/.github/actions/action-test@tp/workflows/remote
Copy link
Contributor

Choose a reason for hiding this comment

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

Would a relative path work here and be more concise?

@@ -0,0 +1,46 @@
name: 'Test SDK'
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we rename this file? action.yml feels kind of generic

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I might have read the docs wrong, but as I understand it, github expects action.yml for your action magic. The naming is in its containing directory where common convention is to prefix with action-.

Copy link
Contributor

Choose a reason for hiding this comment

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

oh right this is an action not a workflow, carry on

@typotter typotter requested a review from aarsilv August 29, 2024 15:06
@typotter typotter assigned aarsilv and unassigned typotter Aug 29, 2024
Copy link
Contributor

@aarsilv aarsilv left a comment

Choose a reason for hiding this comment

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

πŸ‘

@typotter typotter merged commit c534159 into main Aug 30, 2024
12 checks passed
@typotter typotter deleted the tp/workflows/remote branch August 30, 2024 07:13
uses: 'google-github-actions/setup-gcloud@v0'
- name: "Run tests"
run: make test
- uses: Eppo-exp/python-sdk/.github/actions/action-test@tp/workflows/remote
Copy link
Collaborator

Choose a reason for hiding this comment

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

@typotter you seem to forgot removing temp branch reference before merging? ^

This broke PR testing: https://github.com/Eppo-exp/python-sdk/actions/runs/10634064395/job/29480558050?pr=68

@typotter
Copy link
Collaborator Author

typotter commented Aug 30, 2024 via email

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants