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 Script Error and Enhance Code Robustness and Details #1890

Merged
merged 6 commits into from
Feb 6, 2024

Conversation

cubxxw
Copy link
Contributor

@cubxxw cubxxw commented Feb 5, 2024

This Pull Request introduces several improvements and fixes to the existing script, addressing an error that was previously causing the script to fail under certain conditions. Below is a detailed overview of the changes made:

  1. Error Resolution: The main focus of this PR is to fix a critical issue where the script would throw an error due to improper handling of trailing commas in the MSG_TRANSFER_PROM_PORTS array elements. This was resolved by implementing a string manipulation technique to strip any trailing commas from the array elements before they are used in the PROMETHEUS_PORT_OPTION variable.

  2. Code Robustness: To ensure the script's long-term reliability, we've added checks to verify the number of MSG_TRANSFER_PROM_PORTS matches the expected OPENIM_MSGGATEWAY_NUM, preventing mismatch errors that could lead to unexpected behavior.

  3. Detail Improvements: Several minor code detail enhancements were made, including code style consistency adjustments for better readability and maintainability. Additionally, we've refined the log output for clearer and more informative messages regarding the script's execution process.

  4. Documentation Updates: Accompanying these changes, inline comments and documentation were updated to reflect the rationale behind key decisions and to guide future contributors in understanding the script's functionality.

CICD Verity:

 Started processes:
Process /home/runner/work/open-im-server/open-im-server/_output/bin/platforms/linux/amd64/openim-msgtransfer - Command: /home/runner/work/open-im-server/open-im-server/_output/bin/platforms/linux/amd64/openim-msgtransfer --prometheus_port 21400 -c /home/runner/work/open-im-server/open-im-server/config/ -n 0, PID: 19512, Port: 21400, Start time: Tue Feb  6 02:56:04 2024
Process /home/runner/work/open-im-server/open-im-server/_output/bin/platforms/linux/amd64/openim-msgtransfer - Command: /home/runner/work/open-im-server/open-im-server/_output/bin/platforms/linux/amd64/openim-msgtransfer --prometheus_port 21401 -c /home/runner/work/open-im-server/open-im-server/config/ -n 1, PID: 19537, Port: 21401, Start time: Tue Feb  6 02:56:04 2024
Process /home/runner/work/open-im-server/open-im-server/_output/bin/platforms/linux/amd64/openim-msgtransfer - Command: /home/runner/work/open-im-server/open-im-server/_output/bin/platforms/linux/amd64/openim-msgtransfer --prometheus_port 21402 -c /home/runner/work/open-im-server/open-im-server/config/ -n 2, PID: 19562, Port: 21402, Start time: Tue Feb  6 02:56:04 2024
Process /home/runner/work/open-im-server/open-im-server/_output/bin/platforms/linux/amd64/openim-msgtransfer - Command: /home/runner/work/open-im-server/open-im-server/_output/bin/platforms/linux/amd64/openim-msgtransfer --prometheus_port 21403 -c /home/runner/work/open-im-server/open-im-server/config/ -n 3, PID: 19588, Port: 21403, Start time: Tue Feb  6 02:56:04 2024

Signed-off-by: Xinwei Xiong (cubxxw) <3293172751nss@gmail.com>
Signed-off-by: Xinwei Xiong (cubxxw) <3293172751nss@gmail.com>
Signed-off-by: Xinwei Xiong (cubxxw) <3293172751nss@gmail.com>
Signed-off-by: Xinwei Xiong (cubxxw) <3293172751nss@gmail.com>
@pull-request-size pull-request-size bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Feb 6, 2024
Copy link

codecov bot commented Feb 6, 2024

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (3138193) 5.32% compared to head (592b358) 5.32%.
Report is 1 commits behind head on main.

Files Patch % Lines
pkg/common/config/parse.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@          Coverage Diff          @@
##            main   #1890   +/-   ##
=====================================
  Coverage   5.32%   5.32%           
=====================================
  Files         43      43           
  Lines       3830    3830           
=====================================
  Hits         204     204           
  Misses      3613    3613           
  Partials      13      13           

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

@kubbot kubbot enabled auto-merge February 6, 2024 07:52
@kubbot kubbot added this pull request to the merge queue Feb 6, 2024
Merged via the queue into openimsdk:main with commit 49610b5 Feb 6, 2024
25 checks passed
@github-actions github-actions bot added this to the v3.1 milestone Feb 6, 2024
@openimsdk openimsdk locked and limited conversation to collaborators Feb 6, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants