Skip to content

Add and save job names in Past CI artifacts#19235

Merged
ydshieh merged 1 commit intomainfrom
get_and_set_job_links_in_ci
Sep 29, 2022
Merged

Add and save job names in Past CI artifacts#19235
ydshieh merged 1 commit intomainfrom
get_and_set_job_links_in_ci

Conversation

@ydshieh
Copy link
Collaborator

@ydshieh ydshieh commented Sep 28, 2022

What does this PR do?

In order to ease the fix process for Past CI, it would be very helpful to have links to jobs for the failed tests.

The GitHub API could give a list of jobs and a list of artifacts, but there is no ensured and easy way to get the correspondence between each artifact/job, see jobs here and artifacts here.

Moreover, when the jobs are running, there is no context evn. variable that gives the job run link (or anything helpful to get this information)

However, the list of jobs given by the API contains the job names and the job run page link (given by html_url).

This PR therefore saves the job names in the corresponding test artifacts. Once the past CI is done:

  • we extract the error information together the job names
  • we fetch the list of jobs
  • For each artifact, we find the corresponding job in the job list using the job name saved in the artifact
  • We get the job run link by looking html_url
  • We add the job run link in the error info.**

To check the effect of this PR, see the contents in the artifacts in this run

version:
required: true
type: string
# Use this to control the commit to test against
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

So we can have a control to test against a targe commit. For example, (Patch release: v4.21.2)

@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Sep 28, 2022

The documentation is not available anymore as the PR was closed or merged.

rm -rf reports

- id: set-matrix
working-directory: /transformers
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The above changes are some cleaning similar in #19234 to avoid confusion.

job_name="Model tests ($matrix_folders, ${{ matrix.machine_type }})"
echo "$job_name"
echo "$job_name" > /transformers/reports/${{ matrix.machine_type }}_tests_gpu_${{ matrix.folders }}/job_name.txt

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is the main goal of this PR - save job names in the artifacts.

@ydshieh ydshieh requested a review from LysandreJik September 28, 2022 18:02
@ydshieh ydshieh changed the title Add and save job names into Past CI artifacts Add and save job names in Past CI artifacts Sep 28, 2022
Copy link
Member

@LysandreJik LysandreJik left a comment

Choose a reason for hiding this comment

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

Good call, sounds good to me!

@ydshieh ydshieh merged commit 163cd15 into main Sep 29, 2022
@ydshieh ydshieh deleted the get_and_set_job_links_in_ci branch September 29, 2022 17:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants