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

Fix selective checks handling error tracebacks in CI #28514

Merged

Conversation

potiuk
Copy link
Member

@potiuk potiuk commented Dec 21, 2022

Initially selective check was implemented in the way that it printed diagnostic output on stdout and the GITHUB_OUTPUT compatible set of outputs on stderr so that it could be redirected to the GITHUB_OUTPUT in its entirety. But this turned out to be a bad idea because when there was an error generated in selective-checks themselves, the traceback was printed in stderr and redirecting stderr to GITHUB_OUTPUT swallowed the traceback.

This change reverses the behaviour:

  • diagnostic output is printed to stderr
  • GITHUB_OUTPUT compatible output is printed to stdout

This way when traceback happens it is printed to stderr and is not swalleowed by redirection to GITHUB_OUTPUT


^ Add meaningful description above

Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an 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 a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in newsfragments.

Initially selective check was implemented in the way that it printed
diagnostic output on stdout and the GITHUB_OUTPUT compatible set of
outputs on stderr so that it could be redirected to the GITHUB_OUTPUT
in its entirety. But this turned out to be a bad idea because when
there was an error generated in selective-checks themselves, the
traceback was printed in stderr and redirecting stderr to GITHUB_OUTPUT
swallowed the traceback.

This change reverses the behaviour:

* diagnostic output is printed to stderr
* GITHUB_OUTPUT compatible output is printed to stdout

This way when traceback happens it is printed to stderr and is not
swalleowed by redirection to GITHUB_OUTPUT
@potiuk potiuk force-pushed the fix-selective-check-handling-traceback branch from eb7902b to 6719a53 Compare December 21, 2022 01:44
Copy link
Contributor

@xinbinhuang xinbinhuang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 just waiting for green CI

@jedcunningham jedcunningham merged commit bc7feda into apache:main Dec 21, 2022
potiuk added a commit to potiuk/airflow that referenced this pull request Dec 21, 2022
The apache#28514 added traceback handling for selective checks but the
redirection had not been fixed in few other workflows where it
was used.
potiuk added a commit that referenced this pull request Dec 21, 2022
The #28514 added traceback handling for selective checks but the
redirection had not been fixed in few other workflows where it
was used.
ephraimbuddy pushed a commit that referenced this pull request Jan 12, 2023
The #28514 added traceback handling for selective checks but the
redirection had not been fixed in few other workflows where it
was used.

(cherry picked from commit 4615d17)
ephraimbuddy pushed a commit that referenced this pull request Jan 12, 2023
Initially selective check was implemented in the way that it printed
diagnostic output on stdout and the GITHUB_OUTPUT compatible set of
outputs on stderr so that it could be redirected to the GITHUB_OUTPUT
in its entirety. But this turned out to be a bad idea because when
there was an error generated in selective-checks themselves, the
traceback was printed in stderr and redirecting stderr to GITHUB_OUTPUT
swallowed the traceback.

This change reverses the behaviour:

* diagnostic output is printed to stderr
* GITHUB_OUTPUT compatible output is printed to stdout

This way when traceback happens it is printed to stderr and is not
swalleowed by redirection to GITHUB_OUTPUT

(cherry picked from commit bc7feda)
@potiuk potiuk added this to the Airflow 2.5.1 milestone Jan 12, 2023
potiuk added a commit to potiuk/airflow that referenced this pull request Feb 6, 2023
The apache#28514 change added capability of getting trace errors for
the command by swapping redirection of stderr and stdout, but
debug output for github_output file remoined in stderr.

This was no problem in most cases as rich did not produce color
codes for stderr redirection and github_output was able to parse
it properly - and each line in the GITHHUB_OUTPUT was simply
duplicated.

However, when number of labels was big, rich split the message and
it caused Invalid format message.
potiuk added a commit that referenced this pull request Feb 6, 2023
The #28514 change added capability of getting trace errors for
the command by swapping redirection of stderr and stdout, but
debug output for github_output file remoined in stderr.

This was no problem in most cases as rich did not produce color
codes for stderr redirection and github_output was able to parse
it properly - and each line in the GITHHUB_OUTPUT was simply
duplicated.

However, when number of labels was big, rich split the message and
it caused Invalid format message.
pierrejeambrun pushed a commit that referenced this pull request Mar 7, 2023
The #28514 change added capability of getting trace errors for
the command by swapping redirection of stderr and stdout, but
debug output for github_output file remoined in stderr.

This was no problem in most cases as rich did not produce color
codes for stderr redirection and github_output was able to parse
it properly - and each line in the GITHHUB_OUTPUT was simply
duplicated.

However, when number of labels was big, rich split the message and
it caused Invalid format message.

(cherry picked from commit 9f1f026)
pierrejeambrun pushed a commit that referenced this pull request Mar 8, 2023
The #28514 change added capability of getting trace errors for
the command by swapping redirection of stderr and stdout, but
debug output for github_output file remoined in stderr.

This was no problem in most cases as rich did not produce color
codes for stderr redirection and github_output was able to parse
it properly - and each line in the GITHHUB_OUTPUT was simply
duplicated.

However, when number of labels was big, rich split the message and
it caused Invalid format message.

(cherry picked from commit 9f1f026)
@potiuk potiuk deleted the fix-selective-check-handling-traceback branch April 4, 2023 18:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants