lfglabs-dev / api.starknet.quest

starknet.quest rust backend
2 stars 17 forks source link

Improve the config template #244

Closed Marchand-Nicolas closed 1 month ago

Marchand-Nicolas commented 1 month ago

By default, when cloning the repo, after setting up the config from the template, when trying to run it, this will throw parsing errors such as the one above. The aim of this issue is to make the template config 100% valid, so that someone trying to run the server from scratch will spend less time fill these blank values in order to make the server run.

Marchand-Nicolas commented 1 month ago

You might get issues with the quiz category in the config, but you can just ignore them (or in order to test, replace the "*" by random numbers in your config.toml), because this section is going to be removed here https://github.com/starknet-id/api.starknet.quest/issues/240

ScottyDavies commented 1 month ago

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

I am front end developer with 6 years experience. i have worked with microsoft on several projects, this will be my first time contributing to the hackathon and i am ready to work

How I plan on tackling this issue

I would approach this issue with following steps Fix the Duplicated Categories: Identify the categories that are present twice, such as "[rhino]" or "[pyramid]". Remove the duplicate categories to ensure the configuration file is valid. Replace the Template Hex Values: Locate the template Hex values that are not actual numbers (e.g., "0xXXXXXXXXXXXX"). Replace these template values with valid random Hex values (e.g., "0xFFFFF") to prevent parsing errors. Check for Other Parsing Errors: Thoroughly review the configuration file for any other parsing errors or invalid values. Ensure that the entire configuration file is valid and can be successfully parsed. Validate the Configuration File: After making the necessary changes, validate the configuration file to ensure it is free of any parsing errors. This can be done by attempting to run the server or by using a configuration file validation tool, if available. Provide a 100% Valid Configuration Template: Update the configuration file template in the repository to include the fixed and valid values. Ensure that when someone clones the repository and sets up the configuration file from the template, they can immediately run the server without encountering any parsing errors.

SoarinSkySagar commented 1 month ago

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

I am a blockchain developer with a year of experience and I have experience in using and contributing to repos using Rust. I have developed Rust smart contracts, Rust projects and can definitely tackle this issue.

How I plan on tackling this issue

This issue seems fairly simple, I just need to change the config.template.toml, where I will remove the duplicate entries of rhino and pyramid, and for the invalid hex humbers like 0xXXXXX, I will replace them using some valid values like 0xFFFFF. Then, I will thoroughly check the file for any more parsing issues such that the setup of the project is as simple as possible from this viewpoint for a developer contributing for the first time.

This issue doesn't seem like a very complex one and I will be able to complete it within a few hours of being assigned. I will also make sure that my changes don't introduce any new error and I will maintain the code readability of the template.

SoarinSkySagar commented 1 month ago

Hi @Marchand-Nicolas, I have applied through OnlyDust and can definitely take on this issue. Have worked on similar issues before, so please assign.

raizo07 commented 1 month ago

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

Hello I'll like to be assigned to work on this.

thesledge04 commented 1 month ago

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

I have extensive experience in configuration management, debugging, and setting up software environments. My background includes working with configuration files, ensuring their validity, and troubleshooting issues related to parsing and deserialization.

In my previous roles, I’ve dealt with various configuration formats such as JSON, YAML, and TOML, and I’ve developed expertise in identifying and resolving issues like duplicate categories, invalid values, and other parsing errors. I have also worked on creating and maintaining configuration templates to ensure that new setups are straightforward and error-free.

Specific Skills and Approach: Configuration Management: I am adept at handling configuration files and ensuring they adhere to the expected format. For example, I’ve worked with JSON and YAML configurations, ensuring that values are correctly formatted and that there are no duplicates or invalid entries.

Debugging and Error Resolution: I have experience diagnosing and resolving parsing errors, such as the one mentioned where invalid Hex values cause deserialization failures. I can quickly identify the root cause of such errors and apply appropriate fixes, such as replacing placeholder values with valid ones.

Testing and Validation: I understand the importance of having a fully functional configuration file. I would thoroughly test the configuration file to ensure that it’s free from parsing errors and that it works seamlessly when setting up a new environment.

Approach to the Task: Identify and Resolve Duplicate Categories:

I would review the configuration file to locate any duplicate categories such as "[rhino]" or "[pyramid]". Remove or consolidate duplicates to ensure each category is unique. Replace Invalid Hex Values:

Find any template Hex values that are placeholders (e.g., "0xXXXXXXXXXXXX"). Replace these placeholders with valid random Hex values to avoid parsing errors. Validate the Configuration File:

Check for other potential parsing errors or formatting issues. Use tools or scripts to validate the configuration file’s syntax and ensure it adheres to the expected schema. Testing:

Run tests to ensure that the configuration file works correctly after updates. Verify that the server starts without errors when using the updated configuration. By applying these skills and methods, I can ensure that the configuration template is accurate, functional, and ready for immediate use, thereby reducing setup time and preventing errors for new users.

How I plan on tackling this issue

  1. Identify and Resolve Duplicate Categories Open the Configuration File:

Locate and open the configuration file, typically in formats like .ini, .toml, or .yaml. Find Duplicate Categories:

Search for categories such as [rhino] or [pyramid] that are defined more than once. Remove or Consolidate Duplicates:

Decide whether to remove duplicate sections or consolidate their entries. Make sure each category or section appears only once with all relevant settings included. Example for .ini or .toml:

ini Copy code [rhino] setting1 = value1 setting2 = value2 Consolidated if duplicated:

ini Copy code [rhino] setting1 = value1 setting2 = value2

Include all settings from duplicated sections here

  1. Replace Invalid Hex Values Locate Placeholder Hex Values:

Search for placeholders like 0xXXXXXXXXXXXX in the configuration file. Replace with Valid Hex Values:

Substitute these placeholders with valid, random Hex values. Ensure the format aligns with the expected Hex format. Example Replacement:

ini Copy code

Old placeholder

starknetid_contracts.naming_contract = 0xXXXXXXXXXXXX

New valid Hex value

starknetid_contracts.naming_contract = 0xFFFFF123456 Verify Hex Values:

Ensure that all Hex values are valid and match the required format. Hex values typically should be in the format 0x followed by digits and/or letters A-F.

  1. Check for Other Parsing Errors Validate Configuration Syntax:

Use configuration validation tools or linting tools specific to the configuration format (e.g., JSONLint for JSON, yamllint for YAML). Manually Review:

Check for common syntax issues such as missing commas, incorrect indentation, or unquoted strings. Test Parsing:

Attempt to parse the configuration file using a test script or tool to ensure it does not throw errors. Example for JSON:

json Copy code { "key": "value", "another_key": 1234 } Example for YAML:

yaml Copy code key: value another_key: 1234

  1. Testing and Validation Run the Server with the Updated Config:

Start the server or application using the updated configuration file to ensure it initializes without errors. Check Logs and Error Messages:

Review logs for any unexpected errors or warnings during startup or runtime. Verify Functionality:

Confirm that all expected functionalities are working as intended with the new configuration.

  1. Document the Changes Update Documentation:

If applicable, update any documentation to reflect changes in the configuration format or requirements. Provide Guidelines:

Ensure that users who clone the repo are aware of the updated configuration and any necessary changes or checks they should perform.

Benjtalkshow commented 1 month ago

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

I'm ready to work on improving the config template. My name is Benjamin, and I have extensive experience with configuration management and template validation. My background includes refining configuration files to ensure they are error-free and easy to use.

Understanding the Issue

The current config template has issues that lead to parsing errors. Specifically:

The goal is to make the template config 100% valid so that users can set up and run the server without encountering errors related to the configuration.

How I plan on tackling this issue

Fix Duplicate Categories

Replace Template Hex Values

Validate and Correct Parsing Errors

onlydustapp[bot] commented 1 month ago

The maintainer Marchand-Nicolas has assigned SoarinSkySagar to this issue via OnlyDust Platform. Good luck!