question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error while hiding comments in PullReq on GitHub Enterprise

See original GitHub issue

Using GitHub Enterprise Server 3.0.0.

Workflow file (relevant parts):

name: Java CI with Maven

on:
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]

jobs:
  build:
    runs-on: [ ... ]
    steps:
    - uses: actions/checkout@v2

    - name: Set up JDK 11
      uses: actions/setup-java@v1
      with:
        java-version: 11

    - name: Build with Maven
      run: ./mvnw -B verify --file pom.xml

    - name: Publish Unit Test Results
      uses: EnricoMi/publish-unit-test-result-action@v1.9
      if: always()
      with:
        files: target/surefire-reports/**/*.xml
      env:
        GITHUB_API_URL: https://<our.fqdn.here>/api/v3/

Error received:

Run EnricoMi/publish-unit-test-result-action@v1.9
  with:
    files: target/surefire-reports/**/*.xml
    github_token: ***
    check_name: Unit Test Results
    hide_comments: all but latest
    comment_on_pr: true
    pull_request_build: merge
    check_run_annotations: all tests, skipped tests
    log_level: INFO
  env:
    JAVA_HOME_11.0.10_x64: /home/runner/_work/_tool/jdk/11.0.10/x64
    JAVA_HOME: /home/runner/_work/_tool/jdk/11.0.10/x64
    JAVA_HOME_11_0_10_X64: /home/runner/_work/_tool/jdk/11.0.10/x64
    GITHUB_API_URL: https://<our.fqdn.here>/api/v3/
/usr/bin/docker run --name b1cbc511eb0319cad24c82bd9c7f0910960709_aaa4bd --label b1cbc5 --workdir /github/workspace --rm -e JAVA_HOME_11.0.10_x64 -e JAVA_HOME -e JAVA_HOME_11_0_10_X64 -e GITHUB_API_URL -e INPUT_FILES -e INPUT_GITHUB_TOKEN -e INPUT_COMMIT -e INPUT_CHECK_NAME -e INPUT_COMMENT_TITLE -e INPUT_REPORT_INDIVIDUAL_RUNS -e INPUT_DEDUPLICATE_CLASSES_BY_FILE_NAME -e INPUT_HIDE_COMMENTS -e INPUT_COMMENT_ON_PR -e INPUT_PULL_REQUEST_BUILD -e INPUT_TEST_CHANGES_LIMIT -e INPUT_CHECK_RUN_ANNOTATIONS -e INPUT_CHECK_RUN_ANNOTATIONS_BRANCH -e INPUT_LOG_LEVEL -e HOME -e GITHUB_JOB -e GITHUB_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_REPOSITORY_OWNER -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_RETENTION_DAYS -e GITHUB_ACTOR -e GITHUB_WORKFLOW -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GITHUB_EVENT_NAME -e GITHUB_SERVER_URL -e GITHUB_GRAPHQL_URL -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 RUNNER_OS -e RUNNER_TOOL_CACHE -e RUNNER_TEMP -e RUNNER_WORKSPACE -e ACTIONS_RUNTIME_URL -e ACTIONS_RUNTIME_TOKEN -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/<workspace.folder.redacted>/<workspace.folder.redacted>":"/github/workspace" b1cbc5:11eb0319cad24c82bd9c7f0910960709
2021-03-09 12:16:57 +0000 - publish-unit-test-results -  INFO - reading target/surefire-reports/**/*.xml
2021-03-09 12:16:57 +0000 - publish.publisher -  INFO - publishing success results for commit 421157be393553a7c6b3bde525dce2bb41305ba1
2021-03-09 12:16:57 +0000 - publish.publisher -  INFO - creating check
2021-03-09 12:16:58 +0000 - publish.publisher -  INFO - creating comment
Traceback (most recent call last):
  File "/action/publish_unit_test_results.py", line 181, in <module>
    main(settings)
  File "/action/publish_unit_test_results.py", line 67, in main
    Publisher(settings, gh, gha).publish(stats, results.case_results, conclusion)
  File "/action/publish/publisher.py", line 56, in publish
    self.hide_all_but_latest_comments(pull)
  File "/action/publish/publisher.py", line 354, in hide_all_but_latest_comments
    comments = self.get_pull_request_comments(pull)
  File "/action/publish/publisher.py", line 284, in get_pull_request_comments
    "POST", f'{self._settings.api_url}/graphql', input=query
  File "/usr/local/lib/python3.6/site-packages/github/Requester.py", line 317, in requestJsonAndCheck
    verb, url, parameters, headers, input, self.__customConnection(url)
  File "/usr/local/lib/python3.6/site-packages/github/Requester.py", line 340, in __check
    raise self.__createException(status, responseHeaders, output)
github.GithubException.UnknownObjectException: 404 {"message": "Not Found", "documentation_url": "https://docs.github.com/enterprise/3.0/rest"}

Note that test results themself are visible within GitHub Actions output - this part works correctly

Is GH Enterprise supported? Looking at code I’m not sure if GITHUB_API_URL is supported from environment variables (not a Python expert). Same error occurs without GITHUB_API_URL set in step. Or maybe this is issue with action itself?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:15 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
EnricoMicommented, Mar 15, 2021

Or can this be somehow handled gracefully in code itself

Yes, I will make it log a warning but not fail like it currently does.

1reaction
EnricoMicommented, Mar 15, 2021

The action seems to request {GITHUB_API_URL}/graphql, which resolves in your setup to https://<our.fqdn.here>/api/v3/graphql, which I think is wrong.

Can you remove the GITHUB_API_URL: https://<our.fqdn.here>/api/v3/ line from your action config and try again?

Can you please also check what the default value of GITHUB_API_URL and GITHUB_GRAPHQL_URL is in your setup? I suspect it is {GITHUB_API_URL}/graphql. Simply add this step to wour workflow to see all environment variabls provided by the action runner:

- name: Debug Action
  uses: hmarr/debug-action@v1.0.0

To be honest, the action should use GITHUB_GRAPHQL_URL, which I am going to fix.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Managing disruptive comments - GitHub Docs
Hiding a comment. Organization moderators, and anyone with write access to a repository, can hide comments on issues, pull requests, and commits.
Read more >
[Bug] New --hide-prev-plan-comments flag fails on GitHub ...
When enabling the new --hide-prev-plan-comments flag, Atlantis is unable to hide comments on GitHub Enterprise with the following error: ...
Read more >
Error signing in to GitHub Enterprise (cloud-hosted) #3429
Cloned repository from our company github enterprise account (cloud-hosted) and opened in vscode. Clicked "Sign in with GitHub Enterprise to ...
Read more >
Error when adding PR comments with GitHub Enterprise #2486
89.33912, when attempting to add a comment to a Pull Request, an error occurs and the comment is not added to the line...
Read more >
About comparing branches in pull requests - GitHub Docs
Pull requests display diffs to compare the changes you made in your topic branch against the base branch that you want to merge...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found