-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Fix conditionals that trigger Artifact upload #38236
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
Conversation
Signed-off-by: Arthur Silva Sens <[email protected]>
Signed-off-by: Arthur Silva Sens <[email protected]>
.github/workflows/build-and-test.yml
Outdated
if: startsWith( matrix.go-version, '1.23' ) # only run junit/coverage on one version | ||
if: startsWith( matrix.go-version, '~1.23' ) # only run junit/coverage on one version | ||
run: make gotest-with-junit-and-cover GROUP=${{ matrix.group }} | ||
- uses: actions/upload-artifact@v4 | ||
if: startsWith( matrix.go-version, '1.23' ) # only upload artifact for one version | ||
if: startsWith( matrix.go-version, '~1.23' ) # only upload artifact for one version | ||
with: | ||
name: coverage-artifacts-${{ matrix.go-version }}-${{ matrix.runner }}-${{ matrix.group }} | ||
path: ${{ matrix.group }}-coverage.txt | ||
- uses: actions/upload-artifact@v4 | ||
if: startsWith( matrix.go-version, '1.23' ) # only upload artifact for one version | ||
if: startsWith( matrix.go-version, '~1.23' ) # only upload artifact for one version |
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.
@mx-psi @songy2, the problem was that the tilde was missing in the previous PRs. You can check this workflow that ran from the first commit: https://github.com/open-telemetry/opentelemetry-collector-contrib/actions/runs/13552199813/job/37878313056?pr=38236
There's one step called Debug startWith Condition
that shows what's expected
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.
Ah, nice catch!
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.
btw you tagged the wrong person :)))
.github/workflows/build-and-test.yml
Outdated
@@ -289,15 +289,15 @@ jobs: | |||
if: startsWith( matrix.go-version, '1.23' ) != true |
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.
Related to the comment above, what do we want to do with this part specifically? Currently we're running tests in both go versions, is that the intended behavior? Should we be testing only with go 1.23? go 1.24?
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.
We should be testing both versions, that looks a bit weird yep https://github.com/open-telemetry/opentelemetry-collector?tab=readme-ov-file#compatibility
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.
Ok, I'll just remove that conditional then... Just creates confusion
Artifacts were uploaded correctly :) https://github.com/open-telemetry/opentelemetry-collector-contrib/actions/runs/13552199813 ![]() |
Signed-off-by: Arthur Silva Sens <[email protected]>
ce755e3
to
26e86e0
Compare
Signed-off-by: Arthur Silva Sens <[email protected]>
I still want to make the two steps running tests mutually exclusive. I'm not sure if it's worth running a 1h long test execution on every PR if we're not using the JUnit artifacts on every PR |
Signed-off-by: Arthur Silva Sens <[email protected]>
That makes sense to me 👍 will wait to merge this until Yang has reviewed and you feel ready for it |
Signed-off-by: Arthur Silva Sens <[email protected]>
Should be ok from my side |
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.
Thanks for catching this!
All good from my end, let me know when you would like to merge 🚀 |
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> #### Description Uploads to codecov have been broken since #37875 was merged. Efforts have been made to address the reasoning behind why it's not working (eg #38236), but it's still failing. [Example recent failure:](https://github.com/open-telemetry/opentelemetry-collector-contrib/actions/runs/14409354807/job/40413708600) ``` Warning: No files were found with the provided path: receiver-0-coverage.txt. No artifacts will be uploaded. ``` This failure is hit [here](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/2e35cae16745dab737e1d0bf636119b4c669c9cd/.github/workflows/build-and-test.yml#L305). This PR aims to correct the naming and location of code coverage files to enable the successful upload to codecov.
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> #### Description Uploads to codecov have been broken since open-telemetry#37875 was merged. Efforts have been made to address the reasoning behind why it's not working (eg open-telemetry#38236), but it's still failing. [Example recent failure:](https://github.com/open-telemetry/opentelemetry-collector-contrib/actions/runs/14409354807/job/40413708600) ``` Warning: No files were found with the provided path: receiver-0-coverage.txt. No artifacts will be uploaded. ``` This failure is hit [here](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/2e35cae16745dab737e1d0bf636119b4c669c9cd/.github/workflows/build-and-test.yml#L305). This PR aims to correct the naming and location of code coverage files to enable the successful upload to codecov.
#### Description Now that we're uploading files correctly (#38236), this PR extends the current unit test workflow to download the artifacts and calling issuegenerator to create the issues. <!-- Issue number (e.g. #1234) or full URL to issue, if applicable. --> #### Link to tracking issue Related to #36761 Signed-off-by: Arthur Silva Sens <[email protected]>
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> #### Description Uploads to codecov have been broken since open-telemetry#37875 was merged. Efforts have been made to address the reasoning behind why it's not working (eg open-telemetry#38236), but it's still failing. [Example recent failure:](https://github.com/open-telemetry/opentelemetry-collector-contrib/actions/runs/14409354807/job/40413708600) ``` Warning: No files were found with the provided path: receiver-0-coverage.txt. No artifacts will be uploaded. ``` This failure is hit [here](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/2e35cae16745dab737e1d0bf636119b4c669c9cd/.github/workflows/build-and-test.yml#L305). This PR aims to correct the naming and location of code coverage files to enable the successful upload to codecov.
CodeCov report on PR seems unavailable after this change. Is this expected behavior? |
Description
After the revert done in #38230 and #38231, I'm looking yet again on what went wrong there.
I'm solving this in small parts, and this PR focuses on ensuring JUnit Artifacts are uploaded correctly.
Link to tracking issue
Still related to #36761
Testing
I plan to test this by looking at the artifacts produced in this PR. The JUnit files need to be there. See https://github.com/actions/upload-artifact?tab=readme-ov-file#where-does-the-upload-go