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

confluence: correctly report a failed pdf-export #1203

Merged

Conversation

MaZderMind
Copy link
Contributor

The Code in get_pdf_download_url_for_confluence_cloud checks for errors in the PDF Export like this:

                if percentage_complete == 100:
                    running_task = False
                    log.info("Task completed - {task_state}".format(task_state=task_state))
                    if task_state == "FAILED":
                        log.error("PDF conversion not successful.")
                        return None
                    log.debug("Extract task results to download PDF.")
                    task_result_url = progress_response.get("result")
                else:
…

However, pages can fail at any percentage, leading to repeated checks (which never complete):

INFO:atlassian.confluence:50% - FAILED
INFO:atlassian.confluence:Check if export task has completed.
INFO:atlassian.confluence:50% - FAILED
INFO:atlassian.confluence:Check if export task has completed.
…

This change makes the code check the Task-State at every poll-roundtrip and return an error whenever it is ERROR.
fixes #1202

@codecov-commenter
Copy link

Codecov Report

Patch and project coverage have no change.

Comparison is base (5d9cd15) 34.84% compared to head (96f82b5) 34.84%.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1203   +/-   ##
=======================================
  Coverage   34.84%   34.84%           
=======================================
  Files          44       44           
  Lines        7940     7940           
  Branches     1072     1072           
=======================================
  Hits         2767     2767           
  Misses       5061     5061           
  Partials      112      112           
Impacted Files Coverage Δ
atlassian/confluence.py 13.16% <0.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@gonchik gonchik merged commit 77a3bff into atlassian-api:master Jul 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PDF-Export can fail with <100% which is not handled
3 participants