Skip to content

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

Merged
merged 6 commits into from
Feb 27, 2025

Conversation

ArthurSens
Copy link
Member

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

@ArthurSens ArthurSens requested a review from a team as a code owner February 26, 2025 19:51
@ArthurSens ArthurSens marked this pull request as draft February 26, 2025 19:51
@ArthurSens
Copy link
Member Author

ArthurSens commented Feb 26, 2025

Ok, I noticed that running tests twice (one without JUnit and another with JUnit) takes a lot of time; I think we want:

  • Tests without JUnit artifacts running on branch != main
  • Tests with JUnit artifacts running on branch == main
image

Signed-off-by: Arthur Silva Sens <[email protected]>
Comment on lines 292 to 302
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
Copy link
Member Author

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

Copy link
Member

Choose a reason for hiding this comment

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

Ah, nice catch!

Copy link
Member

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 :)))

@@ -289,15 +289,15 @@ jobs:
if: startsWith( matrix.go-version, '1.23' ) != true
Copy link
Member Author

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?

Copy link
Member

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

Copy link
Member Author

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

@ArthurSens
Copy link
Member Author

@ArthurSens ArthurSens marked this pull request as ready for review February 26, 2025 22:18
@mx-psi mx-psi added the Skip Changelog PRs that do not require a CHANGELOG.md entry label Feb 27, 2025
@mx-psi mx-psi requested a review from songy23 February 27, 2025 12:53
@ArthurSens
Copy link
Member Author

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

@mx-psi
Copy link
Member

mx-psi commented Feb 27, 2025

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

That makes sense to me 👍 will wait to merge this until Yang has reviewed and you feel ready for it

@ArthurSens
Copy link
Member Author

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

That makes sense to me 👍 will wait to merge this until Yang has reviewed and you feel ready for it

Should be ok from my side

Copy link
Member

@songy23 songy23 left a 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!

@songy23
Copy link
Member

songy23 commented Feb 27, 2025

All good from my end, let me know when you would like to merge 🚀

@songy23 songy23 added the ci-cd CI, CD, testing, build issues label Feb 27, 2025
@mx-psi mx-psi merged commit 6b0a752 into open-telemetry:main Feb 27, 2025
167 checks passed
@github-actions github-actions bot added this to the next release milestone Feb 27, 2025
@ArthurSens ArthurSens deleted the fix-upload-artifacts branch February 27, 2025 15:00
songy23 pushed a commit that referenced this pull request Apr 14, 2025
<!--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.
akshays-19 pushed a commit to akshays-19/opentelemetry-collector-contrib that referenced this pull request Apr 23, 2025
<!--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.
mx-psi pushed a commit that referenced this pull request Apr 23, 2025
#### 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]>
Fiery-Fenix pushed a commit to Fiery-Fenix/opentelemetry-collector-contrib that referenced this pull request Apr 24, 2025
<!--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.
@sincejune
Copy link
Contributor

CodeCov report on PR seems unavailable after this change. Is this expected behavior?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci-cd CI, CD, testing, build issues Skip Changelog PRs that do not require a CHANGELOG.md entry
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants