### Does this PR have any customer impact?
No
### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc)
Refactor
### Does it involve schema level changes? (Table, Column, Index, UDF, etc level changes)
Not yet
### Are you introducing any new config? If yes, do you have tests with and without them being set?
No
### Release Note (Refer [Template](../docs/release_notes/pgmongo_template.md))
### Description
Initial setup for documentdb extensions.
Create Makefiles and set up build scripts around documentdb.
This does not yet touch the actual code or make anything deployable.
----
#### AI description (iteration 1)
#### PR Classification
Initial setup for DocumentDB integration.
#### PR Summary
This pull request sets up the initial structure and configuration for DocumentDB integration.
- Added `documentdb_errors.h` for defining DocumentDB-specific error codes.
- Created `Makefile` for `pg_documentdb`, `pg_documentdb_core`, and `pg_documentdb_distributed` to handle build configurations.
- Updated `validate_helio_extension_state.sh` and `validate_headers.sh` scripts to include checks for DocumentDB.
- Modified `bson_aggregation_nested_pipeline.c`, `bson_aggregation_vector_search.c`, and other source files to replace references from Helio to DocumentDB.
- Added control files for `pg_documentdb`, `pg_documentdb_core`, and `pg_documentdb_distributed` extensions.
### Does this PR have any customer impact?
No
### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc)
Refactor
### Does it involve schema level changes? (Table, Column, Index, UDF, etc level changes)
No
### Are you introducing any new config? If yes, do you have tests with and without them being set?
### Release Note (Refer [Template](../docs/release_notes/pgmongo_template.md))
### Description
Move Error map reference into a helio and mongo set of values. This splits error mapping to helio and error for other implementations like mongo wire protocol.
----
#### AI description (iteration 1)
#### PR Classification
Code cleanup
#### PR Summary
This pull request moves the error map reference to a generated folder, cleaning up the source directory.
- Removed Mongo error code definitions from `oss/pg_helio_core/include/utils/helio_errors.h`.
- Added `oss/pg_helio_core/generated/include/utils/helio_error_conversion.h` with Mongo error code definitions.
- Updated `oss/scripts/generate_error_values.sh` to handle the new generated header file.
- Moved `oss/pg_helio_core/src/utils/helio_errors.c` to `oss/pg_helio_core/generated/src/utils/helio_error_conversion.c`.
- Updated `pgmongo/Makefile` to include the new generated directory in the build process.
----
#### AI description (iteration 1)
#### PR Classification
Code cleanup
#### PR Summary
This pull request moves the error map reference to a generated folder, separating it from the source directory.
- `oss/pg_helio_core/include/utils/helio_errors.h`: Removed Mongo error code definitions.
- `oss/pg_helio_core/generated/include/utils/helio_error_conversion.h`: Added new file for Mongo error code definitions.
- `oss/scripts/generate_error_values.sh`: Updated script to generate new header and source files for error conversion.
- `pgmongo/Makefile`: Updated include paths to reference the new generated directory.
- Moved `oss/pg_helio_core/src/utils/helio_errors.c` to `oss/pg_helio_core/generated/src/utils/helio_error_conversion.c` without code changes.
### Does this PR have any customer impact?
No
### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc)
Features
### Does it involve schema level changes? (Table, Column, Index, UDF, etc level changes)
No
### Are you introducing any new config? If yes, do you have tests with and without them being set?
### Release Note (Refer [Template](../docs/release_notes/pgmongo_template.md))
### Description
Add code generated helper function to convert helio errors to mongo error codes.
----
#### AI description (iteration 1)
#### PR Classification
New feature
#### PR Summary
This pull request introduces a new helper function to convert Helio error codes to Mongo error codes.
- Added `helio_errors.c` to implement the conversion logic.
- Updated `generate_error_values.sh` to generate the new conversion file.
- Modified `Makefile` to include the new conversion file in the build process.
- Updated `helio_errors.h` to declare the new conversion function.
### Does this PR have any customer impact?
no
### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc)
refactoring
### Does it involve schema level changes? (Table, Column, Index, UDF, etc level changes)
yes
### Are you introducing any new config? If yes, do you have tests with and without them being set?
no
### Release Note (Refer [Template](../docs/release_notes/pgmongo_template.md))
na
### Description
1. Move all legacy errors to new helio errors
2. Remove all refs to mongo_errors.h excluding error_utils.c , there is function which needs backword compatibility
3. Update `scripts/validate_helio_extension_state.sh` to enforce all validations on oss/pg_helio_api parent directory instead of individual sub directories
----
#### AI description (iteration 1)
#### PR Classification
Code cleanup and deprecation.
#### PR Summary
This pull request moves all error handling to `helio_errors` and removes references to `mongo_errors.h`, deprecating certain functions.
- `error_utils.c`: Deprecated `command_throw_mongo_error` and `command_convert_mongo_error_to_postgres` functions.
- `mongo_errors.h`: Removed Mongo error handling code and redefined error code checks.
- `validate_helio_extension_state.sh`: Updated validation script to remove checks for `mongo_errors.h`.
- Added new SQL functions for database commands in `kill_op--1.22-0.sql`, `get_shard_key_value--1.22-0.sql`, and `reindex--1.22-0.sql`.
- Updated test files to reflect deprecation changes in error handling functions.
### Does this PR have any customer impact?
No
### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc)
Refactor
### Does it involve schema level changes? (Table, Column, Index, UDF, etc level changes)
No
### Are you introducing any new config? If yes, do you have tests with and without them being set?
No
### Release Note (Refer [Template](../docs/release_notes/pgmongo_template.md))
### Description
Move to helio error codes in pg-helio-core
Enforce hygiene in helio core
Move to helio errors
----
#### AI description (iteration 1)
#### PR Classification
Code cleanup
#### PR Summary
This pull request refactors error handling by replacing Mongo-specific error codes with Helio-specific error codes and updates error messages accordingly.
- Added `CheckNoMongoErrorCodes` function in `/scripts/validate_helio_extension_state.sh` to ensure no Mongo-specific error codes are used.
- Updated error codes and messages in `oss/pg_helio_core/src/query/bson_compare.c` to use Helio-specific codes.
- Modified error handling in `oss/pg_helio_core/src/types/pcre_regex.c` to replace Mongo error codes with Helio error codes.
- Replaced Mongo error codes with Helio error codes in `oss/pg_helio_core/src/io/pgbsonsequence.c`.
- Updated error codes in `oss/pg_helio_core/src/types/decimal128.c` to use Helio-specific codes.
### Does this PR have any customer impact?
No
### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc)
Refactor
### Does it involve schema level changes? (Table, Column, Index, UDF, etc level changes)
No(ish)
### Are you introducing any new config? If yes, do you have tests with and without them being set?
No
### Release Note (Refer [Template](../docs/release_notes/pgmongo_template.md))
### Description
Start using the new Helio error codes. These are of the format M0000->M0ZZZ
Convert helio_core to use M0001 for BadValue
With the new error syntax, the errmsg is the user facing error message.
Any PII Safe messages intended for the server will now be placed under errdetail_log (rather than errhint).
----
#### AI description (iteration 1)
#### PR Classification
New feature: Introduces a new error format and usage.
#### PR Summary
This pull request implements a new error format and updates the usage of error handling across multiple components.
- `logger_hooks.c`: Adds logic to transform client log data and ensure error details are properly set.
- `PostgresMongoResultExtensions.cs`: Refactors error handling to include sanitized error hints and details.
- `error.rs` and `pg.rs`: Adds support for known PostgreSQL error codes and refines error handling.
- `PostgresError.cs` and `PostgresClient.cs`: Updates error properties to include error hints and details.
- Multiple files in `pg_helio_core`: Replaces `ERRCODE_INVALID_TEXT_REPRESENTATION` with `ERRCODE_HELIO_BADVALUE` for better error categorization.
### Does this PR have any customer impact?
No
### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc)
Refactor
### Does it involve schema level changes? (Table, Column, Index, UDF, etc level changes)
No
### Are you introducing any new config? If yes, do you have tests with and without them being set?
No
### Release Note (Refer [Template](../docs/release_notes/pgmongo_template.md))
### Description
Use new error codes and move to source generators for errors for the C# GW
----
#### AI description (iteration 1)
#### PR Classification
Code cleanup and new feature.
#### PR Summary
This pull request ports CodeGen and new error definitions to the managed Gateway.
- Added comprehensive error definitions in `include/utils/helio_errors.h`.
- Removed `EtwEventWriterGenerator` class and related code from `Cosmos.Core.Trace.EtwEventWriterGenerator/EtwEventWriterGenerator.cs`.
### Does this PR have any customer impact?
### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc)
Refactoring
### Does it involve schema level changes? (Table, Column, Index, UDF, etc level changes)
### Are you introducing any new config? If yes, do you have tests with and without them being set?
### Release Note (Refer [Template](../docs/release_notes/pgmongo_template.md))
### Description
Generate error codes that are PG compatible
- Code-gen header file for Mongo Errors
- Generate a text file that can be used for other languages.
- In subsequent changes the existing codebase will be updated to consume these errors.
----
#### AI description (iteration 1)
#### PR Classification
New feature: Generate error codes that are PostgreSQL (PG) compatible.
#### PR Summary
This pull request introduces a new feature to generate error codes that are compatible with PostgreSQL.
- Added `helio_errors.h` with definitions for various Helio error codes and their corresponding MongoDB error codes.
- Created `mongoerrors.csv` to map error names to MongoDB error codes and their ordinal positions.