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

style: minor adjustments #2786

Merged
merged 6 commits into from Oct 2, 2022
Merged

style: minor adjustments #2786

merged 6 commits into from Oct 2, 2022

Conversation

georglauterbach
Copy link
Member

@georglauterbach georglauterbach commented Sep 21, 2022

Description

These adjustments are just follow-ups for the latest PRs I merged. If you have more adjustments, feel free to add them to this PR.

Type of change

  • Improvement (non-breaking change that does improve existing functionality)

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (README.md or the documentation under docs/)
  • If necessary I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

These adjustments are jus follow-ups for the latest PRs I merged.
@georglauterbach georglauterbach added priority/low area/scripts kind/improvement Improve an existing feature, configuration file or the documentation area/configuration (file) labels Sep 21, 2022
@georglauterbach georglauterbach self-assigned this Sep 21, 2022
@georglauterbach georglauterbach mentioned this pull request Sep 21, 2022
11 tasks
polarathene
polarathene previously approved these changes Sep 22, 2022
@georglauterbach georglauterbach requested a review from a team September 28, 2022 07:15
@@ -130,7 +130,7 @@ function _install_fail2ban
curl -Lkso fail2ban.deb "${FAIL2BAN_DEB_URL}"
curl -Lkso fail2ban.deb.asc "${FAIL2BAN_DEB_ASC_URL}"

FINGERPRINT=$(LANG=C gpg --verify fail2ban.deb.asc fail2ban.deb 2>&1 | sed -n 's#Primary key fingerprint: \(.*\)#\1#p')
FINGERPRINT=$(LANG=C gpg --verify fail2ban.deb.asc fail2ban.deb |& sed -n 's#Primary key fingerprint: \(.*\)#\1#p')
Copy link
Member

Choose a reason for hiding this comment

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

I didn't expect |& to have much luck with search engines, but I stand corrected 😅 (I did see the helpful commit message prior to searching, but was curious)

I suppose we have a lot of bash specific syntax throughout the project that a shell like ash probably isn't compatible?

Copy link
Member

Choose a reason for hiding this comment

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

I don't know exactly, how compatible ash/dash etc. are to bash. But as we wrote our scripts for bash, I am very fine with using bash specific syntax to unleash the full power 😆

Copy link
Member

Choose a reason for hiding this comment

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

@docker-mailserver/maintainers While we at it: what about replacing the sed command with:

grep -oP '(?<=Primary key fingerprint: ).+'

Regex explanation: The ?<= within the group means --> ignore this group and match only .+ that comes after.

This seems simpler and easier read (for me at least).

But no need for a lengthy discussion IMO. Just give a 👎 to keep it as it is, or 👍 to go with grep.

Copy link
Member

Choose a reason for hiding this comment

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

I don't think it's worth it personally.

Very minor improvement, and not something I'm going to remember, or like looking up if I saw it months later and forgot (git blame aside).

The sed command is familiar enough, I've seen the usage here elsewhere in the project, so it's easier to maintain.

Copy link
Member Author

Choose a reason for hiding this comment

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

I do not see an inherent need for this change as well - doesn't really matter I think. I'd just like to merge this sometime soon so we can get a feature freeze in place for v11.2.0 :)

@polarathene
Copy link
Member

@casperklein currently tests failed with the healthcheck, which I think you tried to address with a recent PR:

not ok 219 checking container healthcheck in 115ms
# (from function `assert_output' in file test/test_helper/bats-assert/src/assert_output.bash, line 194,
#  in test file test/tests.bats, line 123)
#   `assert_output "healthy"' failed
#
# -- output differs --
# expected : healthy
# actual   : starting
# --
#

@casperklein
Copy link
Member

I've provided a possible fix for the health check in #2810.

Afaik, that was the first time, that the health check failed since I addressed it recently? More annoying is however the test #217 which pretty often fails. This forces me sometimes to restart the tests three or more times.

@georglauterbach
Copy link
Member Author

georglauterbach commented Oct 2, 2022

We will definitely need to do something about the issue where only 217 tests run. The setup_file function for tests.bats fails, which leads to all the tests in this big file not being run. I will have a look (but do this in another PR).

@georglauterbach georglauterbach merged commit 4ab2306 into master Oct 2, 2022
@georglauterbach georglauterbach deleted the scripts/style branch October 2, 2022 11:00
@polarathene
Copy link
Member

When you both experienced the test 217 failures, I assume it was on PRs that would not result in invalidating the ClamAV cache, and that cache may be old enough to have ClamAV update when the container runs?

If so I have noticed on my system how problematic that can be for getting tests.bats to be successful.

@georglauterbach
Copy link
Member Author

georglauterbach commented Oct 2, 2022

When you both experienced the test 217 failures, I assume it was on PRs that would not result in invalidating the ClamAV cache, and that cache may be old enough to have ClamAV update when the container runs?

Yes, this is absolutely possible.

If so I have noticed on my system how problematic that can be for getting tests.bats to be successful.

Interesting - I will have a look into this too. Will provide more information in #2811.

@polarathene polarathene mentioned this pull request Oct 6, 2022
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/configuration (file) area/scripts kind/improvement Improve an existing feature, configuration file or the documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants