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

Updating yarn.list to not fail when when warnings are emitted #6129

Merged
merged 6 commits into from
Mar 14, 2023

Conversation

JohnDaly
Copy link
Contributor

@JohnDaly JohnDaly commented Mar 2, 2023

SUMMARY

Fixes #6127

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

yarn

ADDITIONAL INFORMATION

See #6127 for details

Comment on lines 247 to 249
for line in error.splitlines():
if json.loads(line)['type'] == 'error':
self.module.fail_json(msg=error)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Using the same approach that yarn.list_outdated() is using, to filter out warnings and only fail on errors:

# the package.json in the global dir is missing a license field, so warnings are expected on stderr
for line in err.splitlines():
if json.loads(line)['type'] == 'error':
self.module.fail_json(msg=err)

@ansibullbot
Copy link
Collaborator

@ansibullbot ansibullbot added bug This issue/PR relates to a bug language module module new_contributor Help guide this first time contributor packaging plugins plugin (any type) labels Mar 2, 2023
@felixfontein felixfontein added check-before-release PR will be looked at again shortly before release and merged if possible. backport-5 labels Mar 3, 2023
Copy link
Collaborator

@felixfontein felixfontein left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution!

changelogs/fragments/6127-yarn-ignore-warnings.yml Outdated Show resolved Hide resolved
@ansibullbot ansibullbot added needs_ci This PR requires CI testing to be performed. Please close and re-open this PR to trigger CI needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR and removed needs_ci This PR requires CI testing to be performed. Please close and re-open this PR to trigger CI needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR labels Mar 3, 2023
@JohnDaly JohnDaly requested a review from felixfontein March 3, 2023 23:28
@ansibullbot

This comment was marked as outdated.

@ansibullbot ansibullbot added merge_commit This PR contains at least one merge commit. Please resolve! needs_rebase https://docs.ansible.com/ansible/devel/dev_guide/developing_rebasing.html labels Mar 4, 2023
@ansibullbot

This comment was marked as outdated.

@ansibullbot ansibullbot added ci_verified Push fixes to PR branch to re-run CI needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR labels Mar 4, 2023
@JohnDaly JohnDaly force-pushed the fix/yarn-warnings branch from 87fd6b6 to 5411c7a Compare March 4, 2023 18:18
@ansibullbot ansibullbot removed ci_verified Push fixes to PR branch to re-run CI merge_commit This PR contains at least one merge commit. Please resolve! labels Mar 4, 2023
@ansibullbot ansibullbot added ci_verified Push fixes to PR branch to re-run CI and removed needs_rebase https://docs.ansible.com/ansible/devel/dev_guide/developing_rebasing.html labels Mar 4, 2023
@ansibullbot ansibullbot removed the ci_verified Push fixes to PR branch to re-run CI label Mar 4, 2023
@ansibullbot

This comment was marked as outdated.

@ansibullbot ansibullbot added the ci_verified Push fixes to PR branch to re-run CI label Mar 4, 2023
@ansibullbot ansibullbot removed ci_verified Push fixes to PR branch to re-run CI needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR labels Mar 4, 2023
Co-authored-by: Felix Fontein <felix@fontein.de>
@github-actions
Copy link

github-actions bot commented Mar 5, 2023

Docs Build 📝

Thank you for contribution!✨

This PR has been merged and your docs changes will be incorporated when they are next published.

@JohnDaly JohnDaly requested a review from felixfontein March 5, 2023 03:22
Copy link
Collaborator

@felixfontein felixfontein left a comment

Choose a reason for hiding this comment

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

Looks good to me. If nobody objects, I'll merge this in a week.

@felixfontein felixfontein merged commit df34569 into ansible-collections:main Mar 14, 2023
@patchback
Copy link

patchback bot commented Mar 14, 2023

Backport to stable-5: 💔 cherry-picking failed — conflicts found

❌ Failed to cleanly apply df34569 on top of patchback/backports/stable-5/df34569fadca7f3b554f612d7480b1eb50919704/pr-6129

Backporting merged PR #6129 into main

  1. Ensure you have a local repo clone of your fork. Unless you cloned it
    from the upstream, this would be your origin remote.
  2. Make sure you have an upstream repo added as a remote too. In these
    instructions you'll refer to it by the name upstream. If you don't
    have it, here's how you can add it:
    $ git remote add upstream https://github.com/ansible-collections/community.general.git
  3. Ensure you have the latest copy of upstream and prepare a branch
    that will hold the backported code:
    $ git fetch upstream
    $ git checkout -b patchback/backports/stable-5/df34569fadca7f3b554f612d7480b1eb50919704/pr-6129 upstream/stable-5
  4. Now, cherry-pick PR Updating yarn.list to not fail when when warnings are emitted #6129 contents into that branch:
    $ git cherry-pick -x df34569fadca7f3b554f612d7480b1eb50919704
    If it'll yell at you with something like fatal: Commit df34569fadca7f3b554f612d7480b1eb50919704 is a merge but no -m option was given., add -m 1 as follows instead:
    $ git cherry-pick -m1 -x df34569fadca7f3b554f612d7480b1eb50919704
  5. At this point, you'll probably encounter some merge conflicts. You must
    resolve them in to preserve the patch from PR Updating yarn.list to not fail when when warnings are emitted #6129 as close to the
    original as possible.
  6. Push this branch to your fork on GitHub:
    $ git push origin patchback/backports/stable-5/df34569fadca7f3b554f612d7480b1eb50919704/pr-6129
  7. Create a PR, ensure that the CI is green. If it's not — update it so that
    the tests and any other checks pass. This is it!
    Now relax and wait for the maintainers to process your pull request
    when they have some cycles to do reviews. Don't worry — they'll tell you if
    any improvements are necessary when the time comes!

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

@felixfontein felixfontein removed the check-before-release PR will be looked at again shortly before release and merged if possible. label Mar 14, 2023
@patchback
Copy link

patchback bot commented Mar 14, 2023

Backport to stable-6: 💚 backport PR created

✅ Backport PR branch: patchback/backports/stable-6/df34569fadca7f3b554f612d7480b1eb50919704/pr-6129

Backported as #6189

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

patchback bot pushed a commit that referenced this pull request Mar 14, 2023
* Updating yarn.list to not fail when when warnings are emitted

* Adding changelog fragment

* Adding _process_yarn_error function

* - Adding back changes to the changelog fragment
- Fixing formatting

* Fix trailing whitespace

* Update plugins/modules/yarn.py

Co-authored-by: Felix Fontein <felix@fontein.de>

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit df34569)
@felixfontein
Copy link
Collaborator

@JohnDaly thank you very much for your contribution!

@JohnDaly JohnDaly deleted the fix/yarn-warnings branch March 14, 2023 22:27
felixfontein pushed a commit that referenced this pull request Mar 15, 2023
… when when warnings are emitted (#6189)

Updating yarn.list to not fail when when warnings are emitted (#6129)

* Updating yarn.list to not fail when when warnings are emitted

* Adding changelog fragment

* Adding _process_yarn_error function

* - Adding back changes to the changelog fragment
- Fixing formatting

* Fix trailing whitespace

* Update plugins/modules/yarn.py

Co-authored-by: Felix Fontein <felix@fontein.de>

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit df34569)

Co-authored-by: John Daly <john.daly2@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue/PR relates to a bug language module module new_contributor Help guide this first time contributor packaging plugins plugin (any type)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

yarn: Warnings are flagged as errors
3 participants