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

ansible_galaxy_install: use locale C tentatively, else en_US #5680

Merged

Conversation

russoz
Copy link
Collaborator

@russoz russoz commented Dec 11, 2022

SUMMARY

Tries to use locale C.UTF-8, if that fails then fall back to en_US.UTF-8.

Fixes #5661

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

ansible_galaxy_install

@ansibullbot ansibullbot added bug This issue/PR relates to a bug language module module packaging plugins plugin (any type) needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR labels Dec 11, 2022
@felixfontein felixfontein added check-before-release PR will be looked at again shortly before release and merged if possible. backport-5 labels Dec 11, 2022
@russoz russoz changed the title ansible_galaxy_install: use locale C tentatively, else en_US [WIP] ansible_galaxy_install: use locale C tentatively, else en_US Dec 11, 2022
@ansibullbot ansibullbot added the WIP Work in progress label Dec 11, 2022
@russoz russoz force-pushed the 5661-galaxy-locale branch from 7e6e319 to b1aca8a Compare December 17, 2022 21:21
@ansibullbot ansibullbot added integration tests/integration tests tests labels Dec 17, 2022
@github-actions
Copy link

github-actions bot commented Dec 17, 2022

Docs Build 📝

Thank you for contribution!✨

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

@russoz russoz requested a review from felixfontein December 19, 2022 08:35
@russoz
Copy link
Collaborator Author

russoz commented Dec 19, 2022

@felixfontein I must be doing something dumb again, but I cannot find why that one test is failing. It does not even seem to be related to the change made.

@russoz
Copy link
Collaborator Author

russoz commented Dec 19, 2022

Actually, I think I found it. The invalid locale stderr output seems to be different in that test platform.

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.

@russoz great news, thanks for fixing this! It needs a changelog fragment though :)

@russoz russoz force-pushed the 5661-galaxy-locale branch from b66cd94 to a406b2b Compare December 21, 2022 05:56
@russoz russoz changed the title [WIP] ansible_galaxy_install: use locale C tentatively, else en_US ansible_galaxy_install: use locale C tentatively, else en_US Dec 21, 2022
@ansibullbot ansibullbot removed the WIP Work in progress label Dec 21, 2022
@ansibullbot ansibullbot removed the needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR label Dec 21, 2022
@felixfontein felixfontein merged commit 488e828 into ansible-collections:main Dec 22, 2022
@patchback
Copy link

patchback bot commented Dec 22, 2022

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

❌ Failed to cleanly apply 488e828 on top of patchback/backports/stable-5/488e828f9b7dcf2867edec72ce35f766d7b54ff0/pr-5680

Backporting merged PR #5680 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/488e828f9b7dcf2867edec72ce35f766d7b54ff0/pr-5680 upstream/stable-5
  4. Now, cherry-pick PR ansible_galaxy_install: use locale C tentatively, else en_US #5680 contents into that branch:
    $ git cherry-pick -x 488e828f9b7dcf2867edec72ce35f766d7b54ff0
    If it'll yell at you with something like fatal: Commit 488e828f9b7dcf2867edec72ce35f766d7b54ff0 is a merge but no -m option was given., add -m 1 as follows intead:
    $ git cherry-pick -m1 -x 488e828f9b7dcf2867edec72ce35f766d7b54ff0
  5. At this point, you'll probably encounter some merge conflicts. You must
    resolve them in to preserve the patch from PR ansible_galaxy_install: use locale C tentatively, else en_US #5680 as close to the
    original as possible.
  6. Push this branch to your fork on GitHub:
    $ git push origin patchback/backports/stable-5/488e828f9b7dcf2867edec72ce35f766d7b54ff0/pr-5680
  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.

@patchback
Copy link

patchback bot commented Dec 22, 2022

Backport to stable-6: 💚 backport PR created

✅ Backport PR branch: patchback/backports/stable-6/488e828f9b7dcf2867edec72ce35f766d7b54ff0/pr-5680

Backported as #5722

🤖 @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 Dec 22, 2022
* ansible_galaxy_install: use locale C tentatively, else en_US

* use custom exception to signal unsupported locale

* add step to remove artefacts at the end of the test

* add step to remove artefacts at the beginning of the test

* comment out context controller

* trying with temporary dir as destination

* remove collection before test with reqs file

* ensure collections are installed in temp dir in tests + check_force

* simplified the change

* added extra condition for failing locale

* improved exception handling

* add changelog fragment

(cherry picked from commit 488e828)
@felixfontein
Copy link
Collaborator

@russoz thanks for fixing this!
@laidbackware thanks for testing!

@felixfontein felixfontein removed the check-before-release PR will be looked at again shortly before release and merged if possible. label Dec 22, 2022
felixfontein pushed a commit that referenced this pull request Dec 22, 2022
…cale C tentatively, else en_US (#5722)

ansible_galaxy_install: use locale C tentatively, else en_US (#5680)

* ansible_galaxy_install: use locale C tentatively, else en_US

* use custom exception to signal unsupported locale

* add step to remove artefacts at the end of the test

* add step to remove artefacts at the beginning of the test

* comment out context controller

* trying with temporary dir as destination

* remove collection before test with reqs file

* ensure collections are installed in temp dir in tests + check_force

* simplified the change

* added extra condition for failing locale

* improved exception handling

* add changelog fragment

(cherry picked from commit 488e828)

Co-authored-by: Alexei Znamensky <[email protected]>
@russoz russoz deleted the 5661-galaxy-locale branch December 22, 2022 06:58
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 integration tests/integration language module module packaging plugins plugin (any type) tests tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Calling ansible_galaxy_install generates "unsupported locale setting" error
3 participants