Skip to content

Conversation

@potiuk
Copy link
Member

@potiuk potiuk commented Aug 18, 2020

The output of pre-commit builds on both CI and locally
is now limited to only show errors, unless verbose
variable is set.

We are utilising aliases if possible but in case of
pre-commits they are run in non-interactive shell which
means that aliases do not work as expected so we have
to run a few functions directly in other to
show spinner.


^ Add meaningful description above

Read the Pull Request Guidelines for more information.
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.

@potiuk potiuk force-pushed the silence-output-of-ci-builds branch from 4affc3c to f6ece9a Compare August 18, 2020 22:43
@potiuk potiuk force-pushed the silence-output-of-ci-builds branch from f6ece9a to cc8e290 Compare August 18, 2020 22:51
@potiuk
Copy link
Member Author

potiuk commented Aug 18, 2020

@mik-laj -> this one nicely fixes the output of pre-commits locally and GitHub actions so that no extra stuff is visible. Still it keeps pre-commit spinner /progress running as well as handles well VERBOSE flag. And I switched to using aliases for docker/kubectl everywhere where I can (aliases do not work in pre-commits as they are not interactive)

Of course erors are printed on pre-commit :)

@potiuk potiuk force-pushed the silence-output-of-ci-builds branch 6 times, most recently from a85b7fd to d337483 Compare August 19, 2020 00:43
The output of pre-commit builds on both CI and locally
is now limited to only show errors, unless verbose
variable is set.

We are utilising aliases if possible but in case of
pre-commits they are run in non-interactive shell which
means that aliases do not work as expected so we have
to run a few functions directly in other to
show spinner.

Extracted from apache#10368
@potiuk potiuk force-pushed the silence-output-of-ci-builds branch from d337483 to ff4b32e Compare August 19, 2020 01:01
if [[ -n ${SPIN_PID:=""} ]]; then
kill -HUP "${SPIN_PID}" || true
wait "${SPIN_PID}" || true
echo > "${DETECTED_TERMINAL}"
Copy link
Member

Choose a reason for hiding this comment

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

What values can the variable DETECTED_TERMINAL have? I can see that this variable is always set to /dev/tty. Did I miss something?

Copy link
Member Author

Choose a reason for hiding this comment

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

it can be /dev/tty if we cannot detect therminal with $(tty) (which happens inside pre-commit on git commit (it is always non-interactive by design)

Copy link
Member Author

Choose a reason for hiding this comment

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

it can be /dev/tty if we cannot detect therminal with $(tty) (which happens inside pre-commit on git commit (it is always non-interactive by design)

elif [[ ${DETECTED_TERMINAL:=$(tty)} != "not a tty" ]]; then

Copy link
Member Author

Choose a reason for hiding this comment

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

The whole thing is about trying to print progress to most likely terminal i fbuild happens insde pre-commit inside `git commit command - it won't always succeed but in vast majority of cases of developer workstation - it will

@potiuk potiuk merged commit 77a635e into apache:master Aug 19, 2020
@potiuk potiuk deleted the silence-output-of-ci-builds branch August 19, 2020 09:25
potiuk added a commit to potiuk/airflow that referenced this pull request Sep 13, 2020
The output of pre-commit builds on both CI and locally
is now limited to only show errors, unless verbose
variable is set.

We are utilising aliases if possible but in case of
pre-commits they are run in non-interactive shell which
means that aliases do not work as expected so we have
to run a few functions directly in other to
show spinner.

Extracted from apache#10368

(cherry picked from commit 77a635e)
RaviTezu pushed a commit to RaviTezu/airflow that referenced this pull request Oct 25, 2020
The output of pre-commit builds on both CI and locally
is now limited to only show errors, unless verbose
variable is set.

We are utilising aliases if possible but in case of
pre-commits they are run in non-interactive shell which
means that aliases do not work as expected so we have
to run a few functions directly in other to
show spinner.

Extracted from apache#10368

(cherry picked from commit 77a635e)
kaxil pushed a commit that referenced this pull request Nov 12, 2020
The output of pre-commit builds on both CI and locally
is now limited to only show errors, unless verbose
variable is set.

We are utilising aliases if possible but in case of
pre-commits they are run in non-interactive shell which
means that aliases do not work as expected so we have
to run a few functions directly in other to
show spinner.

Extracted from #10368

(cherry picked from commit 77a635e)
@potiuk potiuk added this to the Airflow 1.10.13 milestone Nov 14, 2020
@potiuk potiuk added the type:misc/internal Changelog: Misc changes that should appear in change log label Nov 14, 2020
potiuk added a commit that referenced this pull request Nov 16, 2020
The output of pre-commit builds on both CI and locally
is now limited to only show errors, unless verbose
variable is set.

We are utilising aliases if possible but in case of
pre-commits they are run in non-interactive shell which
means that aliases do not work as expected so we have
to run a few functions directly in other to
show spinner.

Extracted from #10368

(cherry picked from commit 77a635e)
cfei18 pushed a commit to cfei18/incubator-airflow that referenced this pull request Mar 5, 2021
The output of pre-commit builds on both CI and locally
is now limited to only show errors, unless verbose
variable is set.

We are utilising aliases if possible but in case of
pre-commits they are run in non-interactive shell which
means that aliases do not work as expected so we have
to run a few functions directly in other to
show spinner.

Extracted from apache#10368

(cherry picked from commit 77a635e)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:dev-tools type:misc/internal Changelog: Misc changes that should appear in change log

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants