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

handle missing decision tasks more gracefully #1267

Open
bhearsum opened this issue Jan 30, 2023 · 2 comments
Open

handle missing decision tasks more gracefully #1267

bhearsum opened this issue Jan 30, 2023 · 2 comments
Labels
bug Something isn't working good first issue Good for newcomers python Pull requests that update Python code

Comments

@bhearsum
Copy link
Contributor

We currently get an unhandled exception when a decision task for a release cannot be found. On the frontend, this most likely shows up as a generic error, which is not very useful to users. We ought to turn it into a more actionable message (eg: "Couldn't create release; selected revision has no decision task").

The current full traceback is:

  File "flask/app.py", line 2525, in wsgi_app
    response = self.full_dispatch_request()
  File "flask/app.py", line 1822, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "flask_cors/extension.py", line 165, in wrapped_function
    return cors_after_request(app.make_response(f(*args, **kwargs)))
  File "flask/app.py", line 1820, in full_dispatch_request
    rv = self.dispatch_request()
  File "flask/app.py", line 1796, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
  File "connexion/decorators/decorator.py", line 68, in wrapper
    response = function(request)
  File "connexion/decorators/uri_parsing.py", line 149, in wrapper
    response = function(request)
  File "connexion/decorators/validation.py", line 196, in wrapper
    response = function(request)
  File "connexion/decorators/response.py", line 112, in wrapper
    response = function(request)
  File "connexion/decorators/parameter.py", line 120, in wrapper
    return function(**kwargs)
  File "/usr/local/lib/python3.9/site-packages/shipit_api/admin/api.py", line 114, in add_release
    release.phases = generate_phases(release, common_input, verify_supported_flavors=True)
  File "/usr/local/lib/python3.9/site-packages/shipit_api/admin/tasks.py", line 203, in generate_phases
    decision_task_id = find_decision_task_id(release.repo_url, release.project, release.revision, release.product)
  File "/usr/local/lib/python3.9/site-packages/shipit_api/admin/tasks.py", line 59, in find_decision_task_id
    raise Exception(f"route {decision_task_route} exception {exc}")
@bhearsum bhearsum added bug Something isn't working good first issue Good for newcomers python Pull requests that update Python code labels Jan 30, 2023
@bhearsum
Copy link
Contributor Author

same thing as #1337?

@bhearsum
Copy link
Contributor Author

A few of us talked about this today. We all agreed that we should prioritize showing a useful error to the user in this situation.

(We also explicitly said that trying to handle this better, eg: by polling for the decision task until it is completed, is probably not necessary or worth prioritizing.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers python Pull requests that update Python code
Projects
None yet
Development

No branches or pull requests

1 participant