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

(fix): Change on trigger to pull_request_target in the "check-file-updates.yaml" action #1296

Conversation

AjayJagan
Copy link
Contributor

@AjayJagan AjayJagan commented Oct 11, 2024

(fix): Change on trigger to pull_request_target in the "Check config and readme updates / Ensure generated files are included (pull_request)" action to fix "Resource not accessible by integration" error while running the action

Description

The "Check config and readme updates / Ensure generated files are included (pull_request)" action fails when trying to comment on the pr.
There are 2 cases which might cause this

  1. The GITHUB_TOKEN does not have a pull-requests: write permission.
  2. The workflow does not have Read and Write permission in the repo.

But the above 2 cases are satisfied for opendatahub-operator.

So the last possible case is to add change on: pull_request to on: pull_request _target(as per https://github.com/thollander/actions-comment-pull-request?tab=readme-ov-file#permissions). This does not ensure that it will work but this is going to be a trial.

Also, the same workflow was able to run in my repo: AjayJagan#517

Merge criteria

  • 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

@AjayJagan
Copy link
Contributor Author

AjayJagan commented Oct 11, 2024

Once this is merged, I can try to create a test pr by simulating a change in the apis.
If it works, we can keep this change, else I can revert this back and think of a different fix.

@zdtsw @bartoszmajsak ^

@codecov-commenter
Copy link

codecov-commenter commented Oct 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Please upload report for BASE (incubation@e8e266f). Learn more about missing BASE report.

Additional details and impacted files
@@              Coverage Diff              @@
##             incubation    #1296   +/-   ##
=============================================
  Coverage              ?   18.91%           
=============================================
  Files                 ?       30           
  Lines                 ?     2670           
  Branches              ?        0           
=============================================
  Hits                  ?      505           
  Misses                ?     2103           
  Partials              ?       62           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@AjayJagan AjayJagan force-pushed the fix-generate-files-action branch 2 times, most recently from 2097a7a to 0a7cbef Compare October 11, 2024 09:07
@AjayJagan AjayJagan changed the title (fix): Add pr_number to the "check-file-updates.yaml" action (fix): Add pr_number and change on trigger to pull_request_target to the "check-file-updates.yaml" action Oct 11, 2024
@AjayJagan AjayJagan changed the title (fix): Add pr_number and change on trigger to pull_request_target to the "check-file-updates.yaml" action (fix): Change on trigger to pull_request_target to the "check-file-updates.yaml" action Oct 11, 2024
@AjayJagan AjayJagan changed the title (fix): Change on trigger to pull_request_target to the "check-file-updates.yaml" action (fix): Change on trigger to pull_request_target in the "check-file-updates.yaml" action Oct 11, 2024
@AjayJagan AjayJagan force-pushed the fix-generate-files-action branch 3 times, most recently from 15537ec to 58e68b8 Compare October 11, 2024 09:15
@bartoszmajsak
Copy link
Contributor

Once this is merged, I can try to create a test pr by simulating a change in the apis. If it works, we can keep this change, else I can revert this back and think of a different fix.

@zdtsw @bartoszmajsak ^

You could also try running the action on your fork instead of merging potentially not working solution in upstream repo.

@bartoszmajsak
Copy link
Contributor

Codecov Report

All modified and coverable lines are covered by tests ✅

Please upload report for BASE (incubation@e8e266f). Learn more about missing BASE report.

Additional details and impacted files
☔ View full report in Codecov by Sentry. 📢 Have feedback on the report? Share it here.

I think this report is lying ;)

… config and readme updates / Ensure generated files are included (pull_request)" action to fix "Resource not accessible by integration" error while running the action

Signed-off-by: AJAY JAGANATHAN <[email protected]>
@AjayJagan
Copy link
Contributor Author

tested on a fork : AjayJagan#527
and it works.
@bartoszmajsak ^

@AjayJagan
Copy link
Contributor Author

@zdtsw @VaishnaviHire ^ JFyi :)

Copy link
Member

@zdtsw zdtsw left a comment

Choose a reason for hiding this comment

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

approved based on the test result

Copy link

openshift-ci bot commented Oct 15, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: zdtsw

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:

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 f954f0b into opendatahub-io:incubation Oct 15, 2024
5 checks passed
@ykaliuta
Copy link
Contributor

@AjayJagan could you please keep first line of the commit message short enough and descriptive? First line is a bit special, it's a header of the patch. git log --oneline is a bit broken if the whole commit message formatted in one line.

@AjayJagan
Copy link
Contributor Author

@AjayJagan could you please keep first line of the commit message short enough and descriptive? First line is a bit special, it's a header of the patch. git log --oneline is a bit broken if the whole commit message formatted in one line.

@ykaliuta , for sure :)

zdtsw pushed a commit to zdtsw-forking/rhods-operator that referenced this pull request Oct 16, 2024
… config and readme updates / Ensure generated files are included (pull_request)" action to fix "Resource not accessible by integration" error while running the action (opendatahub-io#1296)

Signed-off-by: AJAY JAGANATHAN <[email protected]>
zdtsw pushed a commit to zdtsw-forking/rhods-operator that referenced this pull request Oct 16, 2024
… config and readme updates / Ensure generated files are included (pull_request)" action to fix "Resource not accessible by integration" error while running the action (opendatahub-io#1296)

Signed-off-by: AJAY JAGANATHAN <[email protected]>
Signed-off-by: Wen Zhou <[email protected]>
zdtsw pushed a commit to zdtsw-forking/rhods-operator that referenced this pull request Oct 16, 2024
… config and readme updates / Ensure generated files are included (pull_request)" action to fix "Resource not accessible by integration" error while running the action (opendatahub-io#1296)

Signed-off-by: AJAY JAGANATHAN <[email protected]>
Signed-off-by: Wen Zhou <[email protected]>
zdtsw pushed a commit to zdtsw-forking/rhods-operator that referenced this pull request Oct 16, 2024
… config and readme updates / Ensure generated files are included (pull_request)" action to fix "Resource not accessible by integration" error while running the action (opendatahub-io#1296)

Signed-off-by: AJAY JAGANATHAN <[email protected]>
Signed-off-by: Wen Zhou <[email protected]>
zdtsw pushed a commit to zdtsw-forking/rhods-operator that referenced this pull request Oct 18, 2024
… config and readme updates / Ensure generated files are included (pull_request)" action to fix "Resource not accessible by integration" error while running the action (opendatahub-io#1296)

Signed-off-by: AJAY JAGANATHAN <[email protected]>
(cherry picked from commit f954f0b)
openshift-merge-bot bot pushed a commit to red-hat-data-services/rhods-operator that referenced this pull request Oct 18, 2024
… config and readme updates / Ensure generated files are included (pull_request)" action to fix "Resource not accessible by integration" error while running the action (opendatahub-io#1296)

Signed-off-by: AJAY JAGANATHAN <[email protected]>
(cherry picked from commit f954f0b)
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.

5 participants