Closed Bug 1619831 Opened 6 years ago Closed 6 years ago

Guard against not existing product_key

Categories

(Release Engineering :: Applications: Shipit, enhancement)

enhancement
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: rail, Assigned: rail)

Details

Attachments

(1 file)

If the client sends a new release payload which doesn't correspond to in-app config, it may end up with the following error:

KeyError: 'fennec_beta'
  File "flask/app.py", line 2446, in wsgi_app
    response = self.full_dispatch_request()
  File "flask/app.py", line 1951, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "flask_cors/extension.py", line 161, in wrapped_function
    return cors_after_request(app.make_response(f(*args, **kwargs)))
  File "flask/app.py", line 1820, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "flask/_compat.py", line 39, in reraise
    raise value
  File "flask/app.py", line 1949, in full_dispatch_request
    rv = self.dispatch_request()
  File "flask/app.py", line 1935, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "connexion/decorators/decorator.py", line 48, in wrapper
    response = function(request)
  File "connexion/decorators/uri_parsing.py", line 144, in wrapper
    response = function(request)
  File "connexion/decorators/validation.py", line 184, in wrapper
    response = function(request)
  File "connexion/decorators/response.py", line 103, in wrapper
    response = function(request)
  File "connexion/decorators/parameter.py", line 121, in wrapper
    return function(**kwargs)
  File "/app/src/shipit_api/admin/api.py", line 105, in add_release
    release.phases = generate_phases(release, common_input, verify_supported_flavors=True)
  File "/app/src/shipit_api/admin/tasks.py", line 136, in generate_phases
    for phase in release_promotion_flavors(release, actions, verify_supported_flavors):
  File "/app/src/shipit_api/admin/tasks.py", line 168, in release_promotion_flavors
    return extract_our_flavors(avail_flavors, release.product, release.version, release.partial_updates, release.product_key)
  File "/app/src/shipit_api/admin/tasks.py", line 86, in extract_our_flavors
    all_flavors = set([fl["name"] for fl in SUPPORTED_FLAVORS[product_key]])
Attached file GitHub Pull Request
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Component: Applications: ShipIt (backend) → Applications: ShipIt
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: