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

Add check for non-inclusive language #142

Merged
merged 2 commits into from
Jan 3, 2023

Conversation

nhosoi
Copy link
Contributor

@nhosoi nhosoi commented Dec 13, 2022

Add a check for usage of terms and language that is considered
non-inclusive. We are using the woke tool for this with a wordlist
that can be found at
https://github.com/linux-system-roles/tox-lsr/blob/main/src/tox_lsr/config_files/woke.yml

Note: this commit uses the customized woke placed locally in
.github/actions/custom-woke-action. It will be replaced with
the official woke once get-woke/woke#252
(Add an option "--count-only-error-for-failure") is processed.

CHANGELOG.md - cleanup non-inclusive words.
tests/tasks/setup_ipa.yml - Apply "wokeignore:rule"

@nhosoi
Copy link
Contributor Author

nhosoi commented Dec 13, 2022

Note: If 38a2f3a is acceptable, we can use the action woke-action with the released woke.

@nhosoi nhosoi changed the title Add github action woke.yml (github.com/get-woke/woke-action) [WIP] Add github action woke.yml (github.com/get-woke/woke-action) Dec 13, 2022
@nhosoi
Copy link
Contributor Author

nhosoi commented Dec 13, 2022

[citest]

runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
uses: actions/checkout@v2
uses: actions/checkout@v3

@nhosoi nhosoi force-pushed the woke-action branch 2 times, most recently from 424d0d9 to 3cd37a6 Compare December 14, 2022 18:25
@nhosoi nhosoi changed the title [WIP] Add github action woke.yml (github.com/get-woke/woke-action) [WIP] Add check for non-inclusive language Dec 14, 2022
@nhosoi nhosoi changed the title [WIP] Add check for non-inclusive language Add check for non-inclusive language Dec 15, 2022
@nhosoi
Copy link
Contributor Author

nhosoi commented Dec 15, 2022

[citest]

@@ -12,6 +12,7 @@
- name: Clone ansible-freeipa repo
git:
repo: https://github.com/freeipa/ansible-freeipa
# wokeignore:rule=master
version: master
Copy link
Collaborator

Choose a reason for hiding this comment

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

Here you can omit version: master - by default it will grab whatever branch is configured to be the default branch

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ansible-lint reports this error if no version: master is specified.

Error: git-latest Git checkouts must contain explicit version
You can skip specific rules or tags by adding them to your configuration file:
# .ansible-lint
warn_list:  # or 'skip_list' to silence them completely
  - git-latest  # Git checkouts must contain explicit version

Finished with 1 failure(s), 0 warning(s) on 82 files.
ERROR: InvocationError for command /home/runner/work/certificate/certificate/.tox/ansible-lint/bin/ansible-lint -v --exclude=tests/roles -c .ansible-lint (exited with code 2)

Which do we prefer between having version: master preceded by # wokeignore:rule=master or adding - '403' to the skip-list in .ansible-lint?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This commit 604afea takes the latter.

Copy link
Collaborator

@richm richm Dec 16, 2022

Choose a reason for hiding this comment

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

I would prefer noqa latest - https://ansible-lint.readthedocs.io/rules/latest/

  # noqa latest
  git:
    repo: https://github.com/freeipa/ansible-freeipa

I much, much prefer putting such suppressions inline in the code rather than the config file

  • the suppression is next to the problematic code
  • easier to deal with conversion to collection - don't have to merge a bunch of .ansible-lint files together
  • doesn't affect all files

(/me wishes the error message said this rather than "just add it to the .ansible-lint file" :-(

Copy link
Contributor Author

@nhosoi nhosoi Dec 16, 2022

Choose a reason for hiding this comment

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

Please ignore what I wrote previously. It worked!

@@ -10,6 +10,7 @@
   when: __is_beaker_env
 
 - name: Clone ansible-freeipa repo
+  # noqa git-latest

   git:
     repo: https://github.com/freeipa/ansible-freeipa
     dest: /tmp/freeipa-repo

And I ran tox -e ansible-lint.

______________________________________________ summary ______________________________________________
  ansible-lint: commands succeeded
  congratulations :)

@richm
Copy link
Collaborator

richm commented Dec 15, 2022

So if you omit the version: master from the setup_ipa, and edit the CHANGELOG.md to remove references to sanity, can you use the official woke github action instead of the custom one?

@nhosoi
Copy link
Contributor Author

nhosoi commented Dec 15, 2022

So if you omit the version: master from the setup_ipa, and edit the CHANGELOG.md to remove references to sanity, can you use the official woke github action instead of the custom one?

Yes, we can. Do we want to avoid using ansible-test sanity? Just say ansible-test?

@richm
Copy link
Collaborator

richm commented Dec 15, 2022

So if you omit the version: master from the setup_ipa, and edit the CHANGELOG.md to remove references to sanity, can you use the official woke github action instead of the custom one?

Yes, we can. Do we want to avoid using ansible-test sanity? Just say ansible-test?

Yes, just say ansible-test

@nhosoi
Copy link
Contributor Author

nhosoi commented Dec 16, 2022

[citest]

Add a check for usage of terms and language that is considered
non-inclusive. We are using the woke tool for this with a wordlist
that can be found at
https://github.com/linux-system-roles/tox-lsr/blob/main/src/tox_lsr/config_files/woke.yml

Signed-off-by: Noriko Hosoi <nhosoi@redhat.com>
@@ -53,6 +53,7 @@
rescue:
- name: FAILURE - check entropy
command: cat /proc/sys/kernel/random/entropy_avail
changed_when: false
Copy link
Collaborator

Choose a reason for hiding this comment

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

don't worry about these - we'll change these later when we make all of the roles work with ansible-lint 6.x - looks like we have some ansible-core 2.14 work to do as well - warn: false breaks with 2.14

CHANGELOG.md,tests/tasks/setup_ipa.yml - Cleanup non-inclusive words.
@rafasgj
Copy link

rafasgj commented Dec 16, 2022

About the 'version: master' on ansible-freeipa checkout, since I lost the argument to change it to "main", as we use it only to deploy IPA, and there won't be many changes, specially on what we need, we could pin the version to 'v1.9.0", and avoid the use of "master".

git:
repo: https://github.com/freeipa/ansible-freeipa
version: master
Copy link

Choose a reason for hiding this comment

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

Here's what I meant about the use of 'master'. We can safely pin version 'v1.9.0' and update it if we need in the future.

On the maintainance cost of updating it, I believe it will be updated soon, but not often.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Why can't we just omit version altogether, then git will use whatever is the default branch?

Copy link

Choose a reason for hiding this comment

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

If we can, it would be better. I though it was required.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is not required by the git module, but it is by ansible-lint. So, we are adding this line to skip the check by ansible-lint.
https://github.com/linux-system-roles/certificate/pull/142/files#diff-d1ca26ec3f441ccd0c4bb18b601d19668a8ffacfab0c71694fea7b46adc9823cR13

@nhosoi
Copy link
Contributor Author

nhosoi commented Dec 19, 2022

@richm, @rafasgj, @spetrosi, could you please review this pr one more time? Thanks!

Copy link
Collaborator

@rjeffman rjeffman left a comment

Choose a reason for hiding this comment

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

@nhosoi, although I don't understand why we can't pin the ansible freeipa version (and then don't have the # noqa comment, this change looks good to me.

And the use of woke looks promising, specially for the future. Thank you for looking into this issue!

I'm approving these changes.

@richm
Copy link
Collaborator

richm commented Dec 20, 2022

@nhosoi, although I don't understand why we can't pin the ansible freeipa version (and then don't have the # noqa comment, this change looks good to me.

My only concern is that it stays on an old version for a long time and never gets updated, which is what has happened in the past:
e84385a
cc7d5a9#diff-d1ca26ec3f441ccd0c4bb18b601d19668a8ffacfab0c71694fea7b46adc9823cL15

So if we have some (preferably automated) process for regularly updating the version, that's fine with me.

And the use of woke looks promising, specially for the future. Thank you for looking into this issue!

I'm approving these changes.

@nhosoi
Copy link
Contributor Author

nhosoi commented Dec 20, 2022

My only concern is that it stays on an old version for a long time and never gets updated, which is what has happened in the past: e84385a cc7d5a9#diff-d1ca26ec3f441ccd0c4bb18b601d19668a8ffacfab0c71694fea7b46adc9823cL15

So if we have some (preferably automated) process for regularly updating the version, that's fine with me.

Me, too. @rjeffman, do you want me to revert the version: master line? Or any specific version in your mind? And maybe, we'd like to have a tiny github action to check the ansible-freeipa version?

@rjeffman
Copy link
Collaborator

Me, too. @rjeffman, do you want me to revert the version: master line? Or any specific version in your mind? And maybe, we'd like to have a tiny github action to check the ansible-freeipa version?

Hmm... I have bug to fix where an external dependency is broken. Maybe we could have a Github action that setup all the testing dependencies.

But that's for the future, I'm fine with this PR as it is.

@richm
Copy link
Collaborator

richm commented Jan 2, 2023

[citest]

@richm richm merged commit 386ffbf into linux-system-roles:master Jan 3, 2023
richm added a commit to richm/linux-system-roles-certificate that referenced this pull request Jan 20, 2023
[1.1.8] - 2023-01-20
--------------------

### New Features

- none

### Bug Fixes

- ansible-lint 6.x fixes

### Other Changes

- Add check for non-inclusive language (linux-system-roles#142)
- Cleanup non-inclusive words
- ignore files for ansible-test 2.13 and 2.14 (linux-system-roles#149)

Signed-off-by: Rich Megginson <rmeggins@redhat.com>
richm added a commit that referenced this pull request Jan 20, 2023
[1.1.8] - 2023-01-20
--------------------

### New Features

- none

### Bug Fixes

- ansible-lint 6.x fixes

### Other Changes

- Add check for non-inclusive language (#142)
- Cleanup non-inclusive words
- ignore files for ansible-test 2.13 and 2.14 (#149)

Signed-off-by: Rich Megginson <rmeggins@redhat.com>

Signed-off-by: Rich Megginson <rmeggins@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants