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

feat(publisher): update publish state with redis #183

Merged
merged 1 commit into from
Oct 17, 2024

Conversation

wuhuizuo
Copy link
Contributor

Signed-off-by: wuhuizuo [email protected]

@ti-chi-bot ti-chi-bot bot requested a review from purelind October 17, 2024 09:18
@ti-chi-bot ti-chi-bot bot added the size/L label Oct 17, 2024
Copy link

ti-chi-bot bot commented Oct 17, 2024

I have already done a preliminary review for you, and I hope to help you do a better job.

This pull request introduces changes in the publisher service that updates the publishing state using Redis. Here's a summary of the key changes:

  1. Refactored the package structure, moving the Tiup related code into a subpackage pkg/impl/tiup.

  2. Renamed the initService function to initTiupService in main.go.

  3. Updated the error messages for file reading and parsing in initTiupService function to start with a lowercase letter for consistency.

  4. Modified the endpoint initialization in main.go to use the updated package path.

  5. The result of the query-publishing-status endpoint of the tiup service has been updated to be an enumerated type with the possible values "queued", "processing", "success", and "failed".

  6. Updated the example usage in cli.go to reflect new string values.

  7. The openapi.json, openapi.yaml, openapi3.json, and openapi3.yaml files have been updated to reflect the changes to the API.

  8. Added Redis operations to set the publishing state in the Handle function.

Potential problems:

  1. The Redis operations do not seem to handle any potential errors. If the Redis server is down or if there's a network issue, the code could potentially fail silently.

  2. The description of the pull request is not informative. It would be helpful to add more context and information about the changes made and why they were made.

Fixing suggestions:

  1. Add error handling for Redis operations.

  2. Update the pull request description to provide more context about the changes and why they were necessary.

  3. Make sure that all test cases have been updated according to new changes.

  4. It would be helpful to add more unit tests or integration tests to test Redis operations.

  5. Make sure that Redis operations are idempotent or handle duplication, as this can lead to unexpected results or data inconsistencies if the same operation is performed multiple times.

  6. It would be good to ensure the Redis server is set up for high availability and persistence, to prevent data loss in case of a server failure.

  7. It would be good to check if the Redis keys have a TTL (Time To Live), to ensure they get cleaned up after they are no longer needed.

  8. If Redis is being used to store important state information, it would be a good idea to consider using a more durable storage system, as Redis is not designed to be a primary data store.

@wuhuizuo
Copy link
Contributor Author

/approve

Copy link

ti-chi-bot bot commented Oct 17, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: wuhuizuo

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot bot added the approved label Oct 17, 2024
@ti-chi-bot ti-chi-bot bot merged commit ed099a3 into main Oct 17, 2024
3 checks passed
@ti-chi-bot ti-chi-bot bot deleted the feature/update-publish-state branch October 17, 2024 09:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant