-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[GitHub Actions] Fix logic that was incorrectly skipping tests #10276
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
[GitHub Actions] Fix logic that was incorrectly skipping tests #10276
Conversation
|
@lhotari, @sijie, @eolivelli - PTAL. This is an urgent fix that should be merged as soon as we're good with it. |
|
Thank you @michaeljmarshall for investigating and debugging this. I'll review this soon. |
lhotari
left a comment
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. Good work @michaeljmarshall!
|
@lhotari thanks! I added comments to this staging PR michaeljmarshall#2 to show where and how I tested the changes. I haven't been able to find explicit documentation on this specific case of interpolation yet. However, it does seem that this change produces the expected outcome for the affected tests. |
eolivelli
left a comment
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
Yes, really good. I checked that while reviewing.
The documentation is here: https://docs.github.com/en/actions/reference/context-and-expression-syntax-for-github-actions#about-contexts-and-expressions . However there isn't a clear answer. the values are compared as string values and not numeric values. When using the other syntax, the explicit expressions Now There is no documentation about how to explicitly convert value to a number. I believe that your fix is the correct way to do it. Thanks for saving my day @michaeljmarshall ! |
I found the documentation. 'Literals': https://docs.github.com/en/actions/reference/context-and-expression-syntax-for-github-actions#literals . The fix is the correct way to convert to numbers for comparison. |
|
@lhotari thank you for finding and sharing the documentation! |
|
Just sharing more from the documentation: It that seems something like this could possibly work too. (I think this is very verbose compared to the solution in this PR)
|
…and run centos7 & windows cpp build only when there are cpp changes (#10376) Fixes #10373 ### Motivation Tests should be skipped for PR builds that only contain documentation changes. This is currently broken. A new build has been introduced for building the CPP client on Windows. Make the changes in `ci-cpp-build-centos7.yaml` and `ci-cpp-build-windows.yaml` so that the builds run only when there are changes in CPP client files (or the workflow definitions). ### Modifications Refactor logic to be less error prone. Use [`fromJSON`](https://docs.github.com/en/actions/reference/context-and-expression-syntax-for-github-actions#fromjson) function to parse a number in a string as a number. ### Additional Context #10276
Motivation
Currently, when there are changes made to code and documentation in the same PR, many of the tests are skipped because the conditional logic is not being parsed as expected.
@jerrypeng noticed this issue on this PR: #10254.
Modifications
Fix the usage of
${{}}.Verifying this change
I ran tests in my personal GitHub repository to validate this change. Here is the PR that shows it: https://github.com/michaeljmarshall/pulsar/pull/2/checks. I used echo to validate what changed. (Note that the PR uses the base of #10254 to reproduce the problem.)
Does this pull request potentially affect one of the following parts:
This affects all tests that run for PRs that include changes to documentation and code.