Skip to content

Comments

fix: resolve duplicate error code in meshkit#904

Open
parthivsaikia wants to merge 3 commits intomeshery:masterfrom
parthivsaikia:fix/remove-duplicate-error-codes
Open

fix: resolve duplicate error code in meshkit#904
parthivsaikia wants to merge 3 commits intomeshery:masterfrom
parthivsaikia:fix/remove-duplicate-error-codes

Conversation

@parthivsaikia
Copy link
Member

Description

Different Meshkit errors were using the same error codes.

e.g.

Error Code Variable Name File Location
meshkit-11245 ErrAuthenticatingToRegistryCode models/oci/error.go
  ErrUnknownFormatCode models/converter/error.go
  ErrDecodeYamlCode encoding/error.go
meshkit-11248 ErrTaggingPackageCode models/oci/error.go
  ErrCompressToTarGZCode utils/error.go
  ErrUnmarshalSyntaxCode encoding/error.go

This PR resolves them by assigning new error codes starting from 11320 to 11334.

This PR fixes #903

Notes for Reviewers

I have updated the error codes by starting from the next available error code i.e. 11320. I have also updated the helpers/component_info.json by stating 11335 as the next available error code.

Signed commits

  • Yes, I signed my commits.

Signed-off-by: PARTHIV PRATIM SAIKIA <parthivsaikia985@gmail.com>
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @parthivsaikia, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request systematically eliminates duplicate error codes across the Meshkit codebase. By assigning unique identifiers to errors that previously shared codes, it enhances the reliability and clarity of error reporting, making it easier to diagnose and address issues. The changes ensure that each distinct error condition can be uniquely identified, improving the overall maintainability and robustness of the system.

Highlights

  • Duplicate Error Code Resolution: This pull request addresses and resolves instances of duplicate error codes within the Meshkit project, ensuring each error has a unique identifier.
  • New Error Code Assignment: A range of new error codes, from meshkit-11320 to meshkit-11334, have been assigned to previously duplicated error variables across various files.
  • Next Available Error Code Update: The next_error_code in helpers/component_info.json has been updated to 11335 to reflect the new highest assigned error code and maintain proper sequencing for future error code assignments.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request effectively resolves several instances of duplicate error codes within Meshkit by assigning new, unique codes. The changes are logical and the update to helpers/component_info.json to reflect the next available error code is correct. My main feedback is a suggestion to improve maintainability by ensuring that new error codes are assigned sequentially within their respective const or var blocks. This would make the code easier to read and manage in the long run.

Signed-off-by: PARTHIV PRATIM SAIKIA <parthivsaikia985@gmail.com>
…staticcheck

Signed-off-by: PARTHIV PRATIM SAIKIA <parthivsaikia985@gmail.com>
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.

Duplicate error codes in meshkit library

1 participant