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

feat(add-tav-action): add test-all-versions as github action #778

Merged
merged 24 commits into from
Dec 29, 2021

Conversation

haddasbronfman
Copy link
Member

@haddasbronfman haddasbronfman commented Dec 7, 2021

Which problem is this PR solving?

Short description of the changes

I added a new github action, which is using dorny/paths-filter to get all the changed packages, and for each such package, I run the command "npm run test-all-versions" - if it exist.

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Dec 7, 2021

CLA Signed

The committers are authorized under a signed CLA.

@haddasbronfman haddasbronfman marked this pull request as ready for review December 8, 2021 07:35
@haddasbronfman haddasbronfman requested a review from a team December 8, 2021 07:35
@dyladan
Copy link
Member

dyladan commented Dec 8, 2021

it seems like you're filtering only the packages which have changed using some other action? Why not use the built-in lerna filtering functionality?

@codecov
Copy link

codecov bot commented Dec 8, 2021

Codecov Report

Merging #778 (a32ffad) into main (b6110c6) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main     #778   +/-   ##
=======================================
  Coverage   94.90%   94.90%           
=======================================
  Files          13       13           
  Lines         707      707           
  Branches      142      142           
=======================================
  Hits          671      671           
  Misses         36       36           

@dyladan
Copy link
Member

dyladan commented Dec 8, 2021

Looks like the check fails

Copy link
Member

@dyladan dyladan left a comment

Choose a reason for hiding this comment

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

It looks like you don't install dependencies or build the packages. Are you sure it will work? Can you please make a small change to a package with a test-all-versions script so we can verify that it runs properly? Modifying the readme slightly should be enough.

with:
fetch-depth: 0
- run: npm install test-all-versions
- run: lerna run test-all-versions --since origin/main
Copy link
Member

Choose a reason for hiding this comment

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

nit

Suggested change
- run: lerna run test-all-versions --since origin/main
- run: lerna run test-all-versions --since origin/main

@dyladan
Copy link
Member

dyladan commented Dec 9, 2021

you need to install dependencies and build the project. You can see how this is done in the unit test workflow but usually you have to do npm install --ignore-scripts, then lerna bootstrap --since origin/main --include-dependencies, then lerna run compile --since origin/main --include-dependencies. Then you should be able to do the test all versions script.

@dyladan
Copy link
Member

dyladan commented Dec 9, 2021

the feat identifier in the title signifies the minor version number to be incremented in our release automation. Please use a more appropriate conventional commits identifier like test

@dyladan
Copy link
Member

dyladan commented Dec 9, 2021

I'm not sure why it says mongo isn't started. @rauno56 is there some additional needed step for the tav script?

@rauno56
Copy link
Member

rauno56 commented Dec 10, 2021

Some tests need an service to be running in order to work: see "services" in unit-test.yml.

@blumamir
Copy link
Member

Thanks for adding this.
The current action will run only against packages that had changes in each PR.
This will do a good job of catching errors with old versions that are introduced in the current PR.

Instrumentations are patching the internal logic of packages that are out of our control. It means that if the original instrumented library author published a new version to npm which breaks something in the instrumentation, no automatic process will catch that until someone makes a change to the instrumentation packages, or when a user complains (probably after something breaks in his deployment due to the OTEL installation).

This had happened before with aws-sdk, which has a complex internal logic and tends to publish new versions often.

At the opentelemetry-ext-js project we run test-all-versions on all packages every day with github actions scheduled-events, so if someone pushes a new version to npm which is not compatible with the current instrumentation, we get notified (in slack) after at most 24 hours.
Github action configuration for reference: https://github.com/aspecto-io/opentelemetry-ext-js/blob/master/.github/workflows/daily-test.yml
sidenote: the daily tests currently fails due to kafkajs, we need to look at it and fix it

@vmarchaud
Copy link
Member

At the opentelemetry-ext-js project we run test-all-versions on all packages every day with github actions scheduled-events, so if someone pushes a new version to npm which is not compatible with the current instrumentation, we get notified (in slack) after at most 24 hours.

We could do both but i worry it may require too much bandwith to fix them when alert comes off (i guess it depend of component maintainers) resulting in maintainer generally ignoring errors

@dyladan
Copy link
Member

dyladan commented Dec 15, 2021

At the opentelemetry-ext-js project we run test-all-versions on all packages every day with github actions scheduled-events, so if someone pushes a new version to npm which is not compatible with the current instrumentation, we get notified (in slack) after at most 24 hours.

We could do both but i worry it may require too much bandwith to fix them when alert comes off (i guess it depend of component maintainers) resulting in maintainer generally ignoring errors

I think not knowing about errors is a worse outcome than having errors that go unfixed for a while. I think this comes down to trusting the component authors and giving them a chance to succeed first before assuming they will fail.

@vmarchaud
Copy link
Member

vmarchaud commented Dec 15, 2021

Lets do both then ?

- run: npm install --ignore-scripts
- run: lerna bootstrap --since origin/main --include-dependencies
- run: lerna run compile --since origin/main --include-dependencies
- run: lerna run test-all-versions --since origin/main --stream --concurrency=1
Copy link
Member

Choose a reason for hiding this comment

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

nit:

Suggested change
- run: lerna run test-all-versions --since origin/main --stream --concurrency=1
- run: lerna run test-all-versions --since origin/main --stream --concurrency=1

Copy link
Member

@vmarchaud vmarchaud left a comment

Choose a reason for hiding this comment

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

waiting for the cron scheduled workflow to be added before approving, otherwise seems good

@dyladan
Copy link
Member

dyladan commented Dec 27, 2021

@vmarchaud this particular action runs only the changed packages on pull requests. I think the full all-package cron can be done in a follow-up PR. @haddasbronfman do you agree?

@vmarchaud
Copy link
Member

@haddasbronfman do you agree?

We discussed this privately on slack, i suggested to make only one for both (since it's closely related) but if you believe its bettter to make two i don't mind

@dyladan
Copy link
Member

dyladan commented Dec 27, 2021

@haddasbronfman do you agree?

We discussed this privately on slack, i suggested to make only one for both (since it's closely related) but if you believe its bettter to make two i don't mind

No I just didn't realize you had already discussed this. Go ahead with whatever you already decided.

@vmarchaud
Copy link
Member

@haddasbronfman As you prefer then :)

@haddasbronfman
Copy link
Member Author

Hi,
I prefer to do it on another PR is this is ok with you.

@vmarchaud vmarchaud merged commit 77aefa6 into open-telemetry:main Dec 29, 2021
rauno56 added a commit to rauno56/opentelemetry-js-contrib that referenced this pull request Jan 3, 2022
@dyladan dyladan mentioned this pull request Feb 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants