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

fix: Bash Compatibility in print_services_and_ports Function #1643

Merged
merged 1 commit into from
Dec 30, 2023

Conversation

cubxxw
Copy link
Contributor

@cubxxw cubxxw commented Dec 30, 2023


🔍 What type of PR is this?

👀 What this PR does / why we need it:

  • My pull request adheres to the code style of this project
  • My code requires changes to the documentation
  • I have updated the documentation as required
  • All the tests have passed

This Pull Request addresses the compatibility issue in the print_services_and_ports function found in check-all.sh, enabling it to work with Bash versions older than 4.3. The solution involves removing the use of named references (local -n), which are not supported in older Bash versions.

🅰 Which issue(s) this PR fixes:

Rewritten print_services_and_ports to accept arrays directly as arguments.
The function now handles service names and ports without relying on named references, ensuring compatibility with a broader range of Bash environments.

The modified script has been tested in environments with both older (pre-4.3) and newer versions of Bash.
All tests ensure that the function correctly prints services and their corresponding ports without errors.

Fixes #1642

📝 Special notes for your reviewer:

🎯 Describe how to verify it

While this change aims at increasing compatibility, performance impacts (if any) on environments with large arrays should be minimal.
Further testing in varied environments is recommended to ensure consistent behavior.

📑 Additional documentation e.g., RFC, notion, Google docs, usage docs, etc.:

Copy link
Contributor

sweep-ai bot commented Dec 30, 2023

Apply Sweep Rules to your PR?

  • Apply: All new business logic should have corresponding unit tests.
  • Apply: Refactor large functions to be more modular.
  • Apply: Add docstrings to all functions and file headers.

Copy link

codecov bot commented Dec 30, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (a7138cb) 5.12% compared to head (68763c5) 5.12%.

Additional details and impacted files
@@          Coverage Diff          @@
##            main   #1643   +/-   ##
=====================================
  Coverage   5.12%   5.12%           
=====================================
  Files         42      42           
  Lines       3782    3782           
=====================================
  Hits         194     194           
  Misses      3577    3577           
  Partials      11      11           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@cubxxw cubxxw added this pull request to the merge queue Dec 30, 2023
Merged via the queue into main with commit bed112d Dec 30, 2023
26 checks passed
@cubxxw cubxxw deleted the cubxxw-patch-1 branch December 30, 2023 03:12
@github-actions github-actions bot added this to the v3.1 milestone Dec 30, 2023
@openimsdk openimsdk locked and limited conversation to collaborators Dec 30, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: Compatibility Issue with print_services_and_ports Function in Older Bash Versions
3 participants