Giter Club home page Giter Club logo

Comments (15)

EnricoMi avatar EnricoMi commented on May 18, 2024 2

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.

from publish-unit-test-result-action.

EnricoMi avatar EnricoMi commented on May 18, 2024 1

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/[email protected]

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

from publish-unit-test-result-action.

EnricoMi avatar EnricoMi commented on May 18, 2024

The GITHUB_API_URL env var should work as expected. Others have used the action in Enterprise environments, see #56. I think you do not need to add it via the env section in your config as the action runner provide this env var for you.

Anyway, it looks like the action can create a check run and the PR comment. This means, it is talking to the right URL. After creating the comment it checks for existing comments to hide older ones. For this it connects to the GraphQL API of your GitHub Enterprise server. Looks like that does not exist. You can disable hiding comments by adding hide_comments: off to your config.

Can you also try to add log_level: DEBUG to your settings to get some more output. Please obfuscate the output where needed.

from publish-unit-test-result-action.

pazkooda avatar pazkooda commented on May 18, 2024

More feedback

When config property comment_on_pr: false is provided build does NOT fail.
As of now I cannot provide details regarding GraphQL API - no having permissions in my company GHE.

Debug logs:

/usr/bin/docker run --name b1cbc5d7d54bce36914832bd99e412289d72e3_e4df2b --label b1cbc5 --workdir /github/workspace --rm -e JAVA_HOME_11.0.10_x64 -e JAVA_HOME -e JAVA_HOME_11_0_10_X64 -e INPUT_FILES -e INPUT_LOG_LEVEL -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 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_API_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/<repo-name-here>/<repo-name-here>":"/github/workspace" b1cbc5:d7d54bce36914832bd99e412289d72e3
2021-03-15 08:47:11 +0000 - publish-unit-test-results - DEBUG - action triggered by 'pull_request' event
2021-03-15 08:47:11 +0000 - publish-unit-test-results -  INFO - reading target/surefire-reports/**/*.xml
2021-03-15 08:47:11 +0000 - publish-unit-test-results - DEBUG - reading ['target/surefire-reports/TEST-<redacted>.xml']
2021-03-15 08:47:11 +0000 - publish.publisher -  INFO - publishing success results for commit 2d820bc13c209a89bef356fb396a5e33e1d637b4
2021-03-15 08:47:11 +0000 - publish.publisher - DEBUG - comparing against before=c69534e0b5a1c1ce448a35511e318f1eb6cd4e49
2021-03-15 08:47:11 +0000 - publish.publisher - DEBUG - found 3 check runs for commit c69534e0b5a1c1ce448a35511e318f1eb6cd4e49
2021-03-15 08:47:11 +0000 - publish.publisher - DEBUG - found 1 check runs for commit c69534e0b5a1c1ce448a35511e318f1eb6cd4e49 with title Unit Test Results
2021-03-15 08:47:11 +0000 - publish.publisher - DEBUG - summary: 1 files  Β±0  1 suites  Β±0   9s :stopwatch: -16s
2021-03-15 08:47:11 +0000 - publish.publisher - DEBUG - summary: 3 tests Β±0  3 :heavy_check_mark: Β±0  0 :zzz: Β±0  0 :x: Β±0 
2021-03-15 08:47:11 +0000 - publish.publisher - DEBUG - summary:
2021-03-15 08:47:11 +0000 - publish.publisher - DEBUG - summary: Results for commit c69534e0. ± Comparison against earlier commit 421157be.
2021-03-15 08:47:11 +0000 - publish.publisher - DEBUG - summary:
2021-03-15 08:47:11 +0000 - publish.publisher - DEBUG - summary: [test-results]:data:application/gzip;base64,H4sIANL1SWAC/1WMyw6DIBBFf8Ww7sIJYKQ/0+A4JJOqNDxWjf9etNXi7p5zk/MWjieK4t7ArRExczphzMEm9ktBU7AcabvksR8xI17Fk19FtKdwlqeLoBB8+JmQl6O3zTr35X9t5yq2c91CP8+cCgjsjJaK2kFbQEBSqrdSawCS0DugocNRkTJi/QDc4hQw+wAAAA==
2021-03-15 08:47:11 +0000 - publish.publisher - DEBUG - digest: H4sIANL1SWAC/1WMyw6DIBBFf8Ww7sIJYKQ/0+A4JJOqNDxWjf9etNXi7p5zk/MWjieK4t7ArRExczphzMEm9ktBU7AcabvksR8xI17Fk19FtKdwlqeLoBB8+JmQl6O3zTr35X9t5yq2c91CP8+cCgjsjJaK2kFbQEBSqrdSawCS0DugocNRkTJi/QDc4hQw+wAAAA==
2021-03-15 08:47:11 +0000 - publish.publisher - DEBUG - stats: UnitTestRunResults(files=1, errors=[], suites=1, duration=9, tests=3, tests_succ=3, tests_skip=0, tests_fail=0, tests_error=0, runs=3, runs_succ=3, runs_skip=0, runs_fail=0, runs_error=0, commit='c69534e0b5a1c1ce448a35511e318f1eb6cd4e49')
2021-03-15 08:47:11 +0000 - publish.publisher - DEBUG - stats with delta: UnitTestRunDeltaResults(files={'number': 1, 'delta': 0}, errors=[], suites={'number': 1, 'delta': 0}, duration={'duration': 10, 'delta': 1}, tests={'number': 3, 'delta': 0}, tests_succ={'number': 3, 'delta': 0}, tests_skip={'number': 0, 'delta': 0}, tests_fail={'number': 0, 'delta': 0}, tests_error={'number': 0, 'delta': 0}, runs={'number': 3, 'delta': 0}, runs_succ={'number': 3, 'delta': 0}, runs_skip={'number': 0, 'delta': 0}, runs_fail={'number': 0, 'delta': 0}, runs_error={'number': 0, 'delta': 0}, commit='2d820bc13c209a89bef356fb396a5e33e1d637b4', reference_type='earlier', reference_commit='c69534e0b5a1c1ce448a35511e318f1eb6cd4e49')
2021-03-15 08:47:11 +0000 - publish.publisher -  INFO - creating check
2021-03-15 08:47:11 +0000 - publish.publisher - DEBUG - created check CheckRun(id=490, conclusion="success")
2021-03-15 08:47:12 +0000 - publish.publisher - DEBUG - found 1 pull requests in repo dds/<repo-name-here> for commit 2d820bc13c209a89bef356fb396a5e33e1d637b4
2021-03-15 08:47:12 +0000 - publish.publisher - DEBUG - PullRequest(title="SRE-1376 Basic GitHub Action workflow", number=14)
2021-03-15 08:47:12 +0000 - publish.publisher - DEBUG - {'url': 'https://<our.fqdn.here>/api/v3/repos/dds/<repo-name-here>/pulls/14', 'id': 12215, 'node_id': 'MDExOlB1bGxSZXF1ZXN0MTIyMTU=', 'html_url': 'https://<our.fqdn.here>/dds/<repo-name-here>/pull/14', 'diff_url': 'https://<our.fqdn.here>/dds/<repo-name-here>/pull/14.diff', 'patch_url': 'https://<our.fqdn.here>/dds/<repo-name-here>/pull/14.patch', 'issue_url': 'https://<our.fqdn.here>/api/v3/repos/dds/<repo-name-here>/issues/14', 'number': 14, 'state': 'open', 'locked': False, 'title': 'SRE-1376 Basic GitHub Action workflow', 'user': {'login': 'lukasz-usowicz', 'id': 1475, 'node_id': 'MDQ6VXNlcjE0NzU=', 'avatar_url': 'https://avatars.git.evry.cloud/u/1475?', 'gravatar_id': '', 'url': 'https://<our.fqdn.here>/api/v3/users/lukasz-usowicz', 'html_url': 'https://<our.fqdn.here>/lukasz-usowicz', 'followers_url': 'https://<our.fqdn.here>/api/v3/users/lukasz-usowicz/followers', 'following_url': 'https://<our.fqdn.here>/api/v3/users/lukasz-usowicz/following{/other_user}', 'gists_url': 'https://<our.fqdn.here>/api/v3/users/lukasz-usowicz/gists{/gist_id}', 'starred_url': 'https://<our.fqdn.here>/api/v3/users/lukasz-usowicz/starred{/owner}{/repo}', 'subscriptions_url': 'https://<our.fqdn.here>/api/v3/users/lukasz-usowicz/subscriptions', 'organizations_url': 'https://<our.fqdn.here>/api/v3/users/lukasz-usowicz/orgs', 'repos_url': 'https://<our.fqdn.here>/api/v3/users/lukasz-usowicz/repos', 'events_url': 'https://<our.fqdn.here>/api/v3/users/lukasz-usowicz/events{/privacy}', 'received_events_url': 'https://<our.fqdn.here>/api/v3/users/lukasz-usowicz/received_events', 'type': 'User', 'site_admin': False}, 'body': '', 'created_at': '2021-02-26T11:00:42Z', 'updated_at': '2021-03-15T08:45:16Z', 'closed_at': None, 'merged_at': None, 'merge_commit_sha': 'd8a8fc390c826160388c950493fed17637ae2368', 'assignee': None, 'assignees': [], 'requested_reviewers': [{'login': 'kjetil-floisand', 'id': 1210, 'node_id': 'MDQ6VXNlcjEyMTA=', 'avatar_url': 'https://avatars.git.evry.cloud/u/1210?', 'gravatar_id': '', 'url': 'https://<our.fqdn.here>/api/v3/users/kjetil-floisand', 'html_url': 'https://<our.fqdn.here>/kjetil-floisand', 'followers_url': 'https://<our.fqdn.here>/api/v3/users/kjetil-floisand/followers', 'following_url': 'https://<our.fqdn.here>/api/v3/users/kjetil-floisand/following{/other_user}', 'gists_url': 'https://<our.fqdn.here>/api/v3/users/kjetil-floisand/gists{/gist_id}', 'starred_url': 'https://<our.fqdn.here>/api/v3/users/kjetil-floisand/starred{/owner}{/repo}', 'subscriptions_url': 'https://<our.fqdn.here>/api/v3/users/kjetil-floisand/subscriptions', 'organizations_url': 'https://<our.fqdn.here>/api/v3/users/kjetil-floisand/orgs', 'repos_url': 'https://<our.fqdn.here>/api/v3/users/kjetil-floisand/repos', 'events_url': 'https://<our.fqdn.here>/api/v3/users/kjetil-floisand/events{/privacy}', 'received_events_url': 'https://<our.fqdn.here>/api/v3/users/kjetil-floisand/received_events', 'type': 'User', 'site_admin': False}], 'requested_teams': [{'name': '<team.name.here>', 'id': 112, 'node_id': 'MDQ6VGVhbTExMg==', 'slug': '<team.code.here>', 'description': '<desc.here>', 'privacy': 'closed', 'url': 'https://<our.fqdn.here>/api/v3/organizations/###/team/###', 'html_url': 'https://<our.fqdn.here>/orgs/dds/teams/<team.name.here>', 'members_url': 'https://<our.fqdn.here>/api/v3/organizations/###/team/###/members{/member}', 'repositories_url': 'https://<our.fqdn.here>/api/v3/organizations/###/team/###/repos', 'permission': 'pull', 'parent': {'name': 'Developers', 'id': ##, 'node_id': 'MDQ6VGVhbTYw', 'slug': 'developers', 'description': '', 'privacy': 'closed', 'url': 'https://<our.fqdn.here>/api/v3/organizations/###/team/##', 'html_url': 'https://<our.fqdn.here>/orgs/dds/teams/developers', 'members_url': 'https://<our.fqdn.here>/api/v3/organizations/###/team/##/members{/member}', 'repositories_url': 'https://<our.fqdn.here>/api/v3/organizations/###/team/##/repos', 'permission': 'pull'}}], 'labels': [], 'milestone': None, 'draft': False, 'commits_url': 'https://<our.fqdn.here>/api/v3/repos/dds/<repo-name-here>/pulls/14/commits', 'review_comments_url': 'https://<our.fqdn.here>/api/v3/repos/dds/<repo-name-here>/pulls/14/comments', 'review_comment_url': 'https://<our.fqdn.here>/api/v3/repos/dds/<repo-name-here>/pulls/comments{/number}', 'comments_url': 'https://<our.fqdn.here>/api/v3/repos/dds/<repo-name-here>/issues/14/comments', 'statuses_url': 'https://<our.fqdn.here>/api/v3/repos/dds/<repo-name-here>/statuses/2d820bc13c209a89bef356fb396a5e33e1d637b4', 'head': {'label': 'dds:feature/SRE-1376-basic-gh-action-workflow', 'ref': 'feature/SRE-1376-basic-gh-action-workflow', 'sha': '2d820bc13c209a89bef356fb396a5e33e1d637b4', 'user': {'login': 'dds', 'id': ###, 'node_id': 'MDEyOk9yZ2FuaXphdGlvbjEzMw==', 'avatar_url': 'https://avatars.git.evry.cloud/u/###?', 'gravatar_id': '', 'url': 'https://<our.fqdn.here>/api/v3/users/dds', 'html_url': 'https://<our.fqdn.here>/dds', 'followers_url': 'https://<our.fqdn.here>/api/v3/users/dds/followers', 'following_url': 'https://<our.fqdn.here>/api/v3/users/dds/following{/other_user}', 'gists_url': 'https://<our.fqdn.here>/api/v3/users/dds/gists{/gist_id}', 'starred_url': 'https://<our.fqdn.here>/api/v3/users/dds/starred{/owner}{/repo}', 'subscriptions_url': 'https://<our.fqdn.here>/api/v3/users/dds/subscriptions', 'organizations_url': 'https://<our.fqdn.here>/api/v3/users/dds/orgs', 'repos_url': 'https://<our.fqdn.here>/api/v3/users/dds/repos', 'events_url': 'https://<our.fqdn.here>/api/v3/users/dds/events{/privacy}', 'received_events_url': 'https://<our.fqdn.here>/api/v3/users/dds/received_events', 'type': 'Organization', 'site_admin': False}, 'repo': {'id': 2762, 'node_id': 'MDEwOlJlcG9zaXRvcnkyNzYy', 'name': '<repo-name-here>', 'full_name': 'dds/<repo-name-here>', 'private': True, 'owner': {'login': 'dds', 'id': ###, 'node_id': 'MDEyOk9yZ2FuaXphdGlvbjEzMw==', 'avatar_url': 'https://avatars.git.evry.cloud/u/###?', 'gravatar_id': '', 'url': 'https://<our.fqdn.here>/api/v3/users/dds', 'html_url': 'https://<our.fqdn.here>/dds', 'followers_url': 'https://<our.fqdn.here>/api/v3/users/dds/followers', 'following_url': 'https://<our.fqdn.here>/api/v3/users/dds/following{/other_user}', 'gists_url': 'https://<our.fqdn.here>/api/v3/users/dds/gists{/gist_id}', 'starred_url': 'https://<our.fqdn.here>/api/v3/users/dds/starred{/owner}{/repo}', 'subscriptions_url': 'https://<our.fqdn.here>/api/v3/users/dds/subscriptions', 'organizations_url': 'https://<our.fqdn.here>/api/v3/users/dds/orgs', 'repos_url': 'https://<our.fqdn.here>/api/v3/users/dds/repos', 'events_url': 'https://<our.fqdn.here>/api/v3/users/dds/events{/privacy}', 'received_events_url': 'https://<our.fqdn.here>/api/v3/users/dds/received_events', 'type': 'Organization', 'site_admin': False}, 'html_url': 'https://<our.fqdn.here>/dds/<repo-name-here>', 'description': None, 'fork': False, 'url': 'https://<our.fqdn.here>/api/v3/repos/dds/<repo-name-here>', 'forks_url': 'https://<our.fqdn.here>/api/v3/repos/dds/<repo-name-here>/forks', 'keys_url': 'https://<our.fqdn.here>/api/v3/repos/dds/<repo-name-here>/keys{/key_id}', 'collaborators_url': 'https://<our.fqdn.here>/api/v3/repos/dds/<repo-name-here>/collaborators{/collaborator}', 'teams_url': 'https://<our.fqdn.here>/api/v3/repos/dds/<repo-name-here>/teams', 'hooks_url': 'https://<our.fqdn.here>/api/v3/repos/dds/<repo-name-here>/hooks', 'issue_events_url': 'https://<our.fqdn.here>/api/v3/repos/dds/<repo-name-here>/issues/events{/number}', 'events_url': 'https://<our.fqdn.here>/api/v3/repos/dds/<repo-name-here>/events', 'assignees_url': 'https://<our.fqdn.here>/api/v3/repos/dds/<repo-name-here>/assignees{/user}', 'branches_url': 'https://<our.fqdn.here>/api/v3/repos/dds/<repo-name-here>/branches{/branch}', 'tags_url': 'https://<our.fqdn.here>/api/v3/repos/dds/<repo-name-here>/tags', 'blobs_url': 'https://<our.fqdn.here>/api/v3/repos/dds/<repo-name-here>/git/blobs{/sha}', 'git_tags_url': 'https://<our.fqdn.here>/api/v3/repos/dds/<repo-name-here>/git/tags{/sha}', 'git_refs_url': 'https://<our.fqdn.here>/api/v3/repos/dds/<repo-name-here>/git/refs{/sha}', 'trees_url': 'https://<our.fqdn.here>/api/v3/repos/dds/<repo-name-here>/git/trees{/sha}', 'statuses_url': 'https://<our.fqdn.here>/api/v3/repos/dds/<repo-name-here>/statuses/{sha}', 'languages_url': 'https://<our.fqdn.here>/api/v3/repos/dds/<repo-name-here>/languages', 'stargazers_url': 'https://<our.fqdn.here>/api/v3/repos/dds/<repo-name-here>/stargazers', 'contributors_url': 'https://<our.fqdn.here>/api/v3/repos/dds/<repo-name-here>/contributors', 'subscribers_url': 'https://<our.fqdn.here>/api/v3/repos/dds/<repo-name-here>/subscribers', 'subscription_url': 'https://<our.fqdn.here>/api/v3/repos/dds/<repo-name-here>/subscription', 'commits_url': 'https://<our.fqdn.here>/api/v3/repos/dds/<repo-name-here>/commits{/sha}', 'git_commits_url': 'https://<our.fqdn.here>/api/v3/repos/dds/<repo-name-here>/git/commits{/sha}', 'comments_url': 'https://<our.fqdn.here>/api/v3/repos/dds/<repo-name-here>/comments{/number}', 'issue_comment_url': 'https://<our.fqdn.here>/api/v3/repos/dds/<repo-name-here>/issues/comments{/number}', 'contents_url': 'https://<our.fqdn.here>/api/v3/repos/dds/<repo-name-here>/contents/{+path}', 'compare_url': 'https://<our.fqdn.here>/api/v3/repos/dds/<repo-name-here>/compare/{base}...{head}', 'merges_url': 'https://<our.fqdn.here>/api/v3/repos/dds/<repo-name-here>/merges', 'archive_url': 'https://<our.fqdn.here>/api/v3/repos/dds/<repo-name-here>/{archive_format}{/ref}', 'downloads_url': 'https://<our.fqdn.here>/api/v3/repos/dds/<repo-name-here>/downloads', 'issues_url': 'https://<our.fqdn.here>/api/v3/repos/dds/<repo-name-here>/issues{/number}', 'pulls_url': 'https://<our.fqdn.here>/api/v3/repos/dds/<repo-name-here>/pulls{/number}', 'milestones_url': 'https://<our.fqdn.here>/api/v3/repos/dds/<repo-name-here>/milestones{/number}', 'notifications_url': 'https://<our.fqdn.here>/api/v3/repos/dds/<repo-name-here>/notifications{?since,all,participating}', 'labels_url': 'https://<our.fqdn.here>/api/v3/repos/dds/<repo-name-here>/labels{/name}', 'releases_url': 'https://<our.fqdn.here>/api/v3/repos/dds/<repo-name-here>/releases{/id}', 'deployments_url': 'https://<our.fqdn.here>/api/v3/repos/dds/<repo-name-here>/deployments', 'created_at': '2020-07-21T06:05:06Z', 'updated_at': '2021-02-25T12:11:24Z', 'pushed_at': '2021-03-15T08:45:16Z', 'git_url': 'git://<our.fqdn.here>/dds/<repo-name-here>.git', 'ssh_url': '[email protected]:dds/<repo-name-here>.git', 'clone_url': 'https://<our.fqdn.here>/dds/<repo-name-here>.git', 'svn_url': 'https://<our.fqdn.here>/dds/<repo-name-here>', 'homepage': None, 'size': 87, 'stargazers_count': 0, 'watchers_count': 0, 'language': 'Groovy', 'has_issues': True, 'has_projects': True, 'has_downloads': True, 'has_wiki': True, 'has_pages': False, 'forks_count': 0, 'mirror_url': None, 'archived': False, 'disabled': False, 'open_issues_count': 1, 'license': None, 'forks': 0, 'open_issues': 1, 'watchers': 0, 'default_branch': 'master', 'anonymous_access_enabled': False}}, 'base': {'label': 'dds:master', 'ref': 'master', 'sha': 'a1909c66a00fcdf6c6ed1ac3bd42af19c03d2f3f', 'user': {'login': 'dds', 'id': ###, 'node_id': 'MDEyOk9yZ2FuaXphdGlvbjEzMw==', 'avatar_url': 'https://avatars.git.evry.cloud/u/###?', 'gravatar_id': '', 'url': 'https://<our.fqdn.here>/api/v3/users/dds', 'html_url': 'https://<our.fqdn.here>/dds', 'followers_url': 'https://<our.fqdn.here>/api/v3/users/dds/followers', 'following_url': 'https://<our.fqdn.here>/api/v3/users/dds/following{/other_user}', 'gists_url': 'https://<our.fqdn.here>/api/v3/users/dds/gists{/gist_id}', 'starred_url': 'https://<our.fqdn.here>/api/v3/users/dds/starred{/owner}{/repo}', 'subscriptions_url': 'https://<our.fqdn.here>/api/v3/users/dds/subscriptions', 'organizations_url': 'https://<our.fqdn.here>/api/v3/users/dds/orgs', 'repos_url': 'https://<our.fqdn.here>/api/v3/users/dds/repos', 'events_url': 'https://<our.fqdn.here>/api/v3/users/dds/events{/privacy}', 'received_events_url': 'https://<our.fqdn.here>/api/v3/users/dds/received_events', 'type': 'Organization', 'site_admin': False}, 'repo': {'id': 2762, 'node_id': 'MDEwOlJlcG9zaXRvcnkyNzYy', 'name': '<repo-name-here>', 'full_name': 'dds/<repo-name-here>', 'private': True, 'owner': {'login': 'dds', 'id': ###, 'node_id': 'MDEyOk9yZ2FuaXphdGlvbjEzMw==', 'avatar_url': 'https://avatars.git.evry.cloud/u/###?', 'gravatar_id': '', 'url': 'https://<our.fqdn.here>/api/v3/users/dds', 'html_url': 'https://<our.fqdn.here>/dds', 'followers_url': 'https://<our.fqdn.here>/api/v3/users/dds/followers', 'following_url': 'https://<our.fqdn.here>/api/v3/users/dds/following{/other_user}', 'gists_url': 'https://<our.fqdn.here>/api/v3/users/dds/gists{/gist_id}', 'starred_url': 'https://<our.fqdn.here>/api/v3/users/dds/starred{/owner}{/repo}', 'subscriptions_url': 'https://<our.fqdn.here>/api/v3/users/dds/subscriptions', 'organizations_url': 'https://<our.fqdn.here>/api/v3/users/dds/orgs', 'repos_url': 'https://<our.fqdn.here>/api/v3/users/dds/repos', 'events_url': 'https://<our.fqdn.here>/api/v3/users/dds/events{/privacy}', 'received_events_url': 'https://<our.fqdn.here>/api/v3/users/dds/received_events', 'type': 'Organization', 'site_admin': False}, 'html_url': 'https://<our.fqdn.here>/dds/<repo-name-here>', 'description': None, 'fork': False, 'url': 'https://<our.fqdn.here>/api/v3/repos/dds/<repo-name-here>', 'forks_url': 'https://<our.fqdn.here>/api/v3/repos/dds/<repo-name-here>/forks', 'keys_url': 'https://<our.fqdn.here>/api/v3/repos/dds/<repo-name-here>/keys{/key_id}', 'collaborators_url': 'https://<our.fqdn.here>/api/v3/repos/dds/<repo-name-here>/collaborators{/collaborator}', 'teams_url': 'https://<our.fqdn.here>/api/v3/repos/dds/<repo-name-here>/teams', 'hooks_url': 'https://<our.fqdn.here>/api/v3/repos/dds/<repo-name-here>/hooks', 'issue_events_url': 'https://<our.fqdn.here>/api/v3/repos/dds/<repo-name-here>/issues/events{/number}', 'events_url': 'https://<our.fqdn.here>/api/v3/repos/dds/<repo-name-here>/events', 'assignees_url': 'https://<our.fqdn.here>/api/v3/repos/dds/<repo-name-here>/assignees{/user}', 'branches_url': 'https://<our.fqdn.here>/api/v3/repos/dds/<repo-name-here>/branches{/branch}', 'tags_url': 'https://<our.fqdn.here>/api/v3/repos/dds/<repo-name-here>/tags', 'blobs_url': 'https://<our.fqdn.here>/api/v3/repos/dds/<repo-name-here>/git/blobs{/sha}', 'git_tags_url': 'https://<our.fqdn.here>/api/v3/repos/dds/<repo-name-here>/git/tags{/sha}', 'git_refs_url': 'https://<our.fqdn.here>/api/v3/repos/dds/<repo-name-here>/git/refs{/sha}', 'trees_url': 'https://<our.fqdn.here>/api/v3/repos/dds/<repo-name-here>/git/trees{/sha}', 'statuses_url': 'https://<our.fqdn.here>/api/v3/repos/dds/<repo-name-here>/statuses/{sha}', 'languages_url': 'https://<our.fqdn.here>/api/v3/repos/dds/<repo-name-here>/languages', 'stargazers_url': 'https://<our.fqdn.here>/api/v3/repos/dds/<repo-name-here>/stargazers', 'contributors_url': 'https://<our.fqdn.here>/api/v3/repos/dds/<repo-name-here>/contributors', 'subscribers_url': 'https://<our.fqdn.here>/api/v3/repos/dds/<repo-name-here>/subscribers', 'subscription_url': 'https://<our.fqdn.here>/api/v3/repos/dds/<repo-name-here>/subscription', 'commits_url': 'https://<our.fqdn.here>/api/v3/repos/dds/<repo-name-here>/commits{/sha}', 'git_commits_url': 'https://<our.fqdn.here>/api/v3/repos/dds/<repo-name-here>/git/commits{/sha}', 'comments_url': 'https://<our.fqdn.here>/api/v3/repos/dds/<repo-name-here>/comments{/number}', 'issue_comment_url': 'https://<our.fqdn.here>/api/v3/repos/dds/<repo-name-here>/issues/comments{/number}', 'contents_url': 'https://<our.fqdn.here>/api/v3/repos/dds/<repo-name-here>/contents/{+path}', 'compare_url': 'https://<our.fqdn.here>/api/v3/repos/dds/<repo-name-here>/compare/{base}...{head}', 'merges_url': 'https://<our.fqdn.here>/api/v3/repos/dds/<repo-name-here>/merges', 'archive_url': 'https://<our.fqdn.here>/api/v3/repos/dds/<repo-name-here>/{archive_format}{/ref}', 'downloads_url': 'https://<our.fqdn.here>/api/v3/repos/dds/<repo-name-here>/downloads', 'issues_url': 'https://<our.fqdn.here>/api/v3/repos/dds/<repo-name-here>/issues{/number}', 'pulls_url': 'https://<our.fqdn.here>/api/v3/repos/dds/<repo-name-here>/pulls{/number}', 'milestones_url': 'https://<our.fqdn.here>/api/v3/repos/dds/<repo-name-here>/milestones{/number}', 'notifications_url': 'https://<our.fqdn.here>/api/v3/repos/dds/<repo-name-here>/notifications{?since,all,participating}', 'labels_url': 'https://<our.fqdn.here>/api/v3/repos/dds/<repo-name-here>/labels{/name}', 'releases_url': 'https://<our.fqdn.here>/api/v3/repos/dds/<repo-name-here>/releases{/id}', 'deployments_url': 'https://<our.fqdn.here>/api/v3/repos/dds/<repo-name-here>/deployments', 'created_at': '2020-07-21T06:05:06Z', 'updated_at': '2021-02-25T12:11:24Z', 'pushed_at': '2021-03-15T08:45:16Z', 'git_url': 'git://<our.fqdn.here>/dds/<repo-name-here>.git', 'ssh_url': '[email protected]:dds/<repo-name-here>.git', 'clone_url': 'https://<our.fqdn.here>/dds/<repo-name-here>.git', 'svn_url': 'https://<our.fqdn.here>/dds/<repo-name-here>', 'homepage': None, 'size': 87, 'stargazers_count': 0, 'watchers_count': 0, 'language': 'Groovy', 'has_issues': True, 'has_projects': True, 'has_downloads': True, 'has_wiki': True, 'has_pages': False, 'forks_count': 0, 'mirror_url': None, 'archived': False, 'disabled': False, 'open_issues_count': 1, 'license': None, 'forks': 0, 'open_issues': 1, 'watchers': 0, 'default_branch': 'master', 'anonymous_access_enabled': False}}, '_links': {'self': {'href': 'https://<our.fqdn.here>/api/v3/repos/dds/<repo-name-here>/pulls/14'}, 'html': {'href': 'https://<our.fqdn.here>/dds/<repo-name-here>/pull/14'}, 'issue': {'href': 'https://<our.fqdn.here>/api/v3/repos/dds/<repo-name-here>/issues/14'}, 'comments': {'href': 'https://<our.fqdn.here>/api/v3/repos/dds/<repo-name-here>/issues/14/comments'}, 'review_comments': {'href': 'https://<our.fqdn.here>/api/v3/repos/dds/<repo-name-here>/pulls/14/comments'}, 'review_comment': {'href': 'https://<our.fqdn.here>/api/v3/repos/dds/<repo-name-here>/pulls/comments{/number}'}, 'commits': {'href': 'https://<our.fqdn.here>/api/v3/repos/dds/<repo-name-here>/pulls/14/commits'}, 'statuses': {'href': 'https://<our.fqdn.here>/api/v3/repos/dds/<repo-name-here>/statuses/2d820bc13c209a89bef356fb396a5e33e1d637b4'}}, 'author_association': 'COLLABORATOR', 'active_lock_reason': None, 'merged': False, 'mergeable': True, 'rebaseable': True, 'mergeable_state': 'blocked', 'merged_by': None, 'comments': 4, 'review_comments': 0, 'maintainer_can_modify': False, 'commits': 5, 'additions': 45, 'deletions': 0, 'changed_files': 1}
2021-03-15 08:47:12 +0000 - publish.publisher - DEBUG - PR https://<our.fqdn.here>/dds/<repo-name-here>/pull/14: dds/<repo-name-here> -> dds/<repo-name-here>
2021-03-15 08:47:12 +0000 - publish.publisher - DEBUG - found pull request #14 for commit 2d820bc13c209a89bef356fb396a5e33e1d637b4
2021-03-15 08:47:12 +0000 - publish.publisher - DEBUG - comparing against base=a1909c66a00fcdf6c6ed1ac3bd42af19c03d2f3f
2021-03-15 08:47:12 +0000 - publish.publisher - DEBUG - found 0 check runs for commit a1909c66a00fcdf6c6ed1ac3bd42af19c03d2f3f
2021-03-15 08:47:12 +0000 - publish.publisher - DEBUG - found 0 check runs for commit a1909c66a00fcdf6c6ed1ac3bd42af19c03d2f3f with title Unit Test Results
2021-03-15 08:47:12 +0000 - publish.publisher - DEBUG - stats with delta: UnitTestRunResults(files=1, errors=[], suites=1, duration=10, tests=3, tests_succ=3, tests_skip=0, tests_fail=0, tests_error=0, runs=3, runs_succ=3, runs_skip=0, runs_fail=0, runs_error=0, commit='2d820bc13c209a89bef356fb396a5e33e1d637b4')
2021-03-15 08:47:12 +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"}

from publish-unit-test-result-action.

EnricoMi avatar EnricoMi commented on May 18, 2024

When config property comment_on_pr: false is provided build does NOT fail.

Yes, because then no PR comments are created and no comments are attempted to be hidden. Have you tried hide_comments: off with comment_on_pr: true? Then you would get comments but no hiding is attempted.

So as before, my assumption is that your GitHub Enterprise does not support the GraphQL API. You either need this get working or disable hide_comments. The only way to hide comments supported by GitHub is via GraphQL.

from publish-unit-test-result-action.

pazkooda avatar pazkooda commented on May 18, 2024

hide_comments: off with comment_on_pr: true works.

I'm contacting GHE owner about GraphQL API. Once I get some feedback on it will revert to you.

If we can confirm that in particular setups with inaccessible GraphQL API action may fail maybe we could cover this in some kind of TROUBLESHOOTING.md or similar.

Or can this be somehow handled gracefully in code itself i.e. if request to GraphQL API fails just catch it and make a warning in build that comments cannot be hidden due to API limitation.

To be evaluated once I can confirm GHE GQL API state :)

from publish-unit-test-result-action.

pazkooda avatar pazkooda commented on May 18, 2024

No GHE owner answer as of now but...

I did trivial test

curl -X GET --location "https://<our.fqdn.here>/api/graphql" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer <dedicate.personal.access.token>"

and it returns huge JSON.

So I assume this API is accessible.
If I can help more I need guidance as details of call from Actoin and GraphQL API responses is too much for me to "chase the root cause" by myself.

from publish-unit-test-result-action.

EnricoMi avatar EnricoMi commented on May 18, 2024

With log_level: DEBUG you should see some lines from urllib3, they might provide some URLs that are used.

This is what the action calls (as curl equivalent):

curl -H "Authorization: bearer ..." -X POST -d '{"query": "query FindIssueID { repository(owner:\"...\", name:\"...\") { pullRequest(number:...) { id, title, url, comments(last: 10) { nodes { id, url, author { login }, createdAt, body, isMinimized }, totalCount } } } }" }' https://api.github.com/graphql

You need to set the repository owner and name, and pull request number in the body.

It then tries to minimize comments by calling:

curl -H "Authorization: bearer ..." -X POST -d '{"query": "mutation MinimizeComment { minimizeComment(input: { subjectId: \"...\", classifier: OUTDATED } ) { clientMutationId, minimizedComment { isMinimized, minimizedReason, viewerCanMinimize } } }" }' https://api.github.com/graphql

where subjectId comes from the response of the first call.

Note: https://api.github.com/graphql is the public GitHub API, replace it with your GHE URL.

from publish-unit-test-result-action.

pazkooda avatar pazkooda commented on May 18, 2024

Two things:

  1. Initially I've used endpoint https://<our.fqdn.here>/api/graphql which contains /api comparing to yours sample queries where you refer /graphql only.
  2. I'm not longer configuring GITHUB_API_URL at all. So beside initial description all comments are referring to action configuration without it.

Regarding graphql curl queries:

  • if I call /graphql (without /api in front) I get HTTP 200 with SAML Login page as a response - thus assuming you've made a typo.
  • if I call /api/graphql I get a nice JSON response

Did also debugging action, GraphQL one seems to be configured correctly, same with default API:

GITHUB_GRAPHQL_URL=https://<our.fqdn.here>/api/graphql
GITHUB_API_URL=https://<our.fqdn.here>/api/v3

Do I understand your comment correctly that this line in publisher.py call incorrect endpoint?

from publish-unit-test-result-action.

EnricoMi avatar EnricoMi commented on May 18, 2024

You could try GITHUB_API_URL: https://<our.fqdn.here>/api.

Do I understand your comment correctly that this line in publisher.py call incorrect endpoint?

Yes.

from publish-unit-test-result-action.

pazkooda avatar pazkooda commented on May 18, 2024

Setting GITHUB_API_URL: https://<our.fqdn.here>/api did not helped.

I was looking at Action code previously and this particular one seems not to be overwritten by env section of action.

Any way I can help with providing support for GITHUB_GRAPHQL_URL in Action?

from publish-unit-test-result-action.

EnricoMi avatar EnricoMi commented on May 18, 2024

Yes, try the action from this branch:

uses: EnricoMi/publish-unit-test-result-action@branch-graphql-url

from publish-unit-test-result-action.

pazkooda avatar pazkooda commented on May 18, 2024

Works as expected πŸ˜ƒ ❕

Looking forward for next Action release πŸ˜‰.

BTW: Please look if my comment on regular API is relevant.

from publish-unit-test-result-action.

EnricoMi avatar EnricoMi commented on May 18, 2024

This has been released. If you are using @v1, it should be picked up on the next run, otherwise upgrade to @v1.10 or @v1.

from publish-unit-test-result-action.

pazkooda avatar pazkooda commented on May 18, 2024

Thx for update.

from publish-unit-test-result-action.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.