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

(chore): Fix the token expiry and move release version update code to a composite action. #1132

Conversation

AjayJagan
Copy link
Contributor

Description

Token expiry fix:
The installation token generated through the GH app has a validity of 1 hour. ref: https://docs.github.com/en/apps/creating-github-apps/authenticating-with-a-github-app/generating-an-installation-access-token-for-a-github-app So the issue is, when waiting for e2e tests(github checks) which runs for more than 1 hr to finish, the token gets expired and then the gh action is no longer able to do other tasks(such as creating a pr)
In order to fix this, we can use the GITHUB_TOKEN that is generated for each workflow. ref: https://docs.github.com/en/actions/security-guides/automatic-token-authentication#about-the-github_token-secret The GITHUB_TOKEN expires when a job finishes or after a maximum of 24 hours.

Move version update to composite action:
There are 2 sets of steps in the job that does almost the same task. Instead of duplicating the steps, move it to a composite action and reuse the same.

JIRA: https://issues.redhat.com/browse/RHOAIENG-10059

How Has This Been Tested?

Both release actions were able to run successfully in my local:

  1. https://github.com/AjayJagan/opendatahub-operator/actions/runs/9993405670
  2. https://github.com/AjayJagan/opendatahub-operator/actions/runs/9993447302
  • You have read the contributors guide.
  • Commit messages are meaningful - have a clear and concise summary and detailed explanation of what was changed and why.
  • Pull Request contains a description of the solution, a link to the JIRA issue, and to any dependent or related Pull Request.
  • Testing instructions have been added in the PR body (for PRs involving changes that are not immediately obvious).
  • The developer has manually tested the changes and verified that the changes work

… composite action

Token expiry fix:
The installation token generated through the GH app has a validity of 1 hour.
ref: https://docs.github.com/en/apps/creating-github-apps/authenticating-with-a-github-app/generating-an-installation-access-token-for-a-github-app
So the issue is, when waiting for e2e tests(github checks) which runs for more than 1 hr to finish, the token gets expired and then the gh action is no longer
able to do other tasks(such as creating a pr)
In order to fix this, we can use the GITHUB_TOKEN that is generated for each workflow.
ref: https://docs.github.com/en/actions/security-guides/automatic-token-authentication#about-the-github_token-secret
The GITHUB_TOKEN expires when a job finishes or after a maximum of 24 hours.

Move version update to composite action:
There are 2 sets of steps in the job that does almost the same task. Instead of duplicating the steps, move it to a composite action and reuse the same.
@openshift-ci openshift-ci bot requested review from grdryn and LaVLaS July 19, 2024 05:33
@AjayJagan AjayJagan requested review from Sara4994 and VaishnaviHire and removed request for grdryn and LaVLaS July 19, 2024 05:33
@AjayJagan AjayJagan changed the title (chore)Fix the token expiry and move release version update code to a composite action. (chore): Fix the token expiry and move release version update code to a composite action. Jul 19, 2024
Copy link
Member

@VaishnaviHire VaishnaviHire left a comment

Choose a reason for hiding this comment

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

/lgtm

@Sara4994
Copy link
Contributor

/lgtm

Copy link

openshift-ci bot commented Jul 29, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Sara4994, VaishnaviHire

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [Sara4994,VaishnaviHire]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-bot openshift-merge-bot bot merged commit d3cec13 into opendatahub-io:incubation Jul 29, 2024
4 checks passed
zdtsw referenced this pull request in zdtsw-forking/rhods-operator Jul 30, 2024
… composite action (red-hat-data-services#1132)

Token expiry fix:
The installation token generated through the GH app has a validity of 1 hour.
ref: https://docs.github.com/en/apps/creating-github-apps/authenticating-with-a-github-app/generating-an-installation-access-token-for-a-github-app
So the issue is, when waiting for e2e tests(github checks) which runs for more than 1 hr to finish, the token gets expired and then the gh action is no longer
able to do other tasks(such as creating a pr)
In order to fix this, we can use the GITHUB_TOKEN that is generated for each workflow.
ref: https://docs.github.com/en/actions/security-guides/automatic-token-authentication#about-the-github_token-secret
The GITHUB_TOKEN expires when a job finishes or after a maximum of 24 hours.

Move version update to composite action:
There are 2 sets of steps in the job that does almost the same task. Instead of duplicating the steps, move it to a composite action and reuse the same.
zdtsw referenced this pull request in zdtsw-forking/rhods-operator Aug 2, 2024
… composite action (red-hat-data-services#1132)

Token expiry fix:
The installation token generated through the GH app has a validity of 1 hour.
ref: https://docs.github.com/en/apps/creating-github-apps/authenticating-with-a-github-app/generating-an-installation-access-token-for-a-github-app
So the issue is, when waiting for e2e tests(github checks) which runs for more than 1 hr to finish, the token gets expired and then the gh action is no longer
able to do other tasks(such as creating a pr)
In order to fix this, we can use the GITHUB_TOKEN that is generated for each workflow.
ref: https://docs.github.com/en/actions/security-guides/automatic-token-authentication#about-the-github_token-secret
The GITHUB_TOKEN expires when a job finishes or after a maximum of 24 hours.

Move version update to composite action:
There are 2 sets of steps in the job that does almost the same task. Instead of duplicating the steps, move it to a composite action and reuse the same.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants