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

"workflow not found" error #311

Closed
yegor256 opened this issue Aug 23, 2024 · 7 comments · Fixed by #312
Closed

"workflow not found" error #311

yegor256 opened this issue Aug 23, 2024 · 7 comments · Fixed by #312
Assignees
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@yegor256
Copy link
Member

I see this here:

D: Octokit::Client.check_runs_for_ref("objectionary/eo", "dcf609d2fb1ca2...1e1b5d89b6bbcfe8ea8572f8") in 517ms
D: Octokit::Client.workflow_run_job("objectionary/eo", 29098626367) in 94ms
Octokit::NotFound: GET https://api.github.com/repos/objectionary/eo/actions/jobs/29098626367: 404 - Not Found // See: https://docs.github.com/rest/actions/workflow-jobs#get-a-job-for-a-workflow-run
	/usr/local/bundle/gems/octokit-9.1.0/lib/octokit/response/raise_error.rb:14:in `on_complete'
	/usr/local/bundle/gems/faraday-2.10.1/lib/faraday/middleware.rb:57:in `block in call'
	/usr/local/bundle/gems/faraday-2.10.1/lib/faraday/response.rb:42:in `on_complete'
	/usr/local/bundle/gems/faraday-2.10.1/lib/faraday/middleware.rb:56:in `call'
	/usr/local/bundle/gems/faraday-http-cache-2.5.1/lib/faraday/http_cache.rb:286:in `fetch'
	/usr/local/bundle/gems/faraday-http-cache-2.5.1/lib/faraday/http_cache.rb:190:in `process'
	/usr/local/bundle/gems/faraday-http-cache-2.5.1/lib/faraday/http_cache.rb:141:in `call!'
	/usr/local/bundle/gems/faraday-http-cache-2.5.1/lib/faraday/http_cache.rb:121:in `call'
	/usr/local/bundle/gems/fbe-0.0.58/lib/fbe/middleware/quota.rb:48:in `call'
	/usr/local/bundle/gems/faraday-retry-2.2.1/lib/faraday/retry/middleware.rb:153:in `call'
	/usr/local/bundle/gems/faraday-2.10.1/lib/faraday/rack_builder.rb:152:in `build_response'
	/usr/local/bundle/gems/faraday-2.10.1/lib/faraday/connection.rb:444:in `run_request'
	/usr/local/bundle/gems/faraday-2.10.1/lib/faraday/connection.rb:200:in `get'
	/usr/local/bundle/gems/sawyer-0.9.2/lib/sawyer/agent.rb:99:in `call'
	/usr/local/bundle/gems/octokit-9.1.0/lib/octokit/connection.rb:156:in `request'
	/usr/local/bundle/gems/octokit-9.1.0/lib/octokit/connection.rb:19:in `get'
	/usr/local/bundle/gems/octokit-9.1.0/lib/octokit/client/actions_workflow_jobs.rb:17:in `workflow_run_job'
	/usr/local/bundle/gems/verbose-0.0.2/lib/verbose.rb:48:in `method_missing'
	/usr/local/bundle/gems/decoor-0.0.1/lib/decoor.rb:43:in `method_missing'
	/action/judges/github-events/github-events.rb:131:in `block in fetch_workflows'
	/action/judges/github-events/github-events.rb:128:in `each'
	/action/judges/github-events/github-events.rb:128:in `fetch_workflows'
	/action/judges/github-events/github-events.rb:190:in `fill_up_event'
	/action/judges/github-events/github-events.rb:318:in `block (4 levels) in <top (required)>'

Maybe we should somehow interpret this situation and avoid the exception.

@yegor256 yegor256 added bug Something isn't working help wanted Extra attention is needed labels Aug 23, 2024
@Suban05
Copy link
Contributor

Suban05 commented Aug 23, 2024

@yegor256 I can help

@yegor256
Copy link
Member Author

@Suban05 go ahead

@Suban05
Copy link
Contributor

Suban05 commented Aug 24, 2024

@yegor256 for this case we have the check_run with this json:

{:id=>29098626367,
 :name=>"Codacy Static Code Analysis",
 :node_id=>"CR_kwDOBFrB188AAAAGxmnNPw",
 :head_sha=>"dcf609d2fb1ca2ad1e1b5d89b6bbcfe8ea8572f8",
 :external_id=>"",
 :url=>"https://api.github.com/repos/objectionary/eo/check-runs/29098626367",
 :html_url=>"https://github.com/objectionary/eo/runs/29098626367",
 :details_url=>"https://app.codacy.com/gh/objectionary/eo/pull-requests/3345",
 :status=>"completed",
 :conclusion=>"success",
 :started_at=>2024-08-22 07:52:02 UTC,
 :completed_at=>2024-08-22 07:52:02 UTC,
 :output=>
  {:title=>"Your pull request is up to standards!",
   :summary=>"Codacy found no issues in your code",
   :text=>nil,
   :annotations_count=>0,
   :annotations_url=>
    "https://api.github.com/repos/objectionary/eo/check-runs/29098626367/annotations"},
 :check_suite=>{:id=>27464451778},
 :app=>
  {:id=>56611,
   :client_id=>"Iv1.4a97e692dda8878b",
   :slug=>"codacy-production",
   :node_id=>"MDM6QXBwNTY2MTE=",
   :owner=>
    {:login=>"codacy",
     :id=>1834093,
     :node_id=>"MDEyOk9yZ2FuaXphdGlvbjE4MzQwOTM=",
     :avatar_url=>"https://avatars.githubusercontent.com/u/1834093?v=4",
     :gravatar_id=>"",
     :url=>"https://api.github.com/users/codacy",
     :html_url=>"https://github.com/codacy",
     :followers_url=>"https://api.github.com/users/codacy/followers",
     :following_url=>
      "https://api.github.com/users/codacy/following{/other_user}",
     :gists_url=>"https://api.github.com/users/codacy/gists{/gist_id}",
     :starred_url=>
      "https://api.github.com/users/codacy/starred{/owner}{/repo}",
     :subscriptions_url=>"https://api.github.com/users/codacy/subscriptions",
     :organizations_url=>"https://api.github.com/users/codacy/orgs",
     :repos_url=>"https://api.github.com/users/codacy/repos",
     :events_url=>"https://api.github.com/users/codacy/events{/privacy}",
     :received_events_url=>
      "https://api.github.com/users/codacy/received_events",
     :type=>"Organization",
     :site_admin=>false},
   :name=>"Codacy Production",
   :description=>
    "We need these permissions to access your repositories in order to provide you with the best experience possible. We will be setting up commi
t hooks to analyze every commit and pull request faster. Don’t worry, we don’t modify any of your code!\r\n" +
    "\r\n" +
    "[Learn more about the required permissions](https://docs.codacy.com/getting-started/which-permissions-does-codacy-need-from-my-account/#gith
ub-cloud)",
   :external_url=>"https://www.codacy.com",
   :html_url=>"https://github.com/apps/codacy-production",
   :created_at=>2020-03-06 11:23:10 UTC,
   :updated_at=>2024-02-19 15:44:01 UTC,
   :permissions=>
    {:checks=>"write",
     :contents=>"read",
     :emails=>"read",
     :issues=>"write",
     :members=>"read",
     :metadata=>"read",
     :organization_hooks=>"write",
     :pull_requests=>"write",
     :repository_hooks=>"write",
     :statuses=>"write"},
   :events=>[]},
 :pull_requests=>[]}

for the usual cases we have this json:

{:id=>29098518426,
 :name=>"mvn (macos-12, 20)",
 :node_id=>"CR_kwDOBFrB188AAAAGxmgnmg",
 :head_sha=>"dcf609d2fb1ca2ad1e1b5d89b6bbcfe8ea8572f8",
 :external_id=>"8512e851-d1c9-52d1-8eaf-33b5fcf02a75",
 :url=>"https://api.github.com/repos/objectionary/eo/check-runs/29098518426",
 :html_url=>
  "https://github.com/objectionary/eo/actions/runs/10504002576/job/29098518426",
 :details_url=>
  "https://github.com/objectionary/eo/actions/runs/10504002576/job/29098518426",
 :status=>"completed",
 :conclusion=>"success",
 :started_at=>2024-08-22 07:49:24 UTC,
 :completed_at=>2024-08-22 08:12:27 UTC,
 :output=>
  {:title=>nil,
   :summary=>nil,
   :text=>nil,
   :annotations_count=>0,
   :annotations_url=>
    "https://api.github.com/repos/objectionary/eo/check-runs/29098518426/annotations"},
 :check_suite=>{:id=>27464452822},
 :app=>
  {:id=>15368,
   :client_id=>"Iv1.05c79e9ad1f6bdfa",
   :slug=>"github-actions",
   :node_id=>"MDM6QXBwMTUzNjg=",
   :owner=>
    {:login=>"github",
     :id=>9919,
     :node_id=>"MDEyOk9yZ2FuaXphdGlvbjk5MTk=",
     :avatar_url=>"https://avatars.githubusercontent.com/u/9919?v=4",
     :gravatar_id=>"",
     :url=>"https://api.github.com/users/github",
     :html_url=>"https://github.com/github",
     :followers_url=>"https://api.github.com/users/github/followers",
     :following_url=>
      "https://api.github.com/users/github/following{/other_user}",
     :gists_url=>"https://api.github.com/users/github/gists{/gist_id}",
     :starred_url=>
      "https://api.github.com/users/github/starred{/owner}{/repo}",
     :subscriptions_url=>"https://api.github.com/users/github/subscriptions",
     :organizations_url=>"https://api.github.com/users/github/orgs",
     :repos_url=>"https://api.github.com/users/github/repos",
     :events_url=>"https://api.github.com/users/github/events{/privacy}",
     :received_events_url=>
      "https://api.github.com/users/github/received_events",
     :type=>"Organization",
     :site_admin=>false},
   :name=>"GitHub Actions",
   :description=>"Automate your workflow from idea to production",
   :external_url=>"https://help.github.com/en/actions",
   :html_url=>"https://github.com/apps/github-actions",
   :created_at=>2018-07-30 09:30:17 UTC,
   :updated_at=>2024-04-10 20:33:16 UTC,
   :permissions=>
    {:actions=>"write",
     :administration=>"read",
     :attestations=>"write",
     :checks=>"write",
     :contents=>"write",
     :deployments=>"write",
     :discussions=>"write",
     :issues=>"write",
     :merge_queues=>"write",
     :metadata=>"read",
     :packages=>"write",
     :pages=>"write",
     :pull_requests=>"write",
     :repository_hooks=>"write",
     :repository_projects=>"write",
     :security_events=>"write",
     :statuses=>"write",
     :vulnerability_alerts=>"read"},
   :events=>
    ["branch_protection_rule",
     "check_run",
     "check_suite",
     "create",
     "delete",
     "deployment",
     "deployment_status",
     "discussion",
     "discussion_comment",
     "fork",
     "gollum",
     "issues",
     "issue_comment",
     "label",
     "merge_group",
     "milestone",
     "page_build",
     "project",
     "project_card",
     "project_column",
     "public",
     "pull_request",
     "pull_request_review",
     "pull_request_review_comment",
     "push",
     "registry_package",
     "release",
     "repository",
     "repository_dispatch",
     "status",
     "watch",
     "workflow_dispatch",
     "workflow_run"]},
 :pull_requests=>[]}

As you can see, the first case was run by Codacy Production, and other cases is GitHub Actions
maybe we need to check json[:app][:slug], if it equals github-actions then process it

What do you think?

@yegor256
Copy link
Member Author

@Suban05 yes, good suggestion, let's filter out by the slug

Suban05 added a commit to Suban05/judges-action that referenced this issue Aug 24, 2024
Suban05 added a commit to Suban05/judges-action that referenced this issue Aug 24, 2024
Suban05 added a commit to Suban05/judges-action that referenced this issue Aug 24, 2024
Suban05 added a commit to Suban05/judges-action that referenced this issue Aug 25, 2024
Suban05 added a commit to Suban05/judges-action that referenced this issue Aug 25, 2024
yegor256 added a commit that referenced this issue Aug 25, 2024
#311 fix "workflow not found" error
@yegor256
Copy link
Member Author

@rultor release, tag is 0.0.50

@rultor
Copy link
Contributor

rultor commented Aug 26, 2024

@rultor release, tag is 0.0.50

@yegor256 OK, I will release it now. Please check the progress here

@rultor
Copy link
Contributor

rultor commented Aug 26, 2024

@rultor release, tag is 0.0.50

@yegor256 Done! FYI, the full log is here (took me 31min)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants