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

Bump upload artifact v3 to v4 #12702

Conversation

filipefurtad0
Copy link
Contributor

@filipefurtad0 filipefurtad0 commented Jul 23, 2024

What? Why?

We use actions/upload-artifact to create artifacts i.e., files like screenshots, when a spec fails. We've been getting a deprecation error. This PR fixes it.

Also, it removes the screenshot code from the engines node - I this is only needed on system specs, right?

What should we test?

  • green build
  • when a system spec fails, we get a screenshot of the screen, with the failure.

Release notes

Changelog Category (reviewers may add a label for the release notes):

  • User facing changes
  • API changes (V0, V1, DFC or Webhook)
  • Technical changes only
  • Feature toggled

The title of the pull request will be included in the release notes.

Dependencies

Documentation updates

@filipefurtad0 filipefurtad0 added the technical changes only These pull requests do not contain user facing changes and are grouped in release notes label Jul 23, 2024
@filipefurtad0
Copy link
Contributor Author

I think it's working:

The build actually failed on the first run, and:

  • the deprecation warning was gone:

image

  • the screenshot file was uploaded:

image

@filipefurtad0 filipefurtad0 force-pushed the bump_upload_artifact_v3_to_v4 branch 4 times, most recently from 665f6da to 714aec2 Compare July 24, 2024 16:46
@filipefurtad0 filipefurtad0 force-pushed the bump_upload_artifact_v3_to_v4 branch from 0c3692a to babbe0c Compare August 5, 2024 16:10
@filipefurtad0
Copy link
Contributor Author

I'm not being able to make this gem work correctly, we need to make sure all artifacts are created in separate files. Closing for now.

@chahmedejaz chahmedejaz mentioned this pull request Aug 10, 2024
4 tasks
@chahmedejaz
Copy link
Collaborator

chahmedejaz commented Aug 10, 2024

I'm not being able to make this gem work correctly, we need to make sure all artifacts are created in separate files. Closing for now.

I just did a small spike on this one, out of the box, the action doesn't support this feature.
We can use some custom code to make it work, however, the action would upload each file/screenshot in a separate zip file which we would have to download and extract to view the screenshot. This is because the action doesn't support non-zip file upload as well. Individual zip files would be more messy to deal with I guess. 😅

Right now all the failed test screenshots are uploaded in a single zip and we download and extract them all in one go. This seems more feasible as per the action's current behavior. Thanks

@filipefurtad0
Copy link
Contributor Author

Right now all the failed test screenshots are uploaded in a single zip and we download and extract them all in one go.

Hey @chahmedejaz , thanks for looking into this. Yes I agree this is the ideal case. It seems I left this branch in a green state, so unfortunately I cannot demonstrate which the issue I encountered exactly.

I believe it had to do with artifacts created from failing specs, on different Knapsack nodes - i.e., the case in which the zip file needs to be updated in different moments, during the build run. This relates to this breaking change.

@chahmedejaz
Copy link
Collaborator

I believe it had to do with artifacts created from failing specs, on different Knapsack nodes - i.e., the case in which the zip file needs to be updated in different moments, during the build run. This relates to this breaking change.

Sure, I'll try to look into that tonight. However, I think in that case we should we should just change the name for the files being uploaded. I tried to validate this case and it worked fine. However, I don't remember now that whether it was v3 or v4 😅

Currently, it's the same as failed-tests-screenshots. It should be updated to failed-admin-tests-screenshots and failed-consumer-tests-screenshots respectively.

@filipefurtad0
Copy link
Contributor Author

filipefurtad0 commented Aug 12, 2024

It should be updated to failed-admin-tests-screenshots and failed-consumer-tests-screenshots respectively.

Agree, renaming makes sense and would prevent the issue, but (I think!) only partially as we have 14 and 12 Knapsack nodes for admin and consumer specs, respectively (ci_node_total, on build.yml).

So, if different system (admin or consumer) specs fail on a single build run there is a good chance they land on different nodes. This is not the case if the failing tests are within the same file; in this case, failures will always be within the same node, as we don't set KNAPSACK_PRO_RSPEC_SPLIT_BY_TEST_EXAMPLES: true (which would split files across nodes).

I think in that case we should we should just change the name for the files being uploaded

So if we can include the name of the failing spec, then I guess it should be fine 👍

This is my current understanding of it, I hope this is helpful 🙏

@chahmedejaz
Copy link
Collaborator

It should be updated to failed-admin-tests-screenshots and failed-consumer-tests-screenshots respectively.

Agree, renaming makes sense and would prevent the issue, but (I think!) only partially as we have 14 and 12 Knapsack nodes for admin and consumer specs, respectively (ci_node_total, on build.yml).

So, if different system (admin or consumer) specs fail on a single build run there is a good chance they land on different nodes. This is not the case if the failing tests are within the same file; in this case, failures will always be within the same node, as we don't set KNAPSACK_PRO_RSPEC_SPLIT_BY_TEST_EXAMPLES: true (which would split files across nodes).

I think in that case we should we should just change the name for the files being uploaded

So if we can include the name of the failing spec, then I guess it should be fine 👍

This is my current understanding of it, I hope this is helpful 🙏

Hi @filipefurtad0 - I validated this and here are the results from this onwards. It was breaking as both jobs were trying to upload with the same name. With different names, it's fixed now. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
technical changes only These pull requests do not contain user facing changes and are grouped in release notes
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Bump upload-artifact v3 to v4
2 participants