Skip to content

Release PR for 2025-12-06 00:49#16

Merged
disafronov merged 53 commits into
releasefrom
main
Dec 6, 2025
Merged

Release PR for 2025-12-06 00:49#16
disafronov merged 53 commits into
releasefrom
main

Conversation

@disafronov
Copy link
Copy Markdown
Owner

@disafronov disafronov commented Dec 6, 2025

Changelog (#16)

📚 Documentation

  • (README) clarify exception handling for schema validation
  • (README) add handling for system-level errors during logger initialization
  • (schema_applier) clarify type checking for list validation
  • update exception handling for system-level errors
  • enhance README and comments for system-level error handling

♻️ Refactoring

  • Enhance schema validation and nested value handling
  • Update type hints for error classes in errors.py
  • (schema_loader) add caching to get_builtin_logrecord_attributes
  • (schema_loader) extract path formatting into helper function
  • (schema_loader) introduce _is_empty_or_none helper function
  • (schema_applier) update type hints to Python 3.9+ syntax
  • (schema_loader) update type hints to Python 3.9+ syntax
  • (schema_loader) introduce _validate_and_create_leaf function
  • (schema_loader) add caching functions for schema file paths
  • (schema_applier) simplify value retrieval from extra_values
  • (schema_loader) consolidate exception handling in schema compilation
  • (schema_loader) remove unused variable in schema compilation
  • (schema_loader) create helper function for empty schema with problems
  • (schema_applier) optimize source tracking in schema application
  • (schema_loader) extract current working directory logic into a helper function
  • (schema_loader) enhance schema loading tests and add new helper functions
  • (schema_logger) extract logger cleanup logic into a helper method
  • (schema_loader) add helper function to identify leaf nodes in schema
  • (schema_loader) simplify schema path resolution in compilation
  • (schema_logger) enhance exception handling during schema compilation
  • (schema_applier) optimize redundant field reporting in schema application
  • (schema_loader) update _load_raw_schema to accept schema_path as an argument
  • (schema_loader) improve thread safety in schema compilation

🧪 Tests

  • (schema_loader) add unit tests for schema validation functions
  • (schema_loader) add tests for schema depth validation and path retrieval
  • (schema_loader) add unit tests for _is_leaf_node function

🤖 CI

  • Correct regex for release candidate tags in GitHub Actions workflow
  • Correct quote style for regex pattern in publish.yaml
  • Add virtual environment creation step in GitHub Actions workflows
  • Update version extraction command in GitHub Actions workflows
  • (releaserc) remove [skip ci] from release message format
  • add GitHub Actions workflow for automatic PR description generation
  • update GitHub Actions workflow permissions for PR handling
  • update PR description generation action and output variable
  • update PR description generation action to stable version

🧹 Chores

  • Update release configuration and add GitHub Actions workflows for publishing
  • Refine release configuration for semantic release
  • Add version verification step in GitHub Actions workflows
  • Remove workflow_dispatch from GitHub Actions for publishing
  • Simplify release branch configuration in .releaserc.json
  • (release) 0.1.1-rc.1 [skip ci]
  • (deps) bump astral-sh/setup-uv from 3 to 7
  • (release) 0.1.1-rc.2 [skip ci]
  • update logging-objects-with-schema version to 0.1.1rc2
  • (release) 0.1.1-rc.3
  • (release) update release preparation commands and assets
  • (release) 0.1.1-rc.4
  • (release) 0.1.1-rc.5

disafronov and others added 30 commits December 5, 2025 18:58
…for publishing

- Modified `.releaserc.json` to define separate branches for stable and release candidate versions.
- Added new GitHub Actions workflows: `publish-stable.yaml` for publishing stable releases to PyPI, `publish.yaml` for publishing release candidates to Test PyPI, and `release-stable.yaml` for automating the release process on the `release` branch.

Signed-off-by: Dmitrii Safronov <zimniy@cyberbrain.cc>
- Updated the regex pattern in `.github/workflows/publish.yaml` to remove the escape character before the dot in the release candidate tag format, ensuring proper tag matching for release candidates.
- Updated the `.releaserc.json` file to improve the versioning command for release candidates by modifying the regex pattern.
- Ensured the configuration maintains compatibility with the existing plugins for commit analysis, release notes generation, and GitHub integration.

Signed-off-by: Dmitrii Safronov <zimniy@cyberbrain.cc>
- Implemented a new step in both `publish-stable.yaml` and `publish.yaml` to verify that the version in the tag matches the version specified in `pyproject.toml`.
- The verification process includes extracting the version from the tag and comparing it with the actual version from the project file, ensuring consistency before publishing.

Signed-off-by: Dmitrii Safronov <zimniy@cyberbrain.cc>
- Eliminated the `workflow_dispatch` trigger from both `publish-stable.yaml` and `publish.yaml` workflows to streamline the publishing process and ensure that releases are only triggered by tag events.

Signed-off-by: Dmitrii Safronov <zimniy@cyberbrain.cc>
- Modified the `.releaserc.json` file to streamline the branch configuration by replacing the object definition for the `release` branch with a string. This change enhances clarity and reduces complexity in the release setup.

Signed-off-by: Dmitrii Safronov <zimniy@cyberbrain.cc>
- Introduced new helper functions `_validate_list_value`, `_set_nested_value`, and `_validate_and_apply_leaf` to improve the validation of list values and the application of schema leaves.
- Refactored `_apply_schema_internal` to utilize the new validation and application functions, streamlining the processing of schema leaves.
- Added comprehensive unit tests for the new functions to ensure correct behavior and validation logic, including handling of type mismatches and nested structures.

Signed-off-by: Dmitrii Safronov <zimniy@cyberbrain.cc>
- Updated the regex pattern for release candidate tags in `.github/workflows/publish.yaml` to use double quotes for consistency with YAML standards.

Signed-off-by: Dmitrii Safronov <zimniy@cyberbrain.cc>
- Introduced a new step to create a virtual environment in both `publish-stable.yaml` and `publish.yaml` workflows, ensuring a consistent environment for the publishing process.

Signed-off-by: Dmitrii Safronov <zimniy@cyberbrain.cc>
- Modified the version extraction command in both `publish-stable.yaml` and `publish.yaml` to use `uv run python` instead of `python3`, ensuring compatibility with the virtual environment setup.

Signed-off-by: Dmitrii Safronov <zimniy@cyberbrain.cc>
Bumps [astral-sh/setup-uv](https://github.com/astral-sh/setup-uv) from 3 to 7.
- [Release notes](https://github.com/astral-sh/setup-uv/releases)
- [Commits](astral-sh/setup-uv@v3...v7)

---
updated-dependencies:
- dependency-name: astral-sh/setup-uv
  dependency-version: '7'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
- Changed type hints from List to list for problems parameter in SchemaValidationError and DataValidationError classes to align with Python 3.9+ syntax.
- This update enhances code clarity and maintains compatibility with modern Python type hinting standards.

Signed-off-by: Dmitrii Safronov <zimniy@cyberbrain.cc>
Add functools.lru_cache decorator to avoid recreating LogRecord
instance and performing introspection on every call. The result
is constant at runtime, so caching provides a minor optimization.

Signed-off-by: Dmitrii Safronov <zimniy@cyberbrain.cc>
Add _format_path() utility function to eliminate code duplication
in schema validation error messages. Replace all occurrences of
'.'.join(path + (key,)) and '.'.join(path) with calls to the
new helper function.

Signed-off-by: Dmitrii Safronov <zimniy@cyberbrain.cc>
Add a new utility function, _is_empty_or_none, to check if a value is None or an empty string. This function is utilized in the schema validation process to simplify the validation logic for leaf types and sources, enhancing code readability and maintainability.

Signed-off-by: Dmitrii Safronov <zimniy@cyberbrain.cc>
- Changed type hints from List to list and Tuple to tuple in schema_applier.py to align with modern Python type hinting standards.
- This update enhances code clarity and maintains compatibility with Python 3.9 and later.

Signed-off-by: Dmitrii Safronov <zimniy@cyberbrain.cc>
- Changed type hints from List and Tuple to list and tuple in schema_loader.py to align with modern Python type hinting standards.
- This update enhances code clarity and maintains compatibility with Python 3.9 and later.

Signed-off-by: Dmitrii Safronov <zimniy@cyberbrain.cc>
- Added a new function, _validate_and_create_leaf, to encapsulate the validation logic for leaf nodes in the schema. This refactor improves code organization and readability by centralizing the validation process, reducing duplication, and enhancing maintainability.

Signed-off-by: Dmitrii Safronov <zimniy@cyberbrain.cc>
- Introduced new unit tests for the _format_path, _is_empty_or_none, and _validate_and_create_leaf functions to ensure correct behavior across various scenarios.
- Tests cover formatting paths with and without keys, checking for empty or None values, and validating leaf creation for different types and conditions.
- This addition enhances test coverage and helps maintain the reliability of the schema validation logic.

Signed-off-by: Dmitrii Safronov <zimniy@cyberbrain.cc>
…etrieval

- Introduced new unit tests to validate schema depth constraints, ensuring that schemas exceeding MAX_SCHEMA_DEPTH produce appropriate problems, while those at the maximum depth compile correctly.
- Added tests for the _get_schema_path function to verify its behavior when the cached file is deleted and when the current working directory changes, ensuring it correctly handles cache invalidation and retrieval.

Signed-off-by: Dmitrii Safronov <zimniy@cyberbrain.cc>
- Updated the release message format in .releaserc.json to remove the [skip ci] directive, ensuring that CI is triggered for release commits.

Signed-off-by: Dmitrii Safronov <zimniy@cyberbrain.cc>
- Incremented the version of the logging-objects-with-schema package from 0.1.1rc1 to 0.1.1rc2 in the uv.lock file to reflect the latest release.

Signed-off-by: Dmitrii Safronov <zimniy@cyberbrain.cc>
- Modified the prepare command in .releaserc.json to update both the pyproject.toml and uv.lock files with the new version during the release process.
- Added uv.lock to the list of assets to be included in the release commit, ensuring that all relevant files are updated and versioned correctly.

Signed-off-by: Dmitrii Safronov <zimniy@cyberbrain.cc>
- Introduced new functions to manage caching of schema file paths: _check_cached_found_file_path, _check_cached_missing_file_path, _cache_and_return_found_path, and _cache_and_return_missing_path.
- These functions enhance the efficiency of schema file retrieval by validating cached paths and handling changes in the current working directory.
- Updated the _get_schema_path function to utilize these new caching mechanisms, improving its performance and reliability.

Signed-off-by: Dmitrii Safronov <zimniy@cyberbrain.cc>
- Changed the method of retrieving values from the extra_values dictionary to use direct indexing instead of the get method. This ensures that a KeyError is raised for missing keys, making the error handling more explicit.

Signed-off-by: Dmitrii Safronov <zimniy@cyberbrain.cc>
…pilation

- Merged the exception handling for FileNotFoundError and ValueError into a single block to streamline error processing during schema loading. This change simplifies the code and maintains the existing functionality of appending schema problems and caching results.

Signed-off-by: Dmitrii Safronov <zimniy@cyberbrain.cc>
disafronov and others added 22 commits December 6, 2025 04:12
- Eliminated the unused `loaded_path` variable from the `_load_raw_schema()` call in the `_compile_schema_internal()` function. This change simplifies the code and removes unnecessary comments related to the variable, enhancing clarity.

Signed-off-by: Dmitrii Safronov <zimniy@cyberbrain.cc>
… problems

- Introduced a new helper function `_create_empty_compiled_schema_with_problems` to encapsulate the creation of an empty `CompiledSchema` along with a list of schema problems. This change improves code readability and maintains the existing functionality in the `_compile_schema_internal` function by streamlining the handling of schema compilation errors.

Signed-off-by: Dmitrii Safronov <zimniy@cyberbrain.cc>
- Updated the method of tracking used sources in the `_apply_schema_internal` function by grouping leaves by source first. This change enhances code clarity and efficiency by directly utilizing the keys of the `source_to_leaves` dictionary to determine used sources.

Signed-off-by: Dmitrii Safronov <zimniy@cyberbrain.cc>
… a helper function

- Replaced direct calls to `os.getcwd()` with a new helper function `_get_current_working_directory()` to improve code readability and maintainability. This change centralizes the logic for obtaining the current working directory, ensuring consistency across the schema loading functions.

Signed-off-by: Dmitrii Safronov <zimniy@cyberbrain.cc>
…per functions

- Added new test cases for `_get_current_working_directory`, `_create_empty_compiled_schema_with_problems`, and `_load_raw_schema` to improve coverage and ensure correct functionality.
- Introduced helper functions for checking root conflicts and compiling schema trees, enhancing the modularity and readability of the schema loading process.
- Updated existing tests to validate behavior for various edge cases, including handling of invalid JSON and schema structures.

Signed-off-by: Dmitrii Safronov <zimniy@cyberbrain.cc>
…ethod

- Introduced a new method `_cleanup_failed_logger` to encapsulate the logic for removing a logger instance from the logging manager when schema compilation fails. This change improves code readability and maintainability by centralizing the cleanup process, preventing broken logger instances from being cached.

Signed-off-by: Dmitrii Safronov <zimniy@cyberbrain.cc>
…n schema

- Introduced a new helper function `_is_leaf_node` to determine if a schema node is a leaf based on the presence of 'type' or 'source' fields. This change enhances code readability and modularity by centralizing the logic for leaf node identification.
- Updated the `_compile_schema_tree` function to utilize the new helper function, improving clarity in the schema compilation process.

Signed-off-by: Dmitrii Safronov <zimniy@cyberbrain.cc>
- Introduced multiple test cases for the new `_is_leaf_node` function to validate its behavior with various input scenarios, including nodes with and without 'type' and 'source' fields. This enhances test coverage and ensures the correctness of the leaf node identification logic.

Signed-off-by: Dmitrii Safronov <zimniy@cyberbrain.cc>
- Updated the `_compile_schema_internal` function to directly use the result of `_get_schema_path()` without calling `resolve()`. This change enhances code clarity by removing unnecessary complexity in the schema path handling.

Signed-off-by: Dmitrii Safronov <zimniy@cyberbrain.cc>
…pilation

- Updated the exception handling in the `SchemaLogger` class to specifically catch `OSError`, `ValueError`, and `RuntimeError` during schema compilation. This change ensures that the logger instance is properly cleaned up from the logging manager in case of these exceptions, preventing partially initialized loggers from being cached.
- Added unit tests to verify that the logger correctly handles these exceptions and cleans up as expected.

Signed-off-by: Dmitrii Safronov <zimniy@cyberbrain.cc>
- Added a note to the README regarding the handling of system-level errors such as `OSError` and `RuntimeError` during schema validation. This clarification helps users distinguish between schema validation failures and environmental issues, ensuring better understanding of exception management in the application.

Signed-off-by: Dmitrii Safronov <zimniy@cyberbrain.cc>
…ialization

- Updated the README to include information on handling system-level errors such as `OSError` and `RuntimeError` during logger initialization. This addition clarifies the distinction between schema validation errors and environmental issues, enhancing user understanding of exception management.

Signed-off-by: Dmitrii Safronov <zimniy@cyberbrain.cc>
…a application

- Enhanced the logic for reporting redundant fields in the `_apply_schema_internal` function. If the schema is empty, all fields are now considered redundant, allowing for a more efficient membership check. This change improves performance and clarity in handling extra values not defined in the schema.

Signed-off-by: Dmitrii Safronov <zimniy@cyberbrain.cc>
- Added a note in the `_validate_and_apply_leaf` function to emphasize the necessity of using `isinstance()` for type narrowing, despite the prior guarantee that `value` is a list. This clarification enhances code readability and understanding of type validation logic.

Signed-off-by: Dmitrii Safronov <zimniy@cyberbrain.cc>
- Revised the README to clarify the handling of system-level errors, including `OSError`, `ValueError`, and `RuntimeError`, during logger initialization and schema compilation. This update enhances user understanding of the distinction between schema validation failures and environmental issues.
- Updated comments in the `SchemaLogger` class to reflect the new exception handling logic, specifically addressing path resolution issues and ensuring clarity in the documentation of potential exceptions during schema compilation.

Signed-off-by: Dmitrii Safronov <zimniy@cyberbrain.cc>
…h as an argument

- Modified the `_load_raw_schema` function to take `schema_path` as a parameter instead of retrieving it internally. This change enhances flexibility and allows for better control over schema file loading.
- Updated related tests to reflect the new function signature, ensuring that the correct schema path is passed during testing.

Signed-off-by: Dmitrii Safronov <zimniy@cyberbrain.cc>
- Enhanced the thread safety of the `_compile_schema_internal` function by implementing double-checked locking. This change prevents multiple threads from compiling the same schema simultaneously, ensuring that cached results are returned correctly during concurrent access.
- Updated comments to clarify the use of double-checked locking in the context of schema compilation.

Signed-off-by: Dmitrii Safronov <zimniy@cyberbrain.cc>
- Updated the README to provide clearer distinctions between schema validation errors and system-level errors, specifically detailing the handling of `OSError`, `ValueError`, and `RuntimeError`.
- Improved comments in the `schema_loader` and `schema_logger` modules to clarify the propagation of exceptions during schema file reading and compilation, ensuring users understand the context of these errors.

Signed-off-by: Dmitrii Safronov <zimniy@cyberbrain.cc>
- Introduced a new workflow that triggers on pull request events to the release branch. It generates a PR description and automatically updates the PR title and body to include a timestamped release note.
- This enhancement streamlines the release process by ensuring consistent and informative PR descriptions.

Signed-off-by: Dmitrii Safronov <zimniy@cyberbrain.cc>
- Added permissions for reading contents and writing to pull requests in the auto PR description workflow. This enhancement ensures the workflow can properly access and modify PR details as needed.

Signed-off-by: Dmitrii Safronov <zimniy@cyberbrain.cc>
- Changed the action used for generating pull request descriptions from `riskledger/generate-pull-request-description@v1` to `octue/generate-pull-request-description@1.0.0.beta-2`.
- Updated the output variable from `description` to `pull_request_description` to align with the new action's output format.

Signed-off-by: Dmitrii Safronov <zimniy@cyberbrain.cc>
@github-actions github-actions Bot changed the title New release Release PR for 2025-12-06 00:46 Dec 6, 2025
- Changed the action used for generating pull request descriptions from `octue/generate-pull-request-description@1.0.0.beta-2` to `tanmay-pathak/generate-pull-request-description@v1.0.0`.
- Updated the input variable for the pull request URL to use the more direct `github.event.pull_request.url`.

Signed-off-by: Dmitrii Safronov <zimniy@cyberbrain.cc>
@github-actions github-actions Bot changed the title Release PR for 2025-12-06 00:46 Release PR for 2025-12-06 00:49 Dec 6, 2025
@disafronov disafronov merged commit cc0661a into release Dec 6, 2025
9 checks passed
@disafronov
Copy link
Copy Markdown
Owner Author

🎉 This PR is included in version 0.1.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants