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

Tweaks to functions in utils.sh and refactored usages in webpage.sh #4653

Merged
merged 5 commits into from Apr 4, 2022

Conversation

PromoFaux
Copy link
Member

By submitting this pull request, I confirm the following:

  • I have read and understood the contributors guide, as well as this entire template.
  • I have made only one major change in my proposed changes.
  • I have commented my proposed changes within the code.
  • I have tested my proposed changes, and have included unit tests where possible.
  • I am willing to help maintain this change if there are issues with it later.
  • I give this submission freely and claim no ownership.
  • It is compatible with the EUPL 1.2 license
  • I have squashed any insignificant commits. (git rebase)

What does this PR aim to accomplish?:

Move some functionality out of webpage.sh and into utils.sh - keep the wrapper functions in webpage.sh for now as docker is currently using them - but these can go once we update docker container

…(adjust test to suit)

Add a removeKey function with test

update webpage.sh to reference functions in utils.sh (this can likely be abstracted/refactored further)

Signed-off-by: Adam Warner <me@adamwarner.co.uk>
@PromoFaux PromoFaux requested a review from a team March 16, 2022 17:44
Copy link
Member

@dschaper dschaper left a comment

Choose a reason for hiding this comment

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

Can you make sure that you don't use any bashisms? I'm working on POSIX compliance so we can run in non-bash native distributions. (i.e. Alpine).

advanced/Scripts/utils.sh Outdated Show resolved Hide resolved
advanced/Scripts/utils.sh Outdated Show resolved Hide resolved
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
 - Review Comments
 - Stickler Complaints
Copy link
Member

@yubiuser yubiuser left a comment

Choose a reason for hiding this comment

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

L263 and 273 in pihole can be expressed with the new functions form utils.sh as well

test/test_any_utils.py Outdated Show resolved Hide resolved
test/test_any_utils.py Outdated Show resolved Hide resolved
advanced/Scripts/utils.sh Show resolved Hide resolved
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
advanced/Scripts/utils.sh Outdated Show resolved Hide resolved
advanced/Scripts/utils.sh Outdated Show resolved Hide resolved
@yubiuser yubiuser merged commit d3e94cb into development Apr 4, 2022
@yubiuser yubiuser deleted the refactor-utils-redux branch April 4, 2022 21:25
PromoFaux added a commit that referenced this pull request Apr 14, 2022
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
@pralor-bot
Copy link

This pull request has been mentioned on Pi-hole Userspace. There might be relevant details there:

https://discourse.pi-hole.net/t/pi-hole-ftl-v5-15-web-v5-12-and-core-v5-10-released/54987/1

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

5 participants