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

Carefully parse warning messages when building documentation #8693

Merged
merged 2 commits into from
May 5, 2020

Conversation

mik-laj
Copy link
Member

@mik-laj mik-laj commented May 3, 2020

When the sphinx returns a warning that the script cannot process properly, an exception is raised

For example:

/opt/airflow/docs/howto/use-user-defined-exec-context.rst: WARNING: document isn't included in any toctree

Results in the following exception

Traceback (most recent call last):
  File "/opt/airflow/docs/build", line 288, in <module>
    build_sphinx_docs()
  File "/opt/airflow/docs/build", line 270, in build_sphinx_docs
    sphinx_build_errors = parse_sphinx_warnings(warning_text)
  File "/opt/airflow/docs/build", line 233, in parse_sphinx_warnings
    file_path=warning_parts[0], line_no=int(warning_parts[1]), message=warning_parts[2]
ValueError: invalid literal for int() with base 10: ' WARNING'

After this change, problems with warning processing do not result in an exception, but a raw message is displayed.

Related slack discussion: https://apache-airflow.slack.com/archives/C012FP2T9NW/p1588515270029000


Make sure to mark the boxes below before creating PR: [x]

  • Description above provides context of the change
  • Unit tests coverage for changes (not needed for documentation changes)
  • Target Github ISSUE in description if exists
  • Commits follow "How to write a good git commit message"
  • Relevant documentation is updated including usage instructions.
  • I will engage committers as explained in Contribution Workflow Example.

In case of fundamental code change, Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in UPDATING.md.
Read the Pull Request Guidelines for more information.

@mik-laj mik-laj requested a review from potiuk May 3, 2020 17:10
@kaxil
Copy link
Member

kaxil commented May 4, 2020

Can you add a description to the PR with before and After or why this is needed

@mik-laj
Copy link
Member Author

mik-laj commented May 4, 2020

@kaxil I updated the description

@mik-laj mik-laj merged commit 41b4c27 into apache:master May 5, 2020
@mik-laj mik-laj deleted the docs-carefully branch May 5, 2020 08:13
@kaxil kaxil added this to the Airflow 1.10.11 milestone Jun 30, 2020
kaxil pushed a commit that referenced this pull request Jul 1, 2020
@kaxil kaxil added the type:doc label Jul 1, 2020
kaxil pushed a commit that referenced this pull request Jul 1, 2020
cfei18 pushed a commit to cfei18/incubator-airflow that referenced this pull request Mar 5, 2021
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.

2 participants