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

[Bug] - tresury report does not generate if projects in all three project-types do not exist #489

Open
as1729 opened this issue Oct 10, 2024 · 0 comments

Comments

@as1729
Copy link
Contributor

as1729 commented Oct 10, 2024

Current State

If the organization only has either 1A, 1B, or 1C or missing any of these project types, then the treasury report raises the following error.

[ERROR] AttributeError: 'NoneType' object has no attribute '__name__'
Traceback (most recent call last):
  File "/opt/python/lib/python3.12/site-packages/datadog_lambda/wrapper.py", line 232, in __call__
    self.response = self.func(event, context, **kwargs)
  File "/var/task/src/lib/logging.py", line 54, in inner
    def inner(*args, **kwargs):
  File "/opt/python/lib/python3.12/site-packages/ddtrace/contrib/aws_lambda/patch.py", line 120, in __call__
    self.response = self.func(*args, **kwargs)
  File "/var/task/src/lib/logging.py", line 56, in inner
    return func(*args, **kwargs)
  File "/var/task/src/functions/generate_treasury_report.py", line 79, in handle
    logger.exception("Missing event or context")
  File "/var/task/structlog/_native.py", line 45, in exception
    return self.error(event, *args, **kw)
  File "/var/task/structlog/_native.py", line 134, in meth
    return self._proxy_to_logger(name, event, **kw)
  File "/var/task/structlog/_base.py", line 214, in _proxy_to_logger
    args, kw = self._process_event(method_name, event, event_kw)
  File "/var/task/structlog/_base.py", line 165, in _process_event
    event_dict = proc(self._logger, method_name, event_dict)
  File "/var/task/structlog/processors.py", line 412, in __call__
    event_dict["exception"] = self.format_exception(
  File "/var/task/structlog/tracebacks.py", line 415, in __call__
    trace = extract(
  File "/var/task/structlog/tracebacks.py", line 231, in extract
    exc_type=safe_str(exc_type.__name__),

Expected State

The treasury report generation should not raise any errors if the organization only has one type of project. It should merely put a log indicating that the organization does not have any uploads with the specific project type.

@as1729 as1729 converted this from a draft issue Oct 10, 2024
@as1729 as1729 changed the title Fix - tresury report generation error when not all project types are present [Bug] - tresury report does not generate if projects in all three project-types do not exist Oct 10, 2024
@as1729 as1729 self-assigned this Oct 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: 🚢 Completed
Development

No branches or pull requests

1 participant