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

Issue on github action #218

Closed
sjcotto opened this issue Aug 18, 2023 · 5 comments
Closed

Issue on github action #218

sjcotto opened this issue Aug 18, 2023 · 5 comments

Comments

@sjcotto
Copy link

sjcotto commented Aug 18, 2023

Receiving the following issue sometimes

Run Codium-ai/pr-agent@main
/usr/bin/docker run --name ef7d8[5](https://github.com/goshops-com/jch-app/actions/runs/5907025571/job/16024227389#step:3:6)[6](https://github.com/goshops-com/jch-app/actions/runs/5907025571/job/16024227389#step:3:7)479573c0e884ecbbdebed54dbeb11c1_7dd27d --label ef7d85 --workdir /github/workspace --rm -e "OPENAI_KEY" -e "GITHUB_TOKEN" -e "HOME" -e "GITHUB_JOB" -e "GITHUB_REF" -e "GITHUB_SHA" -e "GITHUB_REPOSITORY" -e "GITHUB_REPOSITORY_OWNER" -e "GITHUB_REPOSITORY_OWNER_ID" -e "GITHUB_RUN_ID" -e "GITHUB_RUN_NUMBER" -e "GITHUB_RETENTION_DAYS" -e "GITHUB_RUN_ATTEMPT" -e "GITHUB_REPOSITORY_ID" -e "GITHUB_ACTOR_ID" -e "GITHUB_ACTOR" -e "GITHUB_TRIGGERING_ACTOR" -e "GITHUB_WORKFLOW" -e "GITHUB_HEAD_REF" -e "GITHUB_BASE_REF" -e "GITHUB_EVENT_NAME" -e "GITHUB_SERVER_URL" -e "GITHUB_API_URL" -e "GITHUB_GRAPHQL_URL" -e "GITHUB_REF_NAME" -e "GITHUB_REF_PROTECTED" -e "GITHUB_REF_TYPE" -e "GITHUB_WORKFLOW_REF" -e "GITHUB_WORKFLOW_SHA" -e "GITHUB_WORKSPACE" -e "GITHUB_ACTION" -e "GITHUB_EVENT_PATH" -e "GITHUB_ACTION_REPOSITORY" -e "GITHUB_ACTION_REF" -e "GITHUB_PATH" -e "GITHUB_ENV" -e "GITHUB_STEP_SUMMARY" -e "GITHUB_STATE" -e "GITHUB_OUTPUT" -e "RUNNER_OS" -e "RUNNER_ARCH" -e "RUNNER_NAME" -e "RUNNER_ENVIRONMENT" -e "RUNNER_TOOL_CACHE" -e "RUNNER_TEMP" -e "RUNNER_WORKSPACE" -e "ACTIONS_RUNTIME_URL" -e "ACTIONS_RUNTIME_TOKEN" -e "ACTIONS_CACHE_URL" -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/_temp/_runner_file_commands":"/github/file_commands" -v "/home/runner/work/jch-app/jch-app":"/github/workspace" ef7d85:6479573c0e884ecbbdebed54dbeb11c1
WARNING:root:Failed to clip tokens: expected string or buffer
ERROR:root:Failed to parse AI prediction: mapping values are not allowed here
  in "<unicode string>", line 2, column 5[7](https://github.com/goshops-com/jch-app/actions/runs/5907025571/job/16024227389#step:3:8):
     ...  issue of items with qty_shipped: 0 not showing in delivered orders
                                         ^
ERROR:root:Failed to get user id, error: 403 {"message": "Resource not accessible by integration", "documentation_url": "https://docs.github.com/rest/users/users#get-the-authenticated-user"}
Traceback (most recent call last):
  File "/app/pr_agent/git_providers/github_provider.py", line 245, in get_user_id
    self.github_user_id = self.github_client.get_user().login
  File "/usr/local/lib/python3.10/site-packages/github/AuthenticatedUser.py", line 231, in login
    self._completeIfNotSet(self._login)
  File "/usr/local/lib/python3.10/site-packages/github/GithubObject.py", line 3[8](https://github.com/goshops-com/jch-app/actions/runs/5907025571/job/16024227389#step:3:9)6, in _completeIfNotSet
    self._completeIfNeeded()
  File "/usr/local/lib/python3.10/site-packages/github/GithubObject.py", line 3[9](https://github.com/goshops-com/jch-app/actions/runs/5907025571/job/16024227389#step:3:10)0, in _completeIfNeeded
    self.__complete()
  File "/usr/local/lib/python3.[10](https://github.com/goshops-com/jch-app/actions/runs/5907025571/job/16024227389#step:3:11)/site-packages/github/GithubObject.py", line 395, in __complete
    headers, data = self._requester.requestJsonAndCheck("GET", self._url.value)
  File "/usr/local/lib/python3.10/site-packages/github/Requester.py", line 442, in requestJsonAndCheck
    return self.__check(
  File "/usr/local/lib/python3.10/site-packages/github/Requester.py", line 487, in __check
    raise self.__createException(status, responseHeaders, data)
github.GithubException.GithubException: 403 {"message": "Resource not accessible by integration", "documentation_url": "https://docs.github.com/rest/users/users#get-the-authenticated-user"}
PR Analysis:
  Main theme: Fixing the issue of items with qty_shipped: 0 not showing in delivered orders
  Type of PR: Bug fix
  Relevant tests added: No
  Focused PR: Yes, the PR is focused on fixing a specific issue related to item visibility in delivered orders.

PR Feedback:
  General suggestions: The PR seems to address the issue at hand effectively. However, it would be beneficial to add some tests to ensure the correctness of the implemented fix. Also, it would be helpful to provide a description for the PR to give more context about the changes made.
  Code feedback:
    - relevant file: src/components/userOrders/DeliveredOrderCard.js
      suggestion: Consider using a more descriptive variable name than 'aux'. A more descriptive name would make the code more readable and maintainable. [medium]
      relevant line: "+                    aux.push({"
    - relevant file: src/components/userOrders/DeliveredOrderCard.js
      suggestion: It seems that the 'itemAvailableQtyForReturn' is set to 'false' for the else condition. If it's supposed to represent a quantity, it would be more appropriate to set it to 0 instead of false. [important]
      relevant line: "+                            itemAvailableQtyForReturn: false"
    - relevant file: src/components/userOrders/DeliveredOrderItem.js
      suggestion: It's good to see that you've replaced 'qty_shipped' with 'qty'. However, make sure that 'qty' always holds the correct value and doesn't break any other parts of the code. [medium]
      relevant line: "+                        quantity={i.qty}"
  Security concerns: No stop

not sure why something works / something don't

@mrT23
Copy link
Collaborator

mrT23 commented Aug 20, 2023

the yaml looks valid

Are you sure its not an internal error of some kind ?
ERROR:root:Failed to get user id, error: 403 {"message": "Resource not accessible by integration", "documentation_url": "https://docs.github.com/rest/users/users#get-the-authenticated-user"}

can you reproduce this ?

@sjcotto
Copy link
Author

sjcotto commented Aug 20, 2023 via email

@KalleV
Copy link

KalleV commented Aug 20, 2023

@sjcotto Are you assigning permissions to the Github Token for the action running PR Agent?

Here's the permission set I've been using successfully so far:

permissions:
  issues: write
  pull-requests: write
  contents: write

Reference:
https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs

@mrT23
Copy link
Collaborator

mrT23 commented Sep 12, 2023

/similar_issue

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

No branches or pull requests

3 participants