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(cli): "fancy" progress reporting not disabled on all CI systems #9516

Merged
merged 4 commits into from
Aug 18, 2020

Conversation

andreialecu
Copy link
Contributor

Fixes: #8696 #8893

Detects whether the CI environment variable is set and reverts output to standard behavior.

The fancy output was especially broken on CircleCI.


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

@andreialecu
Copy link
Contributor Author

Seems that a test is needed. Any suggestions on how to test this are appreciated. The PR that implemented it had no tests #8165 so I'm unsure what to do here.

@skinny85
Copy link
Contributor

skinny85 commented Aug 8, 2020

Thanks for the vote of confidence @SomayaB , but I think @rix0rrr should look into this one 🙂

@skinny85 skinny85 requested a review from rix0rrr August 8, 2020 00:28
@skinny85 skinny85 assigned rix0rrr and unassigned skinny85 Aug 8, 2020
@andreialecu
Copy link
Contributor Author

andreialecu commented Aug 8, 2020

Some additional explanation:

Copy link
Contributor

@rix0rrr rix0rrr left a comment

Choose a reason for hiding this comment

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

We already have a --ci flag with autodetection:

https://github.com/aws/aws-cdk/blob/master/packages/aws-cdk/bin/cdk.ts#L85

Please thread that argument through and use it.

I'm also confused why isTTY should be true on CircleCI. I would imagine it to be false, which is why I thought the check that was already there would have sufficed. Do you have any thoughts on that by any chance?

@andreialecu
Copy link
Contributor Author

The --ci argument is deprecated. Not sure what the process is to de-deprecate it.

This was more of a quick band aid for an urgent problem that is breaking output on some CIs.

I'm on vacation this week so I won't be able to dive too deep into it. If you can take over in the mean time, please. :)

@andreialecu
Copy link
Contributor Author

Some information about CircleCI and TTY here: https://discuss.circleci.com/t/circleci-terminal-is-a-tty-but-term-is-not-set/9965

@rix0rrr rix0rrr added the pr-linter/exempt-test The PR linter will not require test changes label Aug 18, 2020
@rix0rrr rix0rrr changed the title fix(cli): disable fancy output on CI fix(cli): "fancy" progress reporting not disabled on all CI systems Aug 18, 2020
@mergify mergify bot dismissed rix0rrr’s stale review August 18, 2020 09:23

Pull request has been modified.

@mergify
Copy link
Contributor

mergify bot commented Aug 18, 2020

Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject6AEA49D1-qxepHUsryhcu
  • Commit ID: a7c4a21
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@mergify
Copy link
Contributor

mergify bot commented Aug 18, 2020

Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@mergify mergify bot merged commit 97ef371 into aws:master Aug 18, 2020
misterjoshua pushed a commit to misterjoshua/aws-cdk that referenced this pull request Aug 19, 2020
…ws#9516)

Fixes: aws#8696 aws#8893

Detects whether the `CI` environment variable is set and reverts output to `standard` behavior.

The fancy output was especially broken on CircleCI.

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
@robertd
Copy link
Contributor

robertd commented Aug 20, 2020

@andreialecu @rix0rrr I'm still not retaining the cfn events. Also, using CI env variable I've lost color output.
I'm using iTerm2 and zsh (oh-my-zsh).

Using export CI="":

export CI=""; cdk deploy
^[IsaidCloudFrontDistribution: deploying...
IsaidCloudFrontDistribution: creating CloudFormation changeset...
[██████████████████████████████████████████████████████████] (2/2)




 ✅  IsaidCloudFrontDistribution

Stack ARN:
arn:aws:cloudformation:us-west-2:123456789:stack/IsaidCloudFrontDistribution/c12044d0-e22b-11ea-858b-06675510bae4

Using --ci:

cdk deploy --ci
IsaidCloudFrontDistribution: deploying...
IsaidCloudFrontDistribution: creating CloudFormation changeset...
[██████████████████████████████████████████████████████████] (2/2)




 ✅  IsaidCloudFrontDistribution

Stack ARN:
arn:aws:cloudformation:us-west-2:123456789:stack/IsaidCloudFrontDistribution/c12044d0-e22b-11ea-858b-06675510bae4

@joel100
Copy link

joel100 commented Sep 3, 2020

This doesn't seem to work with 1.61.1. I'm deploying with Octopus deploy and output seems to be the same and output is still coming from StdErr.

I've tried
$env:CI="" & cdk deploy --require-approval never
and

& cdk deploy --ci --require-approval never

Both times I get the following output.
September 3rd 2020 09:18:18Error XXX: deploying... September 3rd 2020 09:18:18Error [0%] start: Publishing 8e48b9c55f892c6662b118c86cac6064ee9d5beb743b3c550e816229dcc87f96:current September 3rd 2020 09:18:18Error [100%] success: Published 8e48b9c55f892c6662b118c86cac6064ee9d5beb743b3c550e816229dcc87f96:current September 3rd 2020 09:18:18Error XXX: creating CloudFormation changeset... September 3rd 2020 09:18:23Info arn:aws:cloudformation:us-east-2:14785470xxxx:stack/XXX/xxxxxxxx-ede3-11ea-8a6c-xxxxxxxxxxxx September 3rd 2020 09:18:23Error ✅ XXX (no changes) September 3rd 2020 09:18:23Error Stack ARN:

What am I missing here?

@robertd
Copy link
Contributor

robertd commented Sep 3, 2020

@joel100 #9623 is supposed to fix this. It’s merged in the master branch, but it didn’t land in 1.61.1 release. It will definitely be in 1.62.0 later this week.

@joel100
Copy link

joel100 commented Sep 3, 2020

Thank you.

This is a bandaid to the underlying issue of non-errors being written to stderr, but it cleans up logs in the short term

@efenderbosch
Copy link

Did this ever get released?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-linter/exempt-test The PR linter will not require test changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[CLI] display issues with new deployment monitoring in the CDK CLI
7 participants