Use first uppercase letter for all handlers #2461

Merged
ryanlerch merged 1 commit from handlers into main 2025-02-10 20:36:00 +00:00
Contributor

This will unify all the handlers to use first uppercase letter for
ansible-lint to stop complaining.

I went through all notify: occurrences and fixed them by running

set TEXT "text_to_replace"; set REPLACEMENT "replacement_text"; git grep
-rlz "$TEXT" . | xargs -0 sed -i "s/$TEXT/$REPLACEMENT/g"

Then I went through all the changes and removed the ones that wasn't
expected to be changed.

Fixes https://pagure.io/fedora-infrastructure/issue/12391

Signed-off-by: Michal Konecny mkonecny@redhat.com

This will unify all the handlers to use first uppercase letter for ansible-lint to stop complaining. I went through all `notify:` occurrences and fixed them by running ``` set TEXT "text_to_replace"; set REPLACEMENT "replacement_text"; git grep -rlz "$TEXT" . | xargs -0 sed -i "s/$TEXT/$REPLACEMENT/g" ``` Then I went through all the changes and removed the ones that wasn't expected to be changed. Fixes https://pagure.io/fedora-infrastructure/issue/12391 Signed-off-by: Michal Konecny <mkonecny@redhat.com>
Author
Contributor

rebased onto d710450269

rebased onto d71045026996e7064b8047f29a7664f9b4dd11c1
Author
Contributor

rebased onto d710450269

rebased onto d71045026996e7064b8047f29a7664f9b4dd11c1
First-time contributor

Build failed. More information on how to proceed and troubleshoot errors available at https://fedoraproject.org/wiki/Zuul-based-ci
https://fedora.softwarefactory-project.io/zuul/buildset/debb7ede36794cd7a317fb6bcf32b2f2

Build failed. More information on how to proceed and troubleshoot errors available at https://fedoraproject.org/wiki/Zuul-based-ci https://fedora.softwarefactory-project.io/zuul/buildset/debb7ede36794cd7a317fb6bcf32b2f2 - [fi-ansible-lint-diff ](https://fedora.softwarefactory-project.io/zuul/build/f6bb08d1832d42b0a1144379bb428ca9) : FAILURE in 25m 41s - [fi-yamllint-diff ](https://fedora.softwarefactory-project.io/zuul/build/7e5fcbf86a00421e88267c7374090bf5) : SUCCESS in 17m 24s
Contributor

Thanks for this! I looked at yq and perl for doing this and neither seemed easy.

For anyone else reviewing, it will be a lot easier if you download the patch and run it through diff-so-fancy (yum install diff-so-fancy).

The only problem I saw was the missing 'r' before list, here:

  • name: restart mirrorlist-server
  • name: Restart mirrolist-server
    service: name=mirrorlist-server state=restarted

...there were a couple of extra changes with removing _'s or quotes, but I think they are fine.

Thanks for this! I looked at yq and perl for doing this and neither seemed easy. For anyone else reviewing, it will be a lot easier if you download the patch and run it through diff-so-fancy (yum install diff-so-fancy). The only problem I saw was the missing 'r' before list, here: - name: restart mirrorlist-server - name: Restart mirrolist-server service: name=mirrorlist-server state=restarted ...there were a couple of extra changes with removing _'s or quotes, but I think they are fine.
Contributor

So, note that service module you are passing the name of the unit file on the os. It's 100% not capatlized.

I just found another case that was meesed up:

2ad6517991

I am wondering if we shouldn't just change everything back to lower case and tell ansible-lint to stop checking this. ;(

Is it only handlers that it complains about this on? Or every name: ?

So, note that service module you are passing the name of the unit file on the os. It's 100% not capatlized. I just found another case that was meesed up: 2ad65179910b87ce69761cc2bd6f04fff76d2817 I am wondering if we shouldn't just change everything back to lower case and tell ansible-lint to stop checking this. ;( Is it only handlers that it complains about this on? Or every name: ?
Author
Contributor

rebased onto 2ad6517991

rebased onto 2ad65179910b87ce69761cc2bd6f04fff76d2817
Author
Contributor

@james Fixed that

@kevin It basically complains about every name :/

@james Fixed that @kevin It basically complains about every name :/
First-time contributor

Build failed. More information on how to proceed and troubleshoot errors available at https://fedoraproject.org/wiki/Zuul-based-ci
https://fedora.softwarefactory-project.io/zuul/buildset/b1f63fc3a01e481287e5425f6e5970b8

Build failed. More information on how to proceed and troubleshoot errors available at https://fedoraproject.org/wiki/Zuul-based-ci https://fedora.softwarefactory-project.io/zuul/buildset/b1f63fc3a01e481287e5425f6e5970b8 - [fi-ansible-lint-diff ](https://fedora.softwarefactory-project.io/zuul/build/d2beca6a60174f1b88c154ca972f4a80) : FAILURE in 24m 30s - [fi-yamllint-diff ](https://fedora.softwarefactory-project.io/zuul/build/c4bc425466ae46c48f366871888807e2) : SUCCESS in 16m 35s
Owner

Lowercase spotted!

Lowercase spotted!
Owner

I've also noticed lowercased handler names in roles/rabbit/queue/handlers/main.yml and roles/zabbix/zabbix_agent/handlers/main.yml

I've also noticed lowercased handler names in `roles/rabbit/queue/handlers/main.yml` and `roles/zabbix/zabbix_agent/handlers/main.yml`
Author
Contributor

@abompard I must have missed those, thanks for pointing them out.

@abompard I must have missed those, thanks for pointing them out.
Author
Contributor

rebased onto 2ad6517991

rebased onto 2ad65179910b87ce69761cc2bd6f04fff76d2817
Author
Contributor

Fixed the ones that @abompard found.

I can probably create some simple script that will fix the uppercase letters in every name and call of the task.

Fixed the ones that @abompard found. I can probably create some simple script that will fix the uppercase letters in every name and call of the task.
First-time contributor

Build failed. More information on how to proceed and troubleshoot errors available at https://fedoraproject.org/wiki/Zuul-based-ci
https://fedora.softwarefactory-project.io/zuul/buildset/b2bbcafbcf6e403d89a07aa5d41f5137

Build failed. More information on how to proceed and troubleshoot errors available at https://fedoraproject.org/wiki/Zuul-based-ci https://fedora.softwarefactory-project.io/zuul/buildset/b2bbcafbcf6e403d89a07aa5d41f5137 - [fi-ansible-lint-diff ](https://fedora.softwarefactory-project.io/zuul/build/be6d348d34a34a3092c090e8fdd0be44) : FAILURE in 23m 37s - [fi-yamllint-diff ](https://fedora.softwarefactory-project.io/zuul/build/d2c32046064044c0884ddea8d398f9d0) : SUCCESS in 16m 19s
Author
Contributor

rebased onto 2ad6517991

rebased onto 2ad65179910b87ce69761cc2bd6f04fff76d2817
Author
Contributor

Found another handler I didn't updated, but the reason was that it wasn't called anywhere.

Found another handler I didn't updated, but the reason was that it wasn't called anywhere.
First-time contributor

Build failed. More information on how to proceed and troubleshoot errors available at https://fedoraproject.org/wiki/Zuul-based-ci
https://fedora.softwarefactory-project.io/zuul/buildset/63ac0c0bf6424632b140e969f0c05f64

Build failed. More information on how to proceed and troubleshoot errors available at https://fedoraproject.org/wiki/Zuul-based-ci https://fedora.softwarefactory-project.io/zuul/buildset/63ac0c0bf6424632b140e969f0c05f64 - [fi-ansible-lint-diff ](https://fedora.softwarefactory-project.io/zuul/build/bef6751fddbb44f4af5ff042f43f617d) : FAILURE in 24m 44s - [fi-yamllint-diff ](https://fedora.softwarefactory-project.io/zuul/build/70eccf9e07c84762be828f9fd9d22326) : SUCCESS in 17m 06s
Contributor

rebased onto 2ad6517991

rebased onto 2ad65179910b87ce69761cc2bd6f04fff76d2817
Contributor

ok. Lets give this a go.

Hopefully things are better after it.

ok. Lets give this a go. Hopefully things are better after it.
Contributor

Pull-Request has been merged by kevin

Pull-Request has been merged by kevin
First-time contributor

Build failed. More information on how to proceed and troubleshoot errors available at https://fedoraproject.org/wiki/Zuul-based-ci
https://fedora.softwarefactory-project.io/zuul/buildset/646fc712b350421984d0f3fab1db43be

Build failed. More information on how to proceed and troubleshoot errors available at https://fedoraproject.org/wiki/Zuul-based-ci https://fedora.softwarefactory-project.io/zuul/buildset/646fc712b350421984d0f3fab1db43be - [fi-ansible-lint-diff ](https://fedora.softwarefactory-project.io/zuul/build/6a1a48744ac64b5ea5bccc91c866d6b3) : FAILURE in 24m 33s - [fi-yamllint-diff ](https://fedora.softwarefactory-project.io/zuul/build/2824250400f2498f942a01e60f7269cf) : SUCCESS in 16m 55s
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
5 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: Infrastructure/ansible#2461
No description provided.